mirror of
https://github.com/verilator/verilator.git
synced 2026-10-03 16:44:11 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f79749e7b2 | ||
|
|
1a77030c9b | ||
|
|
817ade27fb | ||
|
|
4afa14b612 | ||
|
|
9caa79a7ea | ||
|
|
446f21d2a0 | ||
|
|
06521f6cf1 | ||
|
|
75336670d7 | ||
|
|
106a9fe67f | ||
|
|
a5eccc199b | ||
|
|
837d9f9d77 | ||
|
|
959387b69f | ||
|
|
fd0703b8c8 | ||
|
|
3ff608b9cb | ||
|
|
edc0a0e982 | ||
|
|
1549ff9185 | ||
|
|
3454641244 | ||
|
|
5dedf25e3b | ||
|
|
7214c180ae | ||
|
|
aa0ef554b3 | ||
|
|
a6015863d8 | ||
|
|
5a694ccb8a | ||
|
|
f7d09c671a | ||
|
|
4de1b22672 | ||
|
|
4bdda3f240 | ||
|
|
ced1dfeffd | ||
|
|
0774f825cf | ||
|
|
23fe5c1b93 | ||
|
|
bd4afeea69 | ||
|
|
3ee9b33f8a | ||
|
|
5be0813893 | ||
|
|
f94c1b32e5 | ||
|
|
ff4923cf67 | ||
|
|
5788bc8048 | ||
|
|
5749662194 | ||
|
|
d5d1cc47e0 | ||
|
|
da043ca16d | ||
|
|
9aa90569bf | ||
|
|
294d78e0e2 | ||
|
|
8182c3fe2c | ||
|
|
6f7bc38088 | ||
|
|
dcbc0ccfdc | ||
|
|
399319dc1c | ||
|
|
35d6da391b | ||
|
|
fcbd7c87af | ||
|
|
97feba6898 | ||
|
|
9249ffdb84 | ||
|
|
71df9e3381 | ||
|
|
3c964147be | ||
|
|
54b4b6b378 | ||
|
|
cff37f0775 | ||
|
|
8b1cc3b303 | ||
|
|
65b6121186 | ||
|
|
3d30527860 | ||
|
|
24a9f7c650 | ||
|
|
242f661644 | ||
|
|
32019d2bc4 | ||
|
|
b252bb048f | ||
|
|
ba47c01a01 | ||
|
|
51266898ec | ||
|
|
f9164ab0d2 | ||
|
|
c43e707f43 | ||
|
|
85b7f828b3 | ||
|
|
7005a65d32 | ||
|
|
776d4e6ac2 | ||
|
|
1c88c3083c | ||
|
|
4522834f7a | ||
|
|
9ee5fd0585 | ||
|
|
63b2dbb827 | ||
|
|
5bee8ef15b | ||
|
|
e7de3d368f | ||
|
|
d45deccc0a | ||
|
|
d5b03ab721 | ||
|
|
d1ff81a41c | ||
|
|
43fa6858f6 | ||
|
|
db7eb45433 | ||
|
|
21c01ba97b | ||
|
|
b517fb5ee3 | ||
|
|
9dbc669199 | ||
|
|
7d2d32420a | ||
|
|
48e98ea2bd | ||
|
|
01d0f0327b | ||
|
|
0dc887720d | ||
|
|
e08bbcdb07 | ||
|
|
70d26ec123 | ||
|
|
a06f260f42 | ||
|
|
d42f76c346 | ||
|
|
66c3d6d2d1 | ||
|
|
81affad2dc | ||
|
|
2488af9066 | ||
|
|
5cf9d78516 | ||
|
|
3a9eeabdb2 | ||
|
|
ac4315e145 | ||
|
|
5094e94df1 | ||
|
|
4b7b185d05 | ||
|
|
6cb0335d28 | ||
|
|
c248318958 | ||
|
|
c3e5db5f04 | ||
|
|
058233fc87 | ||
|
|
186c851695 | ||
|
|
5aa36357f6 | ||
|
|
191d30cf1c | ||
|
|
d8c2ecaaf8 | ||
|
|
a7b0551d23 | ||
|
|
dc34968fe7 | ||
|
|
45f064f7cb | ||
|
|
545caba720 | ||
|
|
0e24f36fef | ||
|
|
db7935faf3 | ||
|
|
9cc218db3e | ||
|
|
15f8ebc562 | ||
|
|
205cae963b | ||
|
|
df2746de71 | ||
|
|
7f471d862e | ||
|
|
338acabe2b | ||
|
|
4f1f487ae4 | ||
|
|
77502aeb97 | ||
|
|
ba82d43ca1 | ||
|
|
e9135598b3 | ||
|
|
1c0739db10 | ||
|
|
dfd3907787 | ||
|
|
1069652701 | ||
|
|
70b82f1aec | ||
|
|
5573bdb219 | ||
|
|
cf68578261 | ||
|
|
f407d442d4 | ||
|
|
7f12ad9d91 | ||
|
|
5efe9367d2 | ||
|
|
cfce92645f | ||
|
|
519792d02b | ||
|
|
bfa1f2d7ce | ||
|
|
42beaf467c | ||
|
|
8303938d0e | ||
|
|
0ece155418 | ||
|
|
4f7e155e59 | ||
|
|
ff324625e4 | ||
|
|
fd7515b046 | ||
|
|
607f853bc7 | ||
|
|
09fb1174f1 | ||
|
|
542eaab3dd | ||
|
|
a301a498f5 | ||
|
|
d66e749ec8 | ||
|
|
c8ca54ea31 | ||
|
|
5704552053 | ||
|
|
426069a4dd | ||
|
|
19d0aabe7a | ||
|
|
fb0d735f68 | ||
|
|
167a30be1c | ||
|
|
5982528274 | ||
|
|
de3095e3b4 | ||
|
|
8e0682f442 | ||
|
|
140994d2c4 | ||
|
|
950e29d56e | ||
|
|
65667356b6 | ||
|
|
6b393e9d7c | ||
|
|
4818130e4f | ||
|
|
9da3aacd08 | ||
|
|
729f8b9334 | ||
|
|
279216048b | ||
|
|
2ce7a348df | ||
|
|
46f719ceaa | ||
|
|
949be301de | ||
|
|
be429a5800 | ||
|
|
e7714e0902 | ||
|
|
4835ed6967 | ||
|
|
0198a3fc52 | ||
|
|
e095bf1af0 | ||
|
|
d5de67c6dc | ||
|
|
2267db093f | ||
|
|
5aecfa98a1 | ||
|
|
485e230dd8 | ||
|
|
befb415f27 | ||
|
|
c0490627bf | ||
|
|
d269fbb446 | ||
|
|
444020f7c7 | ||
|
|
6188083baa | ||
|
|
c2a524d80b | ||
|
|
e6f5a0495f | ||
|
|
0606a29f13 | ||
|
|
c6052830e1 | ||
|
|
4bb876aee5 | ||
|
|
a3640c1767 | ||
|
|
250c6950cf | ||
|
|
76f5de6e54 | ||
|
|
1a1c5c5d44 | ||
|
|
4ae80f9a9f | ||
|
|
8a3cb8daa8 | ||
|
|
64ab537b68 | ||
|
|
fdea386727 | ||
|
|
28944ed862 | ||
|
|
3250ee5707 | ||
|
|
d308a561e4 | ||
|
|
584f8cc9e7 | ||
|
|
61e1483b74 | ||
|
|
3bb4e34044 | ||
|
|
832b17d4d2 | ||
|
|
76c5875912 | ||
|
|
266dc7679a | ||
|
|
d693dc85e4 | ||
|
|
add68130b8 | ||
|
|
d9b5680a45 | ||
|
|
dc25be536c | ||
|
|
7708c88e32 | ||
|
|
707f230353 | ||
|
|
49d2eb9a08 | ||
|
|
128186ea68 | ||
|
|
949be9d0a1 | ||
|
|
3e986517c3 | ||
|
|
5d3a9eec7f | ||
|
|
3d21a79148 | ||
|
|
e15f5266a3 | ||
|
|
9130eb8b99 | ||
|
|
09e856d2f3 | ||
|
|
ee5c0a2902 | ||
|
|
621b7e63cf | ||
|
|
c6bf9fb89e | ||
|
|
f794180865 | ||
|
|
0e769d42a1 | ||
|
|
cbeb9d39ff | ||
|
|
5a98c1a3b1 | ||
|
|
cac634d39b | ||
|
|
08330bad0b | ||
|
|
84a46939b3 | ||
|
|
65a484e00b | ||
|
|
843fdd3e57 | ||
|
|
a10b51705f | ||
|
|
df86e39845 | ||
|
|
7f49b6c102 | ||
|
|
754a0b8320 | ||
|
|
7d3b3761b2 | ||
|
|
d1b80ffa29 | ||
|
|
f95ce886f1 | ||
|
|
fa16eff003 | ||
|
|
23f90b13f3 | ||
|
|
37e7b5dfc7 | ||
|
|
e1683afb31 | ||
|
|
e38b359d75 | ||
|
|
b6dcec2710 | ||
|
|
0307d59c1f | ||
|
|
3aa013c8db | ||
|
|
fc70876aa9 | ||
|
|
722ab9306a | ||
|
|
2ab34b5eeb | ||
|
|
e3bdae77a0 | ||
|
|
663d6a1c8d | ||
|
|
bf5cbb512e | ||
|
|
d4bb58630e | ||
|
|
fff0eb5d88 | ||
|
|
7ae0c5d546 | ||
|
|
114d93b212 | ||
|
|
13a87e5514 | ||
|
|
d67d75282c | ||
|
|
827cbf22c9 | ||
|
|
2530cda507 | ||
|
|
38000a3da0 | ||
|
|
6c21b21ecc | ||
|
|
8caf9be3e6 | ||
|
|
cdb61842d6 | ||
|
|
05660d1118 | ||
|
|
a3f9221a67 | ||
|
|
7e1980af7a | ||
|
|
921fd919b5 | ||
|
|
fc5a5ea53d | ||
|
|
86156dd05b | ||
|
|
3219ffddd4 | ||
|
|
3a01c32bf9 | ||
|
|
9ffd0a4e70 | ||
|
|
90e049c674 | ||
|
|
69121633cf | ||
|
|
28eadded87 | ||
|
|
93c598dd19 | ||
|
|
d012563ab1 | ||
|
|
0b96789e65 | ||
|
|
947402bc57 | ||
|
|
d4107dce52 | ||
|
|
990b19e048 | ||
|
|
2290e6ccf2 | ||
|
|
14c8f072f1 | ||
|
|
c55df02b1a | ||
|
|
5b86248b54 | ||
|
|
449ac44131 | ||
|
|
f439a7927f | ||
|
|
277bd67f72 | ||
|
|
5de8ccbf32 | ||
|
|
577e0700ba | ||
|
|
71a37484f5 | ||
|
|
daf157e6c0 | ||
|
|
2aa6a229ca | ||
|
|
9b869edd90 | ||
|
|
2b21697b86 | ||
|
|
895ab8789b | ||
|
|
5f02f95ce6 | ||
|
|
f2aac8c49a | ||
|
|
82e653a739 | ||
|
|
053f760e2a | ||
|
|
ba9e141fae | ||
|
|
d60a3e2b66 | ||
|
|
70c2d1eded | ||
|
|
80cbf81b3b | ||
|
|
798d7346cf | ||
|
|
d6c5d40f9b | ||
|
|
371b8310d9 | ||
|
|
1ac721af8f | ||
|
|
85fd88ace2 | ||
|
|
ed1e377bb1 | ||
|
|
4240c29f4b | ||
|
|
51ba4a1531 | ||
|
|
d1b55cb7aa | ||
|
|
bbf53bd5af | ||
|
|
b2ced6ff1d | ||
|
|
a9b07fe7d7 | ||
|
|
66e4656a8e | ||
|
|
8f4d4f07a4 | ||
|
|
8e55580cde | ||
|
|
8ae79066a2 | ||
|
|
36da6a3563 | ||
|
|
45690faea7 | ||
|
|
046fecbb35 | ||
|
|
0f6024ef3c | ||
|
|
2488b5a97f | ||
|
|
56de6f1a9f | ||
|
|
0fc5d37901 | ||
|
|
ea4cc4e076 | ||
|
|
9e25c21fed | ||
|
|
fc3fdcc71c | ||
|
|
80b7b8bbdb | ||
|
|
a8ce272e4a | ||
|
|
72963c4e20 | ||
|
|
4e5bd361e0 | ||
|
|
ed1a9309d4 | ||
|
|
1d0a06438c | ||
|
|
2c62714a30 | ||
|
|
f13e753b52 | ||
|
|
39a5bce8a6 | ||
|
|
ba953bfa94 | ||
|
|
1debd0405b | ||
|
|
1f1d9312d2 | ||
|
|
259201b352 | ||
|
|
bb45bd048e | ||
|
|
5489ec6eff | ||
|
|
e55e81bcd0 | ||
|
|
5c5c758718 | ||
|
|
b87669039e | ||
|
|
60a6ed2a20 | ||
|
|
81e8388c3f | ||
|
|
4532680e5f | ||
|
|
fc17ab280a | ||
|
|
621cd0f008 | ||
|
|
13c9877099 | ||
|
|
ff889fde18 | ||
|
|
f68c16a5e6 | ||
|
|
cc45f64280 | ||
|
|
725ec088ea | ||
|
|
87c3de5aab | ||
|
|
6d7c04a3de | ||
|
|
d0f5ce0cc4 | ||
|
|
cb89ef9885 | ||
|
|
90360d40fd | ||
|
|
15dcd326f8 | ||
|
|
ae1eb56695 | ||
|
|
a47fd07585 | ||
|
|
19bc257002 | ||
|
|
a1d4cd658e | ||
|
|
21093fd1bd | ||
|
|
329a933efd | ||
|
|
e21198cb2d | ||
|
|
ab502c5196 | ||
|
|
12728bc478 | ||
|
|
3fc684359a | ||
|
|
1e28387541 | ||
|
|
dd917d50eb | ||
|
|
0130c2bceb | ||
|
|
8a5804fc3a | ||
|
|
3df29085c8 | ||
|
|
976af0068b | ||
|
|
a85e6a9d8c | ||
|
|
463ea57b0a | ||
|
|
326a60d307 | ||
|
|
2c60c5f816 | ||
|
|
faf3804b9a | ||
|
|
08a433260c | ||
|
|
7fc278f6db | ||
|
|
b1a95f642f | ||
|
|
c6a569df49 | ||
|
|
06661ab676 | ||
|
|
d9a0e69597 | ||
|
|
a0997d0b98 | ||
|
|
a3ff375ce7 | ||
|
|
c03affa544 | ||
|
|
4703fc39be | ||
|
|
9bf0e54937 | ||
|
|
b039f246df | ||
|
|
a93b344096 | ||
|
|
191c71edea | ||
|
|
b4dd398af6 | ||
|
|
cfe0fdd5cc | ||
|
|
003a8cfe75 | ||
|
|
7559af5879 | ||
|
|
47a7e75841 | ||
|
|
adf1de45de | ||
|
|
45f955f175 | ||
|
|
063f9a7a4c | ||
|
|
c82a098f2e | ||
|
|
393b7714c4 | ||
|
|
43d8de4f80 | ||
|
|
026bbc306b | ||
|
|
f8b0e359b9 | ||
|
|
94ef1b76d0 | ||
|
|
50929e5d43 | ||
|
|
3f4b7af8a1 | ||
|
|
bc6a7787ed | ||
|
|
5064ec2806 | ||
|
|
4f19eeaffa | ||
|
|
10d0088f73 | ||
|
|
15d0ec317d | ||
|
|
260d58e47e | ||
|
|
d9c4d9316f | ||
|
|
e9441cff50 | ||
|
|
daa545774e | ||
|
|
dee2e45e27 | ||
|
|
4d29487e75 | ||
|
|
2bb2935924 | ||
|
|
aff3f7c4f6 | ||
|
|
5aa4f46101 | ||
|
|
8f87022496 | ||
|
|
d34aa10faf | ||
|
|
93d50c4499 | ||
|
|
4eb280601e | ||
|
|
b778784333 | ||
|
|
9121a81a74 | ||
|
|
d3cbb1e53f | ||
|
|
cf88700fc2 | ||
|
|
072d76fe8e | ||
|
|
3436d1780f | ||
|
|
1607225063 | ||
|
|
807e5b22a0 | ||
|
|
2c64b83c19 | ||
|
|
dfc98e77c0 | ||
|
|
936bb7b1ed | ||
|
|
88e5017564 | ||
|
|
508f6f7e5a | ||
|
|
70eceae3d8 | ||
|
|
eb5aad94f1 | ||
|
|
2d89c458f6 | ||
|
|
d33ded22f9 | ||
|
|
edc32ca82d | ||
|
|
dc9c81256d | ||
|
|
6908e471e7 | ||
|
|
e3558d9e1b | ||
|
|
11043aeb9b | ||
|
|
15c163c12e | ||
|
|
c7ed73e249 | ||
|
|
4aa3e72509 | ||
|
|
31130c4b4a | ||
|
|
00f0027c80 | ||
|
|
c8be50d40b | ||
|
|
e16e9b89cd | ||
|
|
80b291407b | ||
|
|
d2aff13402 | ||
|
|
82f450d838 | ||
|
|
f6d4f1ad02 | ||
|
|
645e1387e0 | ||
|
|
d3c14cc1ac | ||
|
|
33468fa0e7 | ||
|
|
0e955d503e | ||
|
|
18e317fb78 | ||
|
|
ef9f443532 | ||
|
|
6e3b957b30 | ||
|
|
aea1834ed8 | ||
|
|
7f3e178b68 | ||
|
|
87a7881d46 | ||
|
|
29f4821d78 | ||
|
|
9f9c84aa64 | ||
|
|
d80e0523cc | ||
|
|
164aa96953 | ||
|
|
6a12c4d02a | ||
|
|
6a7dfb7696 | ||
|
|
4208db7811 | ||
|
|
a19dddf05e | ||
|
|
7855a78a0f | ||
|
|
248bd173d3 | ||
|
|
8d2be855f5 | ||
|
|
ba8700f99d | ||
|
|
f20997a2f0 | ||
|
|
bea225e191 | ||
|
|
93517b8378 | ||
|
|
a39c7f7dac | ||
|
|
5125b94fd8 | ||
|
|
d118a739dc | ||
|
|
c2a8810eb1 | ||
|
|
91c44d7830 | ||
|
|
21aafe8f50 | ||
|
|
4a8cfe367d | ||
|
|
b56e7f6910 | ||
|
|
8a85cedaf5 | ||
|
|
be26e8da1b | ||
|
|
b2dd5de860 | ||
|
|
6ea725f479 | ||
|
|
665758a68b | ||
|
|
5b8941d717 | ||
|
|
f4865a4bb2 | ||
|
|
53835355b0 | ||
|
|
5cd3d831bb | ||
|
|
3069860fdf | ||
|
|
3a8288b0f6 | ||
|
|
30fd49e21f | ||
|
|
bc7048e8d1 | ||
|
|
a98eceb501 | ||
|
|
c2bdd06fcc | ||
|
|
8918f17c17 | ||
|
|
604af511fc | ||
|
|
5a39fc4ba9 | ||
|
|
30d6edd2e5 | ||
|
|
79f99dddf7 | ||
|
|
c3fa475096 | ||
|
|
5ef373500f | ||
|
|
be53eec5ca | ||
|
|
41e5f6b7d5 | ||
|
|
c1c0aa61f9 | ||
|
|
e94023367f | ||
|
|
317fe7a787 | ||
|
|
035bf13e4a | ||
|
|
6a60ace2c7 | ||
|
|
901d1d8087 | ||
|
|
6cd26edb64 | ||
|
|
956fd89b87 | ||
|
|
3fe81a3832 | ||
|
|
ff2f711d0c | ||
|
|
46cc7b5d07 | ||
|
|
4d453c6822 | ||
|
|
a1160a85a3 | ||
|
|
e5eb7d8930 | ||
|
|
83f6b11235 | ||
|
|
5fce23e90d | ||
|
|
7e4760a7e4 | ||
|
|
2d6d1235d6 | ||
|
|
520f6e5fdc | ||
|
|
30f6831be6 | ||
|
|
26e2f9e629 | ||
|
|
1d2293b783 | ||
|
|
4784daa7dc | ||
|
|
78fe77db0f | ||
|
|
c039a5229d | ||
|
|
2ab70ba452 | ||
|
|
4370490a71 | ||
|
|
816cff009a | ||
|
|
e004ea7ae2 | ||
|
|
6159a7dd8d | ||
|
|
be65030d61 | ||
|
|
a168d593eb | ||
|
|
6ab47f799b | ||
|
|
fd52f7f479 | ||
|
|
b24d7c83d3 | ||
|
|
bf4a844f2b | ||
|
|
5dbff89a90 | ||
|
|
9255707dd4 | ||
|
|
24198ef0ed | ||
|
|
8064b78d4f | ||
|
|
fde380868a | ||
|
|
be42dc906c | ||
|
|
bad4110b03 | ||
|
|
f6b101d98b | ||
|
|
80a144797d | ||
|
|
a86ded97c9 | ||
|
|
45abcb6107 | ||
|
|
1f58f48c05 | ||
|
|
d5a18c99fe | ||
|
|
c0499da28b | ||
|
|
3ccb2e0f2d | ||
|
|
afd7c2ae25 | ||
|
|
bb44d4e4f2 | ||
|
|
d64971ba35 | ||
|
|
71d29a235f | ||
|
|
65daf99bf4 | ||
|
|
299261714b | ||
|
|
c2b09e35f8 | ||
|
|
c3b4bc85fa | ||
|
|
3340f7b0b4 | ||
|
|
cb413aa264 | ||
|
|
982fa3d7bb | ||
|
|
51de2c9194 | ||
|
|
a15cd76a28 | ||
|
|
7a15457511 | ||
|
|
4f7df4a915 | ||
|
|
a554dd7c8d | ||
|
|
073af8e1f2 | ||
|
|
2eafd82696 | ||
|
|
7d93952a0d | ||
|
|
1ddb2dd5e7 | ||
|
|
2770ddf071 | ||
|
|
bae60ab8ea |
@@ -29,19 +29,21 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
|
||||
os: [ubuntu-22.04, ubuntu-20.04]
|
||||
compiler:
|
||||
- { cc: clang, cxx: clang++ }
|
||||
- { cc: gcc, cxx: g++ }
|
||||
m32: [0, 1]
|
||||
exclude:
|
||||
# Build pull requests only with ubuntu-22.04 and without m32
|
||||
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
|
||||
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
|
||||
- m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
|
||||
# Build -m32 only on ubuntu-22.04
|
||||
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
|
||||
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
|
||||
# - m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
|
||||
# Build -m32 only on ubuntu-22.04 clang++
|
||||
- {os: ubuntu-18.04, m32: 1}
|
||||
- {os: ubuntu-20.04, m32: 1}
|
||||
- compiler: { cc: gcc, cxx: g++ }
|
||||
m32: 1
|
||||
include:
|
||||
# Build GCC 10 on ubuntu-20.04
|
||||
- os: ubuntu-20.04
|
||||
@@ -97,7 +99,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
|
||||
os: [ubuntu-22.04, ubuntu-20.04]
|
||||
compiler:
|
||||
- { cc: clang, cxx: clang++ }
|
||||
- { cc: gcc, cxx: g++ }
|
||||
@@ -105,12 +107,14 @@ jobs:
|
||||
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, vltmt-0, vltmt-1]
|
||||
exclude:
|
||||
# Build pull requests only with ubuntu-22.04 and without m32
|
||||
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
|
||||
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
|
||||
- m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
|
||||
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
|
||||
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
|
||||
# - m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
|
||||
# Build -m32 only on ubuntu-22.04
|
||||
- {os: ubuntu-18.04, m32: 1}
|
||||
- {os: ubuntu-20.04, m32: 1}
|
||||
- compiler: { cc: gcc, cxx: g++ }
|
||||
m32: 1
|
||||
include:
|
||||
# Test with GCC 10 on ubuntu-20.04 without m32
|
||||
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-0}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
# Build and push verilator docker image when tags are pushed to the repository.
|
||||
# The following secrets must be configured in the github repository:
|
||||
# DOCKER_HUB_NAMESPACE: docker hub namespace.
|
||||
# DOCKER_HUB_USER: user name for logging into docker hub
|
||||
# DOCKER_HUB_ACCESS_TOKEN: docker hub access token.
|
||||
name: Build Verilator Container
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: [ 'v*' ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
manual_tag:
|
||||
description: 'Git tag to use for image build'
|
||||
required: true
|
||||
type: string
|
||||
add_latest_tag:
|
||||
description: 'Tag workflow_dispatch docker image as "latest"'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
contexts:
|
||||
- "ci/docker/run:verilator"
|
||||
# - "ci/docker/buildenv:verilator-buildenv"
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Extract context variables
|
||||
run: |
|
||||
echo "${{ matrix.contexts }}" | sed -r 's/(.*):.*/build_context=\1/' >> "$GITHUB_ENV"
|
||||
echo "${{ matrix.contexts }}" | sed -r 's/.*:(.*)/image_name=\1/' >> "$GITHUB_ENV"
|
||||
echo "git_tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Use manual tag
|
||||
if: ${{ inputs.manual_tag }}
|
||||
run: |
|
||||
echo "git_tag=${{ inputs.manual_tag }}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }}
|
||||
tags: |
|
||||
type=match,pattern=(v.*),group=1,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
type=raw,value=${{ inputs.manual_tag }},enable=${{ inputs.manual_tag != '' }}
|
||||
type=raw,value=latest,enable=${{ inputs.add_latest_tag == true }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
buildkitd-flags: --debug
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and Push to Docker
|
||||
uses: docker/build-push-action@v4
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
with:
|
||||
context: ${{ env.build_context }}
|
||||
build-args: SOURCE_COMMIT=${{ env.git_tag }}
|
||||
platforms: linux/arm64,linux/amd64
|
||||
push: ${{ !env.ACT && startsWith(github.ref, 'refs/tags/v') }}
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
@@ -0,0 +1,51 @@
|
||||
# DESCRIPTION: Github actions config
|
||||
# This name is key to badges in README.rst, so we use the name build
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
name: msbuild
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0' # weekly
|
||||
|
||||
env:
|
||||
CI_OS_NAME: win
|
||||
CI_COMMIT: ${{ github.sha }}
|
||||
CCACHE_COMPRESS: 1
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: repo
|
||||
|
||||
jobs:
|
||||
|
||||
windows:
|
||||
name: run on windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: repo
|
||||
- name: Cache $CCACHE_DIR
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: msbuild-msvc-cmake
|
||||
- name: compile
|
||||
env:
|
||||
WIN_FLEX_BISON: ${{ github.workspace }}/.ccache
|
||||
run: ./ci/ci-win-compile.ps1
|
||||
- name: test build
|
||||
run: ./ci/ci-win-test.ps1
|
||||
- name: Zip up repository
|
||||
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
|
||||
- name: Upload zip archive
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ${{ github.workspace }}/repo/verilator.zip
|
||||
name: verilator-win.zip
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
#*****************************************************************************
|
||||
#
|
||||
# DESCRIPTION: Script for build tool cmake on both unix and windows
|
||||
#
|
||||
#*****************************************************************************
|
||||
#
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
#
|
||||
#****************************************************************************/
|
||||
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
|
||||
project(Verilator
|
||||
VERSION 5.014
|
||||
HOMEPAGE_URL https://verilator.org
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
option(DEBUG_AND_RELEASE_AND_COVERAGE
|
||||
"Builds both the debug and release binaries, overriding CMAKE_BUILD_TYPE. Not supported under MSBuild.")
|
||||
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
set(PYTHON3 Python3::Interpreter)
|
||||
set(CMAKE_INSTALL_DATADIR ${CMAKE_INSTALL_PREFIX})
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(CheckStructHasMember)
|
||||
include(ExternalProject)
|
||||
|
||||
if (NOT WIN32)
|
||||
message(WARNING "CMake support on Linux/OSX is experimental.")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if (DEFINED ENV{WIN_FLEX_BISON})
|
||||
set(WIN_FLEX_BISON "$ENV{WIN_FLEX_BISON}")
|
||||
endif()
|
||||
if (EXISTS ${WIN_FLEX_BISON})
|
||||
list(APPEND CMAKE_PREFIX_PATH ${WIN_FLEX_BISON})
|
||||
endif()
|
||||
if (NOT WIN_FLEX_BISON)
|
||||
message(FATAL_ERROR "Please install https://github.com/lexxmark/winflexbison and set WIN_FLEX_BISON environment variable. Please use install cmake target after a successful build.")
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
find_package(BISON)
|
||||
find_package(FLEX)
|
||||
|
||||
# Build
|
||||
#set_property(GLOBAL PROPERTY JOB_POOLS one_job=1)
|
||||
|
||||
if (DEBUG_AND_RELEASE_AND_COVERAGE)
|
||||
if (CMAKE_GENERATOR MATCHES "^Visual Studio ")
|
||||
error("%Error: The DEBUG_AND_RELEASE_AND_COVERAGE option is not supported in MSBuild-based builds.")
|
||||
endif()
|
||||
set(saved_build_type ${CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
add_subdirectory(src build-Debug)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
add_subdirectory(src build-Release)
|
||||
set(CMAKE_BUILD_TYPE Coverage)
|
||||
add_subdirectory(src build-Coverage)
|
||||
set(CMAKE_BUILD_TYPE ${saved_build_type})
|
||||
else()
|
||||
add_subdirectory(src)
|
||||
endif()
|
||||
|
||||
# Configuration and Installation
|
||||
|
||||
set(PACKAGE_NAME ${PROJECT_NAME})
|
||||
set(PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
|
||||
configure_file(include/verilated_config.h.in include/verilated_config.h @ONLY)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated_config.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
|
||||
|
||||
configure_package_config_file(verilator-config.cmake.in verilator-config.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
configure_package_config_file(verilator-config-version.cmake.in verilator-config-version.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config-version.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
foreach (program
|
||||
verilator
|
||||
verilator_gantt
|
||||
verilator_ccache_report
|
||||
verilator_difftree
|
||||
verilator_profcfunc
|
||||
)
|
||||
install(PROGRAMS bin/${program} TYPE BIN)
|
||||
endforeach()
|
||||
|
||||
install(DIRECTORY examples TYPE DATA FILES_MATCHING
|
||||
PATTERN "examples/*/*.[chv]*"
|
||||
PATTERN "examples/*/Makefile*"
|
||||
PATTERN "examples/*/CMakeLists.txt"
|
||||
)
|
||||
|
||||
install(DIRECTORY include TYPE DATA FILES_MATCHING
|
||||
PATTERN "include/verilated_config.h"
|
||||
PATTERN "include/verilated.mk"
|
||||
PATTERN "include/*.[chv]"
|
||||
PATTERN "include/*.cpp"
|
||||
PATTERN "include/*.sv"
|
||||
PATTERN "include/gtkwave/*.[chv]*"
|
||||
PATTERN "include/vltstd/*.[chv]*"
|
||||
)
|
||||
@@ -8,6 +8,284 @@ The changes in each Verilator version are described below. The
|
||||
contributors that suggested a given feature are shown in []. Thanks!
|
||||
|
||||
|
||||
Verilator 5.014 2023-08-06
|
||||
==========================
|
||||
|
||||
**Minor:**
|
||||
|
||||
* Deprecation planned for 32-bit pointer -m32 mode (#4268).
|
||||
* Deprecate CMake config below version 3.13 (#4389) (#4390). [Vito Gamberini]
|
||||
* Support some stream operations on queues (#4292). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support property declaration with empty parentheses (#4313) (#4317). [Anthony Donlon]
|
||||
* Support locator methods with "with" on assoc arrays (#4335). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support string replication with variable (#4341). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Support more types in wait (#4374). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Support static method calls as default values of function arguments (#4378). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Add GENUNNAMED lint warning. [Srinivasan Venkataramanan, Deepa Palaniappan]
|
||||
* Add MISINDENT lint warning for misleading indentation.
|
||||
* Fix 'VlForkSync' redeclaration (#4277). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix processes that can outlive their parents (#4253). [Krzysztof Boronski, Antmicro Ltd]
|
||||
* Fix duplicate fork names (#4295). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix splitting coroutines (#4297) (#4307). [Jiamin Zhu]
|
||||
* Fix error when multiple duplicate DPI exports (#4301).
|
||||
* Fix class reference assignment checking (#4296). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix handling of ref types in initial values of type parameters (#4304). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix comparison of string parameters (#4308). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix state update for always processes (#4311). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix multiple edge timing controls in class methods (#4318) (#4320) (#4344). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix implicit calls of base class constructors with optional arguments (#4319). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix propagation of process requirement (#4321). [Krzysztof Boroński]
|
||||
* Fix unhandled overloads in V3InstrCount (#4324). [Krzysztof Boroński]
|
||||
* Fix selects of static members (#4326). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix references to members of results of static methods (#4327). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix unique..with method on queues of class objects (#4328). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix queue slicing (#4329). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix wildcard referring types (#4336) (#4342). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix comparison of class objects (#4346). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix unexpected RefDType on assoc arrays (#4337). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix cmake astgen for Rocky Linux 8.7 (#4343). [Julian Daube]
|
||||
* Fix class timescale in class packages (#4348). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix string concatenations (#4354). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix unlinked task error from broken context (#4355) (#4402). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix selects on unpacked structs (#4359). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix select operation on assoc array with wide keys (#4360). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix non-public methods with wide output (#4364). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix handling of super.new calls (#4366). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix assign to input var in methods (#4367). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix VlProcess not found (#4368). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix order of evaluation of function calls in statements (#4375). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix config_build.h issues (#4380) (#4381). [Andrew Miloradovsky]
|
||||
|
||||
|
||||
Verilator 5.012 2023-06-13
|
||||
==========================
|
||||
|
||||
**Major:**
|
||||
|
||||
* With -j or --build-jobs, multithread Verilator's emit phase of Verilation. [Kamil Rakoczy, Antmicro Ltd]
|
||||
Additional Verilator-internal stages will become multithreaded over time.
|
||||
|
||||
**Minor:**
|
||||
|
||||
* Add --main-top-name option for C main TOP name (#4235) (#4249). [Don Williamson]
|
||||
* Add creating __inputs.vpp file with --debug (#4177). [Tudor Timi]
|
||||
* Add NEWERSTD warning when using feature in newer language standard (#4168) (#4172). [Ethan Sifferman]
|
||||
* Add warning that timing controls in DPI exports are unsupported (#4238). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Support std::process class (#4212). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Support inside expressions with strings and doubles (#4138) (#4139). [Krzysztof Boroński]
|
||||
* Support get_randstate/set_randstate class method functions.
|
||||
* Support for condition operator on class objects (#4214). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support array max (#4275). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Optimize VPI callValueCbs (#4155). [Hennadii Chernyshchyk]
|
||||
* Configure for faster C++ linking using 'mold', if it is installed.
|
||||
* Fix crash on duplicate imported modules (#3231). [Robert Balas]
|
||||
* Fix false WIDTHEXPAND on array declarations (#3959). [JOTEGO]
|
||||
* Fix marking overridden methods as coroutines (#4120) (#4169). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix SystemC signal copy macro use (#4135). [Josep Sans]
|
||||
* Fix duplicate static names in blocks in functions (#4144) (#4160). [Stefan Wallentowitz]
|
||||
* Fix initialization order of initial static after function/task (#4159). [Kamil Rakoczy, Antmicro Ltd]
|
||||
* Fix linking AstRefDType if it has parameterized class ref (#4164) (#4170). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix crash caused by $display() optimization (#4165) (#4166). [Tudor Timi]
|
||||
* Fix arrays of unpacked structs (#4173). [Risto Pejašinović]
|
||||
* Fix $fscanf of decimals overflowing variables (#4174). [Ahmed El-Mahmoudy]
|
||||
* Fix super.new missing data type (#4147). [Tudor Timi]
|
||||
* Fix missing class forward declarations (#4151). [Krzysztof Boroński]
|
||||
* Fix hashes of instances of parameterized classes (#4182). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix forced assignments that override non-continuous assignments (#4183) (#4192). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix wide structure VL_TOSTRING_W generation (#4188) (#4189). [Aylon Chaim Porat]
|
||||
* Fix references to members of parameterized base classes (#4196). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix tracing undefined alignment (#4201) (#4288) [John Wehle]
|
||||
* Fix class specific same methods for AstVarScope, AstVar, and AstScope (#4203) (#4250). [John Wehle]
|
||||
* Fix dotted references in parameterized classes (#4206). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix bit selections under parameterized classes (#4210). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix duplicate std:: declaration with -I (#4215). [Harald Pretl]
|
||||
* Fix deep traversal of class inheritance timing (#4216). [Krzysztof Boroński]
|
||||
* Fix class parameters of enum types (#4219). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix static methods with prototypes (#4220). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix LATCH warning on function local variables (#4221) (#4284) [Julien Margetts]
|
||||
* Fix VCD scope types (#4227) (#4282). [Àlex Torregrosa]
|
||||
* Fix incorrect multi-driven lint warning (#4231) (#4248). [Adrien Le Masle]
|
||||
* Fix missing assignment for wide unpacked structs (#4233). [Jiamin Zhu]
|
||||
* Fix unpacked struct == and != operators (#4234) (#4240). [Risto Pejašinović]
|
||||
* Fix AstStructSel clean when data type is structure (#4241) (#4244). [Risto Pejašinović]
|
||||
* Fix function calls in with statements (#4245). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix operator == for unpacked struct, if elements are VlUnpacked arrays (#4247). [Risto Pejašinović]
|
||||
* Fix STATIC lifetime for variables created from clocking items (#4262). [Krzysztof Boroński]
|
||||
* Fix names of foreach blocks (#4264). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix iterated variables in foreach loops to have VAUTOM lifetimes (#4265). [Krzysztof Boroński]
|
||||
* Fix missing assignment for wide class members (#4267). [Jiamin Zhu]
|
||||
* Fix the global uses timing flag when forks exist (#4274). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix struct redefinition (#4276). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix detection of wire/reg duplicates.
|
||||
* Fix false IMPLICITSTATIC on package functions.
|
||||
* Fix method calls on function return values.
|
||||
|
||||
|
||||
Verilator 5.010 2023-04-30
|
||||
==========================
|
||||
|
||||
**Minor:**
|
||||
|
||||
* Add --public-depth to force public to a certain instance depth (#3952). [Andrew Nolte]
|
||||
* Add --public-params flag (#3990). [Andrew Nolte]
|
||||
* Add CONSTRAINTIGN warning when constraint ignored.
|
||||
* Add STATICVAR warning and convert to automatic (#4018) (#4027) (#4030). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Add error if class types don't match (#4064). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support class extends of package::class.
|
||||
* Support class srandom and class random stability.
|
||||
* Support class method calls without parenthesis (#3902) (#4082). [Srinivasan Venkataramanan]
|
||||
* Support method calls without parenthesis (#4034). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support parameterized return types of methods (#4122). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support parameterized class references in extends statement (#4146). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support complicated IEEE 'for' assignments.
|
||||
* Support $fopen as an expression.
|
||||
* Support ++/-- on dotted member variables.
|
||||
* Optimize static trigger evaluation (#4142). [Geza Lore, X-EPIC]
|
||||
* Optimize more xor trees (#4071). [Yutetsu TAKATSUKASA]
|
||||
* Change range order warning from LITENDIAN to ASCRANGE (#4010). [Iztok Jeras]
|
||||
* Change ZERODLY to a warning.
|
||||
* Fix random internal crashes (#666). [Dag Lem]
|
||||
* Fix install, standardization in cmake CMakeLists.txt (#3974). [Yu-Sheng Lin]
|
||||
* Fix UNDRIVEN warning seg fault (#3989). [Felix Neumärker]
|
||||
* Fix symbol entries when inheriting classes (#3995) (#3996). [Krzysztof Boroński]
|
||||
* Fix event controls reusing same variable (#4014). Kamil Rakoczy <[email protected]>
|
||||
* Fix push to dynamic queue in struct (#4015). [ezchi]
|
||||
* Fix names for blocks in do..while loop (#4019). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix randomize on null field (#4023). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix rand fields in base classes (#4025). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix large return blocks with --comp-limit-blocks (#4028). [tenghtt]
|
||||
* Fix clocking block scope internal error (#4032). [Srinivasan Venkataramanan]
|
||||
* Fix false LATCH warning on --assert 'unique else if' (#4033) ($4054). [Jesse Taube]
|
||||
* Fix characters from DEFENV literals for Conda (#4035) (#4044). [Tim Snyder]
|
||||
* Fix info message prints under --assert (#4036) (#4053). [Srinivasan Venkataramanan]
|
||||
* Fix C++ compile errors when passing class refs as task argument (#4063). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix NBAs inside fork-joins (#4050). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix task calls as fork statements (#4055). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix _Vilp used before declaration (#4057) (#4062). [Josep Sans]
|
||||
* Fix incorrect optimization of bit op tree (#4059) (#4070). [Yutetsu TAKATSUKASA]
|
||||
* Fix parameters in a class body to be localparam (#4061). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix interface generate begin (#4065). [Srinivasan Venkataramanan]
|
||||
* Fix tracing with awaits at end of block (#4075) (#4076). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Fix sense expression variable naming (#4081). [Kamil Rakoczy]
|
||||
* Fix importing symbols from base class (#4084). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix false error on new const assignment (#4098). [Tudor Timi]
|
||||
* Fix unpacked structs under classes (#4102). [Tudor Timi]
|
||||
* Fix variables in class methods to be automatic (#4111) (#4137). [Peter Monsson]
|
||||
* Fix to use parallel build for projects with a lot of files (#4116). [Krzysztof Boroński]
|
||||
* Fix including __Syms header in generated C++ files (#4123). [Krzysztof Boroński]
|
||||
* Fix systemc namespace issues (#4126) (#4127). [Eyck Jentzsch]
|
||||
* Fix class param extends A=B (#4128). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix missing begin block hierarchy in --xml-only cells section (#4129) (#4133). [Risto Pejašinović]
|
||||
* Fix resolution of class lvalues after parameterization (#4131). [Krzysztof Boroński]
|
||||
* Fix DFG error on $countbits (#4101) (#4143). [Paul Donahue]
|
||||
* Fix duplicating parameter class types (#4115). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix class extend param references (#4136). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix -CFLAGS to allow overriding optimization levels (#4140). [Peter Monsson]
|
||||
* Fix DPI function type alias (#4148) (#4149). [Toru Niina]
|
||||
* Fix deleting unused parameterized classes (#4150). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix false ENUMVALUE on expressions and arrays.
|
||||
* Fix unnecessary verilated_std.sv waivers in --waiver-output.
|
||||
|
||||
|
||||
Verilator 5.008 2023-03-04
|
||||
==========================
|
||||
|
||||
**Minor:**
|
||||
|
||||
* Add --annotate-points option, change multipoint on line reporting (#3876). [Nassim Corteggiani]
|
||||
* Add --verilate-jobs option (#3889). [Kamil Rakoczy, Antmicro Ltd]
|
||||
* Add WIDTHEXPAND and WIDTHTRUNC warnings to replace WIDTH (#3900). [Andrew Nolte]
|
||||
* Add SOURCE_DATE_EPOCH for docs/guide/conf.py (#3918). [Larry Doolittle]
|
||||
* Add /*verilator public[flat|flat_rd|flat_rw| ]*/ metacomments (#3894). [Joseph Nwabueze]
|
||||
* Add lint warning on always_comb multidriven (#3888) (#3939). [Adam Bagley]
|
||||
* Add warning on ++/-- over expressions with potential side effects (#3976). [Krzysztof Boroński]
|
||||
* Add error on mixing .name and by-port instantiations.
|
||||
* Removed deprecated --cdc option.
|
||||
* Support unpacked unions.
|
||||
* Support interface classes and class implements.
|
||||
* Support global clocking and $global_clock.
|
||||
* Support class parameters without initial values.
|
||||
* Support cast to numbers from strings.
|
||||
* Support struct I/O in --lib-create (#3378) (#3892). [Varun Koyyalagunta]
|
||||
* Support function calls without parenthesis (#3903) (#3902). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support class extending its parameter (#3904). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support static function variables (#3830). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support recursive methods (#3987). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix real parameters of infinity and NaN.
|
||||
* Fix pattern assignment to unpacked structs (#3510). [Mostafa Garnal]
|
||||
* Fix single-element replication to dynarray/unpacked/queue (#3548). [Gustav Svensk]
|
||||
* Fix constant enum methods (#3621). [Todd Strader]
|
||||
* Fix inconsistent naming of generate scope arrays (#3840). [Andrew Nolte]
|
||||
* Fix namespace fallback resolution (#3863) (#3942). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix std:: to be parsed first (#3864) (#3928). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Fix cmake warning if multiple SOURCES w/o PREFIX (#3916) (#3927). [Yoda Lee]
|
||||
* Fix parameterized class function linkage (#3917). [Ryszard Rozak]
|
||||
* Fix static members of type aliases of a parameterized class (#3922). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix class extend parameter dot case (#3926). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix MsWin missing directory exception, and ::std (#3928) (#3933) (#3935). [Kritik Bhimani]
|
||||
* Fix very long VPI signal names (#3929). [Marlon James]
|
||||
* Fix VPI upper interface scopes not found (#3937). [David Stanford]
|
||||
* Fix virus detection false positive (#3944). [Stuart Morris]
|
||||
* Fix constant string function assignment (#3945). [Todd Strader]
|
||||
* Fix constant format field widths (#3946). [Todd Strader]
|
||||
* Fix class field linking when a super classes is a param (#3949). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix CMake bad C identifiers (#3948) (#3951). [Zixi Li]
|
||||
* Fix build on HP PA architecture (#3954). [John David Anglin]
|
||||
* Fix date on the front page of verilator.pdf (#3956) (#3957). [Larry Doolittle]
|
||||
* Fix associative arrays declared with ref type (#3960). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix missing error on negative replicate (#3963). [Benjamin Menküc]
|
||||
* Fix self references to parameterized classes (#3962). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix LITENDIAN warning is backwards (#3966) (#3967). [Cameron Kirk]
|
||||
* Fix subsequent parameter declarations (#3969). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix timing delays to not truncate below 64 bits (#3973) (#3982). [Felix Neumärker]
|
||||
* Fix cmake on MacOS to mark weak symbols with -U linker flag (#3978) (#3979). [Peter Debacker]
|
||||
* Fix UNDRIVEN warning seg fault (#3989). [Felix Neumärker]
|
||||
* Fix coverage of class methods (#3998). [Tim Paine]
|
||||
* Fix packed array structure replication.
|
||||
* Fix enum.next(0) and enum.prev(0).
|
||||
|
||||
|
||||
Verilator 5.006 2023-01-22
|
||||
==========================
|
||||
|
||||
**Minor:**
|
||||
|
||||
* Support clocking blocks (#3674). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Support packed structs (#3802). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Support Windows-native builds using cmake (#3814). [Kritik Bhimani]
|
||||
* Support p format for UnpackArray (#3877). [Aleksander Kiryk, Antmicro Ltd]
|
||||
* Support property calls without parenthesis (#3879) (#3893). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Support import/export lists in modport (#3886). [Gökçe Aydos]
|
||||
* Support class queue equality (#3895). [Ilya Barkov]
|
||||
* Support type case and type equality comparisons.
|
||||
* Add IMPLICITSTATIC warning when a task/function is implicitly static (#3839). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Add VL_VALUE_STRING_MAX_WORDS override (#3869). [Andrew Nolte]
|
||||
* Optimize expansion of extend operators.
|
||||
* Internal multithreading tests. [Mariusz Glebocki, et al, Antmicro Ltd]
|
||||
* Fix VPI one-time timed callbacks (#2778). [Marlon James, et al]
|
||||
* Fix initiation of function variables (#3815). [Dan Gisselquist]
|
||||
* Fix to zero possibly uninitialized bits in replications (#3815).
|
||||
* Fix crash in DFT due to width use after free (#3817) (#3820). [Jevin Sweval]
|
||||
* Fix signed/unsigned comparison compile warning (#3822). [Kamil Rakoczy]
|
||||
* Fix OS-X weak symbols with -U linker flag (#3823). [Jevin Sweval]
|
||||
* Fix wrong bit op tree optimization (#3824) (#3825). [Yutetsu TAKATSUKASA]
|
||||
* Fix self references when param class instantiated (#3833). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix memory leak in V3Sched, etc. (#3834). [Geza Lore]
|
||||
* Fix compatibility with musl libc / Alpine Linux (#3845). [Sören Tempel]
|
||||
* Fix empty case items crash (#3851). [Rich Porter]
|
||||
* Fix VL_CPU_RELAX on MIPS/Armel/s390/sparc (#3843) (#3891). [Kamil Rakoczy]
|
||||
* Fix module parameter name collision (#3854) (#3855). [James Shi]
|
||||
* Fix unpacked array expansion (#3861). [Joey Liu]
|
||||
* Fix signed/unsigned parameter types (#3866). [James Shi]
|
||||
* Fix chain call of abstract class constructor (#3868) (#3883). [Ilya Barkov]
|
||||
* Fix to use same std in Verilator and Verilated compile (#3881). [Kamil Rakoczy, Antmicro Ltd]
|
||||
* Fix foreach unnamedblk duplicate error (#3885). [Ilya Barkov]
|
||||
* Fix elaboration of member selected classes (#3890). [Ilya Barkov]
|
||||
* Fix mismatched widths in DFG (#3872). [Geza Lore, Yike Zhou]
|
||||
* Fix lint for non-integral types in packed structs.
|
||||
* Fix generate case with empty body statements.
|
||||
|
||||
|
||||
Verilator 5.004 2022-12-14
|
||||
==========================
|
||||
|
||||
@@ -36,7 +314,7 @@ Verilator 5.004 2022-12-14
|
||||
* Add error when use --exe with --lib-create (#3785). [Yinan Xu]
|
||||
* Fix jump handling in do while loops (#3731). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix 'with' clause handling in functions (#3739). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix CONTEXT compile error on mingw64 (#3741). [William D. Jones]
|
||||
* Fix CONTEXT compile error on MingW (#3741). [William D. Jones]
|
||||
* Fix MSVC compiler errors (#3742) (#3746). [Kritik Bhimani]
|
||||
* Fix CASEINCOMPLETE when covers all enum values (#3745) (#3782). [Guy-Armand Kamendje]
|
||||
* Fix return type of $countbits functions to int (#3725). [Ryszard Rozak, Antmicro Ltd]
|
||||
@@ -45,9 +323,9 @@ Verilator 5.004 2022-12-14
|
||||
* Fix missing UNUSED warnings with --coverage (#3736). [alejandro-castro-ortegon]
|
||||
* Fix tracing parameters overridden with -G (#3723). [Iztok Jeras]
|
||||
* Fix folding of LogAnd with non-bool operands (#3726). [Geza Lore]
|
||||
* Fix Dfg optimization issues (#3740) (#3771). [Geza Lore]
|
||||
* Fix DFG optimization issues (#3740) (#3771). [Geza Lore]
|
||||
* Fix pre/postincrement operations (#3744) (#3756). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix cross-compile for MingW, Arm and RiscV (#3752). [Miodrag Milanović]
|
||||
* Fix cross-compile for MingW, Arm and RISC-V (#3752). [Miodrag Milanović]
|
||||
* Fix $unit as base package for other packages (#3755). [Ryszard Rozak, Antmicro Ltd]
|
||||
* Fix make jobserver with submakes (#3758). [Gus Smith]
|
||||
* Fix to escape VERILATOR_ROOT file paths (#3764) (#3765). [Jiacheng Qian]
|
||||
@@ -4041,7 +4319,7 @@ Verilator 0.0 1994-07-08
|
||||
Copyright
|
||||
=========
|
||||
|
||||
Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
+29
-20
@@ -7,7 +7,7 @@
|
||||
#
|
||||
#*****************************************************************************
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
@@ -15,13 +15,13 @@
|
||||
#
|
||||
#****************************************************************************/
|
||||
#
|
||||
# make all to compile and build Verilator.
|
||||
# make install to install it.
|
||||
# make TAGS to update tags tables.
|
||||
# make all to compile and build Verilator.
|
||||
# make install to install it.
|
||||
# make TAGS to update tags tables.
|
||||
#
|
||||
# make clean or make mostlyclean
|
||||
# Delete all files from the current directory that are normally
|
||||
# created by building the program. Don't delete the files that
|
||||
# created by building the program. Don't delete the files that
|
||||
# record the configuration. Also preserve files that could be made
|
||||
# by building, but normally aren't because the distribution comes
|
||||
# with them.
|
||||
@@ -53,7 +53,6 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
MAKEINFO = makeinfo
|
||||
POD2TEXT = pod2text
|
||||
MKINSTALLDIRS = $(SHELL) $(srcdir)/src/mkinstalldirs
|
||||
PERL = @PERL@
|
||||
|
||||
# Version (for docs/guide/conf.py)
|
||||
PACKAGE_VERSION_NUMBER = @PACKAGE_VERSION_NUMBER@
|
||||
@@ -126,7 +125,12 @@ EXAMPLES_FIRST = \
|
||||
EXAMPLES = $(EXAMPLES_FIRST) $(filter-out $(EXAMPLES_FIRST), $(sort $(wildcard examples/*)))
|
||||
|
||||
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
|
||||
VL_INST_MAN_FILES = verilator.1 verilator_coverage.1
|
||||
# No verilator_ccache_report.1, verilator_difftree.1 as those are not bin/ installed
|
||||
VL_INST_MAN_FILES = \
|
||||
verilator.1 \
|
||||
verilator_coverage.1 \
|
||||
verilator_gantt.1 \
|
||||
verilator_profcfunc.1 \
|
||||
|
||||
default: all
|
||||
all: all_nomsg msg_test
|
||||
@@ -149,7 +153,7 @@ msg_test: all_nomsg
|
||||
@echo
|
||||
|
||||
.PHONY: test
|
||||
ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
|
||||
ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
|
||||
test: smoke-test test_regress
|
||||
# examples is part of test_regress's test_regress/t/t_a2_examples.pl
|
||||
# (because that allows it to run in parallel with other test_regress's)
|
||||
@@ -179,8 +183,12 @@ docs: info
|
||||
|
||||
info: $(INFOS)
|
||||
|
||||
%.1: ${srcdir}/bin/%
|
||||
verilator.1: ${srcdir}/bin/verilator
|
||||
pod2man $< $@
|
||||
verilator_coverage.1: ${srcdir}/bin/verilator_coverage
|
||||
pod2man $< $@
|
||||
%.1: ${srcdir}/bin/%
|
||||
help2man --no-info --no-discard-stderr --version-string=- $< -o $@
|
||||
|
||||
.PHONY: verilator.html
|
||||
verilator.html:
|
||||
@@ -193,7 +201,7 @@ verilator.pdf: Makefile
|
||||
|
||||
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
|
||||
VL_INST_BIN_FILES = verilator verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT) \
|
||||
verilator_ccache_report verilator_coverage verilator_gantt verilator_includer verilator_profcfunc
|
||||
verilator_ccache_report verilator_coverage verilator_difftree verilator_gantt verilator_includer verilator_profcfunc
|
||||
# Some scripts go into both the search path and pkgdatadir,
|
||||
# so they can be found by the user, and under $VERILATOR_ROOT.
|
||||
|
||||
@@ -226,6 +234,7 @@ installbin:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
|
||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer )
|
||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_ccache_report $(DESTDIR)$(pkgdatadir)/bin/verilator_ccache_report )
|
||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_difftree $(DESTDIR)$(pkgdatadir)/bin/verilator_difftree )
|
||||
|
||||
# Man files can either be part of the original kit, or built in current directory
|
||||
# So important we use $^ so VPATH is searched
|
||||
@@ -384,6 +393,7 @@ PY_PROGRAMS = \
|
||||
bin/verilator_ccache_report \
|
||||
bin/verilator_difftree \
|
||||
bin/verilator_gantt \
|
||||
bin/verilator_includer \
|
||||
bin/verilator_profcfunc \
|
||||
examples/xml_py/vl_file_copy \
|
||||
examples/xml_py/vl_hier_graph \
|
||||
@@ -397,6 +407,7 @@ PY_PROGRAMS = \
|
||||
src/flexfix \
|
||||
src/vlcovgen \
|
||||
test_regress/t/*.pf \
|
||||
nodist/clang_check_attributes \
|
||||
nodist/code_coverage \
|
||||
nodist/dot_importer \
|
||||
nodist/fuzzer/actual_fail \
|
||||
@@ -413,17 +424,15 @@ YAPF_FLAGS = -i
|
||||
yapf:
|
||||
$(YAPF) $(YAPF_FLAGS) $(PY_FILES)
|
||||
|
||||
FLAKE8 = flake8
|
||||
FLAKE8_FLAGS = \
|
||||
--extend-exclude=fastcov.py \
|
||||
--ignore=E123,E129,E251,E402,E501,W503,W504,E701
|
||||
|
||||
PYLINT = pylint
|
||||
PYLINT_FLAGS = --score=n --disable=R0801
|
||||
|
||||
RUFF = ruff
|
||||
RUFF_FLAGS = check --ignore=E402,E501,E701
|
||||
|
||||
lint-py:
|
||||
-$(FLAKE8) $(FLAKE8_FLAGS) $(PY_PROGRAMS)
|
||||
-$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS)
|
||||
-$(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS)
|
||||
|
||||
format-pl-exec:
|
||||
-chmod a+x test_regress/t/*.pl
|
||||
@@ -440,8 +449,8 @@ install-msg:
|
||||
|
||||
IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in
|
||||
|
||||
# autoheader might not change config_build.h.in, so touch it
|
||||
${srcdir}/config_build.h: ${srcdir}/config_build.h.in configure
|
||||
# autoheader might not change config_package.h.in, so touch it
|
||||
${srcdir}/config_package.h: ${srcdir}/config_package.h.in configure
|
||||
cd ${srcdir} && autoheader
|
||||
touch $@
|
||||
Makefile: Makefile.in config.status $(IN_WILD)
|
||||
@@ -451,7 +460,7 @@ config.status: configure
|
||||
./config.status --recheck
|
||||
|
||||
configure: configure.ac
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
autoconf --warnings=all
|
||||
else
|
||||
autoconf
|
||||
@@ -490,7 +499,7 @@ distclean maintainer-clean::
|
||||
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \
|
||||
${srcdir}/*.in ${srcdir}/*.pod
|
||||
|
||||
TAGS: $(TAGFILES)
|
||||
TAGS: $(TAGFILES)
|
||||
etags $(TAGFILES)
|
||||
|
||||
.PHONY: doxygen
|
||||
|
||||
+12
-9
@@ -1,12 +1,16 @@
|
||||
.. Github doesn't render images unless absolute URL
|
||||
.. Do not know of a conditional tag, "only: github" nor "github display" works
|
||||
|
||||
.. image:: https://img.shields.io/badge/Website-Verilator.org-181717.svg
|
||||
:target: https://verilator.org
|
||||
.. image:: https://img.shields.io/badge/License-LGPL%20v3-blue.svg
|
||||
:target: https://www.gnu.org/licenses/lgpl-3.0]
|
||||
:target: https://www.gnu.org/licenses/lgpl-3.0
|
||||
.. image:: https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg
|
||||
:target: https://opensource.org/licenses/Artistic-2.0
|
||||
.. image:: https://repology.org/badge/tiny-repos/verilator.svg?header=distro%20packages
|
||||
:target: https://repology.org/project/verilator/versions
|
||||
.. image:: https://img.shields.io/docker/pulls/verilator/verilator
|
||||
:target: https://hub.docker.com/r/verilator/verilator
|
||||
.. image:: https://api.codacy.com/project/badge/Grade/fa78caa433c84a4ab9049c43e9debc6f
|
||||
:target: https://www.codacy.com/gh/verilator/verilator
|
||||
.. image:: https://codecov.io/gh/verilator/verilator/branch/master/graph/badge.svg
|
||||
@@ -57,17 +61,16 @@ files, the "Verilated" code.
|
||||
|
||||
These Verilated C++/SystemC files are then compiled by a C++ compiler
|
||||
(gcc/clang/MSVC++), optionally along with a user's own C++/SystemC wrapper
|
||||
file to instantiate the Verilated model. Executing the resulting executable
|
||||
performs the design simulation. Verilator also supports linking Verilated
|
||||
generated libraries, optionally encrypted, into other simulators.
|
||||
file, to instantiate the Verilated model. Executing the resulting
|
||||
executable performs the design simulation. Verilator also supports linking
|
||||
Verilated generated libraries, optionally encrypted, into other simulators.
|
||||
|
||||
Verilator may not be the best choice if you are expecting a full-featured
|
||||
replacement for a closed-source Verilog simulator, needs SDF annotation,
|
||||
mixed-signal simulation, or are doing a quick class project (we recommend
|
||||
`Icarus Verilog`_ for classwork.) However, if you are looking for a path
|
||||
to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of
|
||||
synthesizable designs containing limited verification constructs, Verilator
|
||||
is the tool for you.
|
||||
designs, Verilator is the tool for you.
|
||||
|
||||
|
||||
Performance
|
||||
@@ -83,11 +86,11 @@ as `Icarus Verilog`_. Another 2-10x speedup might be gained from
|
||||
multithreading (yielding 200-1000x total over interpreted simulators).
|
||||
|
||||
Verilator has typically similar or better performance versus the
|
||||
closed-source Verilog simulators (Carbon Design Systems Carbonator,
|
||||
closed-source Verilog simulators (e.g., Carbon Design Systems Carbonator,
|
||||
Modelsim/Questa, Cadence Incisive/NC-Verilog, Synopsys VCS, VTOC, and
|
||||
Pragmatic CVer/CVC). But, Verilator is open-sourced, so you can spend on
|
||||
computes rather than licenses. Thus, Verilator gives you the best
|
||||
cycles/dollar.
|
||||
simulation cycles/dollar.
|
||||
|
||||
|
||||
Installation & Documentation
|
||||
@@ -139,7 +142,7 @@ Related Projects
|
||||
Open License
|
||||
============
|
||||
|
||||
Verilator is Copyright 2003-2022 by Wilson Snyder. (Report bugs to
|
||||
Verilator is Copyright 2003-2023 by Wilson Snyder. (Report bugs to
|
||||
`Verilator Issues <https://verilator.org/issues>`_.)
|
||||
|
||||
Verilator is free software; you can redistribute it and/or modify it under
|
||||
|
||||
+9
-4
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env perl
|
||||
######################################################################
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
@@ -362,7 +362,7 @@ detailed descriptions of these arguments.
|
||||
+incdir+<dir> Directory to search for includes
|
||||
--inline-mult <value> Tune module inlining
|
||||
--instr-count-dpi <value> Assumed dynamic instruction count of DPI imports
|
||||
-j <jobs> Parallelism for --build (alias to --build-jobs)
|
||||
-j <jobs> Parallelism for --build-jobs/--verilate-jobs
|
||||
--l2-name <value> Verilog scope name of the top module
|
||||
--language <lang> Default language standard to parse
|
||||
-LDFLAGS <flags> Linker pre-object arguments for makefile
|
||||
@@ -372,6 +372,7 @@ detailed descriptions of these arguments.
|
||||
--make <build-tool> Generate scripts for specified build tool
|
||||
-MAKEFLAGS <flags> Arguments to pass to make during --build
|
||||
--main Generate C++ main() file
|
||||
--main-top-name Specify top name passed to Verilated model in generated C++ main
|
||||
--max-num-width <value> Maximum number width (default: 64K)
|
||||
--Mdir <directory> Name of output object directory
|
||||
--MMD Create .d dependency files
|
||||
@@ -404,6 +405,7 @@ detailed descriptions of these arguments.
|
||||
--protect-key <key> Key for symbol protection
|
||||
--protect-lib <name> Create a DPI protected library
|
||||
--public Debugging; see docs
|
||||
--public-params Mark all parameters as public_flat
|
||||
--public-flat-rw Mark all variables, etc as public_flat_rw
|
||||
-pvalue+<name>=<value> Overwrite toplevel parameter
|
||||
--quiet-exit Don't print the command on failure
|
||||
@@ -416,6 +418,8 @@ detailed descriptions of these arguments.
|
||||
--no-skip-identical Disable skipping identical output
|
||||
--stats Create statistics file
|
||||
--stats-vars Provide statistics on variables
|
||||
--no-std Prevent parsing standard library
|
||||
--structs-packed Convert all unpacked structures to packed structures
|
||||
-sv Enable SystemVerilog parsing
|
||||
+systemverilogext+<ext> Synonym for +1800-2017ext+<ext>
|
||||
--threads <threads> Enable multithreading
|
||||
@@ -444,7 +448,8 @@ detailed descriptions of these arguments.
|
||||
--unused-regexp <regexp> Tune UNUSED lint signals
|
||||
-V Verbose version and config
|
||||
-v <filename> Verilog library
|
||||
--no-verilate Skip verilation and just compile previously Verilated code
|
||||
--verilate-jobs Job threads for Verilation stage
|
||||
--no-verilate Skip Verilation and just compile previously Verilated code
|
||||
+verilog1995ext+<ext> Synonym for +1364-1995ext+<ext>
|
||||
+verilog2001ext+<ext> Synonym for +1364-2001ext+<ext>
|
||||
--version Displays program version and exits
|
||||
@@ -495,7 +500,7 @@ description of these arguments.
|
||||
|
||||
The latest version is available from L<https://verilator.org>.
|
||||
|
||||
Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
redistribute it and/or modify the Verilator internals under the terms of
|
||||
either the GNU Lesser General Public License Version 3 or the Perl Artistic
|
||||
License Version 2.0.
|
||||
|
||||
@@ -12,9 +12,12 @@ from datetime import datetime
|
||||
parser = argparse.ArgumentParser(
|
||||
allow_abbrev=False,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="""Report ccache behavior of a Verilated model build.""",
|
||||
description="""Report ccache behavior of a Verilated model build.
|
||||
|
||||
For documentation see
|
||||
https://verilator.org/guide/latest/exe_verilator_ccache_report.html""",
|
||||
epilog=
|
||||
"""Copyright 2002-2022 by Wilson Snyder. This program is free software; you
|
||||
"""Copyright 2002-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env perl
|
||||
######################################################################
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
@@ -169,6 +169,7 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
|
||||
--annotate <output_dir> Directory name for source annotation.
|
||||
--annotate-all All files should be shown.
|
||||
--annotate-min <count> Minimum occurrence count for uncovered.
|
||||
--annotate-points Annotates info from each coverage point.
|
||||
--help Displays this message and version and exits.
|
||||
--rank Compute relative importance of tests.
|
||||
--unlink With --write, unlink all inputs
|
||||
@@ -187,7 +188,7 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
|
||||
|
||||
The latest version is available from L<https://verilator.org>.
|
||||
|
||||
Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify the Verilator internals under the terms
|
||||
of either the GNU Lesser General Public License Version 3 or the Perl
|
||||
Artistic License Version 2.0.
|
||||
|
||||
+8
-11
@@ -42,8 +42,8 @@ def diff_dir(a, b):
|
||||
continue
|
||||
a = files[base]['a']
|
||||
b = files[base]['b']
|
||||
print("=" * 70)
|
||||
print("= %s <-> %s" % (a, b))
|
||||
print("=" * 70, flush=True)
|
||||
print("= %s <-> %s" % (a, b), flush=True)
|
||||
diff_file(a, b)
|
||||
anyfile = True
|
||||
if not anyfile:
|
||||
@@ -104,16 +104,13 @@ def filterf(fn1, fn2):
|
||||
parser = argparse.ArgumentParser(
|
||||
allow_abbrev=False,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="""Compare two Verilator debugging trees""",
|
||||
epilog=
|
||||
"""Verilator_difftree is used for debugging Verilator tree output files.
|
||||
description="""Compare two Verilator debugging trees.
|
||||
|
||||
Verilator_difftree is used for debugging Verilator tree output files.
|
||||
It performs a diff between two files, or all files common between two
|
||||
directories, ignoring irrelevant pointer differences.
|
||||
|
||||
For documentation see
|
||||
https://verilator.org/guide/latest/exe_verilator_difftree.html
|
||||
|
||||
Copyright 2005-2022 by Wilson Snyder. This program is free software; you
|
||||
directories, ignoring irrelevant pointer differences.""",
|
||||
epilog=
|
||||
"""Copyright 2005-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
+6
-6
@@ -475,16 +475,16 @@ def write_vcd(filename):
|
||||
parser = argparse.ArgumentParser(
|
||||
allow_abbrev=False,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="""Create Gantt chart of multi-threaded execution""",
|
||||
epilog=
|
||||
"""Verilator_gantt creates a visual representation to help analyze Verilator
|
||||
description="""Create Gantt chart of multi-threaded execution.
|
||||
|
||||
Verilator_gantt creates a visual representation to help analyze Verilator
|
||||
#xmultithreaded simulation performance, by showing when each macro-task
|
||||
#xstarts and ends, and showing when each thread is busy or idle.
|
||||
|
||||
For documentation see
|
||||
https://verilator.org/guide/latest/exe_verilator_gantt.html
|
||||
|
||||
Copyright 2018-2022 by Wilson Snyder. This program is free software; you
|
||||
https://verilator.org/guide/latest/exe_verilator_gantt.html""",
|
||||
epilog=
|
||||
"""Copyright 2018-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
+25
-16
@@ -1,20 +1,29 @@
|
||||
#!/usr/bin/env perl
|
||||
# DESCRIPTION: Print include statements for each ARGV
|
||||
#!/usr/bin/env python3
|
||||
# pylint: disable=C0114,C0209
|
||||
#
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify the Verilator internals under the terms
|
||||
# of either the GNU Lesser General Public License Version 3 or the Perl
|
||||
# Artistic License Version 2.0.
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
######################################################################
|
||||
|
||||
require 5.005;
|
||||
use warnings;
|
||||
print "// DESCR" . "IPTION: Generated by verilator_includer via makefile\n";
|
||||
foreach my $param (@ARGV) {
|
||||
if ($param =~ /^-D([^=]+)=(.*)/) {
|
||||
print "#define $1 $2\n";
|
||||
} else {
|
||||
print "#include \"$param\"\n";
|
||||
}
|
||||
}
|
||||
import re
|
||||
import sys
|
||||
|
||||
print("// DESCR" + "IPTION: Generated by verilator_includer via makefile")
|
||||
|
||||
re_arg_d = re.compile(r'^-D([^=]+)=(.*)')
|
||||
|
||||
for arg in sys.argv[1:]:
|
||||
match_d = re_arg_d.match(arg)
|
||||
if match_d:
|
||||
print("#define %s %s" % (match_d.group(1), match_d.group(2)))
|
||||
else:
|
||||
print("#include \"%s\"" % (arg))
|
||||
|
||||
######################################################################
|
||||
# Local Variables:
|
||||
# compile-command: "./verilator_includer -Ddef=value -Ddef2=value2 file1.h file2.h"
|
||||
# End:
|
||||
|
||||
@@ -171,17 +171,17 @@ def profcfunc(filename):
|
||||
parser = argparse.ArgumentParser(
|
||||
allow_abbrev=False,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="""Read gprof report created with --prof-cfuncs""",
|
||||
epilog=
|
||||
"""Verilator_profcfunc reads a profile report created by gprof. The names of
|
||||
description="""Read gprof report created with --prof-cfuncs.
|
||||
|
||||
Verilator_profcfunc reads a profile report created by gprof. The names of
|
||||
the functions are then transformed, assuming the user used Verilator's
|
||||
--prof-cfuncs, and a report printed showing the percentage of time, etc,
|
||||
in each Verilog block.
|
||||
|
||||
For documentation see
|
||||
https://verilator.org/guide/latest/exe_verilator_profcfunc.html
|
||||
|
||||
Copyright 2002-2022 by Wilson Snyder. This program is free software; you
|
||||
https://verilator.org/guide/latest/exe_verilator_profcfunc.html""",
|
||||
epilog=
|
||||
"""Copyright 2002-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
+21
-2
@@ -57,19 +57,28 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
||||
# build Verilator
|
||||
|
||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
||||
sudo apt-get update ||
|
||||
sudo apt-get update
|
||||
sudo apt-get install libfl-dev ccache
|
||||
if [ "$CI_RUNS_ON" != "ubuntu-22.04" ]; then
|
||||
sudo apt-get install ccache help2man libfl-dev ||
|
||||
sudo apt-get install ccache help2man libfl-dev
|
||||
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ]; then
|
||||
# Some conflict of libunwind verison on 22.04, can live without it for now
|
||||
sudo apt-get install libgoogle-perftools-dev ||
|
||||
sudo apt-get install libgoogle-perftools-dev
|
||||
fi
|
||||
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
||||
sudo apt-get install libsystemc libsystemc-dev ||
|
||||
sudo apt-get install libsystemc libsystemc-dev
|
||||
fi
|
||||
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
||||
sudo apt-get install mold ||
|
||||
sudo apt-get install mold
|
||||
fi
|
||||
if [ "$COVERAGE" = 1 ]; then
|
||||
yes yes | sudo cpan -fi Parallel::Forker
|
||||
fi
|
||||
if [ "$CI_M32" = 1 ]; then
|
||||
sudo apt-get install gcc-multilib g++-multilib ||
|
||||
sudo apt-get install gcc-multilib g++-multilib
|
||||
fi
|
||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
||||
@@ -90,13 +99,23 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
||||
# run the tests
|
||||
|
||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
||||
sudo apt-get update ||
|
||||
sudo apt-get update
|
||||
# libfl-dev needed for internal coverage's test runs
|
||||
sudo apt-get install gdb gtkwave lcov libfl-dev ccache ||
|
||||
sudo apt-get install gdb gtkwave lcov libfl-dev ccache
|
||||
# Required for test_regress/t/t_dist_attributes.pl
|
||||
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
||||
sudo apt-get install libclang-dev mold ||
|
||||
sudo apt-get install libclang-dev mold
|
||||
pip3 install clang==14.0
|
||||
fi
|
||||
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
||||
sudo apt-get install libsystemc-dev ||
|
||||
sudo apt-get install libsystemc-dev
|
||||
fi
|
||||
if [ "$CI_M32" = 1 ]; then
|
||||
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib ||
|
||||
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib
|
||||
fi
|
||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
||||
|
||||
if [ "$CI_OS_NAME" = "osx" ]; then
|
||||
export VERILATOR_TEST_NO_GDB=1 # Pain to get GDB to work on OS X
|
||||
# TODO below may no longer be requried as configure checks for -pg
|
||||
# TODO below may no longer be required as configure checks for -pg
|
||||
export VERILATOR_TEST_NO_GPROF=1 # Apple Clang has no -pg
|
||||
# export PATH="/Applications/gtkwave.app/Contents/Resources/bin:$PATH" # fst2vcd
|
||||
file bin/verilator_bin
|
||||
@@ -85,7 +85,7 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
||||
"$MAKE" -j "$NPROC" -k
|
||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
||||
export VERILATOR_TEST_NO_GDB=1 # Disable for now, ideally should run
|
||||
# TODO below may no longer be requried as configure checks for -pg
|
||||
# TODO below may no longer be required as configure checks for -pg
|
||||
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
|
||||
git clone --depth 1 https://github.com/lexxmark/winflexbison
|
||||
cd winflexbison
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. --install-prefix $PWD/../../../.ccache
|
||||
cmake --build . --config Release -j 3
|
||||
cmake --install . --prefix $PWD/../../../.ccache
|
||||
cd ../..
|
||||
}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. --install-prefix $PWD/../install
|
||||
cmake --build . --config Release -j 3
|
||||
cmake --install . --prefix $PWD/../install
|
||||
@@ -0,0 +1,10 @@
|
||||
cd install
|
||||
$Env:VERILATOR_ROOT=$PWD
|
||||
cd examples/cmake_tracing_c
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --config Release -j 3
|
||||
Release/example.exe
|
||||
cd ..
|
||||
Remove-Item -path build -recurse
|
||||
@@ -23,6 +23,7 @@ RUN apt-get update \
|
||||
gdb \
|
||||
git \
|
||||
gtkwave \
|
||||
help2man \
|
||||
libfl2 \
|
||||
libfl-dev \
|
||||
libgoogle-perftools-dev \
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
Verilator Build Docker Container
|
||||
================================
|
||||
|
||||
|
||||
@@ -19,10 +19,16 @@ RUN apt-get update \
|
||||
ccache \
|
||||
flex \
|
||||
git \
|
||||
help2man \
|
||||
libfl2 \
|
||||
libfl-dev \
|
||||
libgoogle-perftools-dev \
|
||||
numactl \
|
||||
perl \
|
||||
perl-doc \
|
||||
python3 \
|
||||
zlib1g \
|
||||
zlib1g-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -39,7 +45,7 @@ RUN git clone "${REPO}" verilator && \
|
||||
git checkout "${SOURCE_COMMIT}" && \
|
||||
autoconf && \
|
||||
./configure && \
|
||||
make -j "$(nproc)" && \
|
||||
make && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -r verilator
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
Verilator Executable Docker Container
|
||||
=====================================
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# DESCRIPTION: codecov.io config
|
||||
#
|
||||
# Copyright 2020-2022 by Wilson Snyder. This program is free software; you
|
||||
# Copyright 2020-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
|
||||
+23
-14
@@ -1,20 +1,20 @@
|
||||
# DESCRIPTION: Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. Verilator is free software; you
|
||||
# Copyright 2003-2023 by Wilson Snyder. Verilator is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||
# General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
# When releasing, also update header of Changes file
|
||||
# When releasing, also update header of Changes file, and CmakeLists.txt,
|
||||
# and commit using "devel release" or "Version bump" message
|
||||
# Then 'make maintainer-dist'
|
||||
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
|
||||
#AC_INIT([Verilator],[#.### devel])
|
||||
AC_INIT([Verilator],[5.004 2022-12-14],
|
||||
AC_INIT([Verilator],[5.014 2023-08-06],
|
||||
[https://verilator.org],
|
||||
[verilator],[https://verilator.org])
|
||||
|
||||
AC_CONFIG_HEADERS(src/config_build.h)
|
||||
AC_CONFIG_HEADERS(src/config_package.h)
|
||||
AC_CONFIG_FILES(Makefile src/Makefile src/Makefile_obj include/verilated.mk include/verilated_config.h verilator.pc verilator-config.cmake verilator-config-version.cmake)
|
||||
|
||||
# Version
|
||||
@@ -68,7 +68,7 @@ AC_MSG_CHECKING(whether to use -m32)
|
||||
AC_ARG_ENABLE([m32],
|
||||
[AS_HELP_STRING([--enable-m32],
|
||||
[Use -m32 for all compilation and link,
|
||||
including Verialtor and generated models.])],
|
||||
including Verilator and generated models.])],
|
||||
[case "${enableval}" in
|
||||
yes) CFG_ENABLE_M32=yes ;;
|
||||
no) CFG_ENABLE_M32=no ;;
|
||||
@@ -112,7 +112,7 @@ AC_MSG_CHECKING(whether to show and stop on compilation warnings)
|
||||
AC_ARG_ENABLE([ccwarn],
|
||||
[AS_HELP_STRING([--enable-ccwarn],
|
||||
[enable showing and stopping on compilation warnings
|
||||
in Verilator binrary and Verilated makefiles])],
|
||||
in Verilator binary and Verilated makefiles])],
|
||||
[case "${enableval}" in
|
||||
yes) CFG_WITH_CCWARN=yes ;;
|
||||
no) CFG_WITH_CCWARN=no ;;
|
||||
@@ -351,15 +351,11 @@ AC_SUBST(CFG_CXXFLAGS_PROFILE)
|
||||
# Currently enable c++17/c++14 due to packaged SystemC dependency
|
||||
# c++17 is the newest that Verilator is regularly tested to support
|
||||
# c++11 is the oldest that Verilator supports
|
||||
# gnu is requried for Cygwin to compile verilated.h successfully
|
||||
# gnu is required for Cygwin to compile verilated.h successfully
|
||||
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++20)
|
||||
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++20)
|
||||
case "$(which lsb_release 2>&1 > /dev/null && lsb_release -d)" in
|
||||
*Arch*Linux* | *Ubuntu*22.04*)
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++17)
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17)
|
||||
;;
|
||||
esac
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14)
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++14)
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++11)
|
||||
@@ -474,6 +470,10 @@ m4_foreach([ldflag], [
|
||||
AC_SUBST(CFG_LDLIBS_THREADS)
|
||||
AC_SUBST(CFG_LDFLAGS_THREADS_CMAKE)
|
||||
|
||||
# If 'mold' is installed, use it to link for faster buildtimes
|
||||
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -fuse-ld=mold)
|
||||
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_VERILATED, -fuse-ld=mold)
|
||||
|
||||
# When linking partially statically
|
||||
if test "$CFG_ENABLE_PARTIAL_STATIC" = "yes"; then
|
||||
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -static-libgcc)
|
||||
@@ -484,6 +484,7 @@ else
|
||||
LTCMALLOC=-ltcmalloc_minimal
|
||||
fi
|
||||
AC_SUBST(CFG_LDFLAGS_SRC)
|
||||
AC_SUBST(CFG_LDFLAGS_VERILATED)
|
||||
|
||||
# The pthread library is required by tcmalloc, so add it if it exists. If it
|
||||
# does not, the tcmalloc check below will fail anyway, and linking against
|
||||
@@ -532,15 +533,22 @@ AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
|
||||
[_my_result=no])
|
||||
])
|
||||
|
||||
# Add $CFG_CXXFLAGS_STD only if can't compile correctly otherwise,
|
||||
# as adding std= when not needed can cause errors with the C++ std library.
|
||||
CFG_CXXFLAGS_STD=$CFG_CXXFLAGS_STD_NEWEST
|
||||
AC_MSG_CHECKING(whether $CXX supports C++11)
|
||||
_MY_CXX_CHECK_CXX_VER()
|
||||
AC_MSG_RESULT($_my_result)
|
||||
if test "$_my_result" = "no" ; then
|
||||
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD_NEWEST"
|
||||
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE $CFG_CXXFLAGS_STD_NEWEST"
|
||||
AC_MSG_CHECKING(whether $CXX supports C++11 with $CFG_CXXFLAGS_STD_NEWEST)
|
||||
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD"
|
||||
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE $CFG_CXXFLAGS_STD"
|
||||
AC_MSG_CHECKING(whether $CXX supports C++11 with $CFG_CXXFLAGS_STD)
|
||||
_MY_CXX_CHECK_CXX_VER()
|
||||
AC_MSG_RESULT($_my_result)
|
||||
else
|
||||
# CFG_CXXFLAGS_STD is also propagated to include/verilated.mk.in
|
||||
# make sure we use the same std flag while compiling verilator and verilated design
|
||||
CFG_CXXFLAGS_STD=""
|
||||
fi
|
||||
if test "$_my_result" = "no" ; then
|
||||
AC_MSG_NOTICE([[]])
|
||||
@@ -549,6 +557,7 @@ if test "$_my_result" = "no" ; then
|
||||
Verilator requires a C++11 or newer compiler.]])
|
||||
|
||||
fi
|
||||
AC_SUBST(CFG_CXXFLAGS_STD)
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
|
||||
|
||||
+21
-14
@@ -10,9 +10,12 @@ contributions flow more efficiently.
|
||||
Did you find a bug?
|
||||
-------------------
|
||||
|
||||
- Please **Ensure the bug was not already reported** by searching
|
||||
- Please **ensure the bug was not already reported** by searching
|
||||
`Verilator Issues <https://verilator.org/issues>`__.
|
||||
|
||||
- Please **download the latest development GitHub version**, build, and see
|
||||
if the issue has been fixed.
|
||||
|
||||
- If you're unable to find an open issue addressing the problem, `open a
|
||||
new Verilator issue <https://verilator.org/issues/new>`__.
|
||||
|
||||
@@ -20,21 +23,28 @@ Did you find a bug?
|
||||
demonstrating the bug and expected behavior that is not occurring.
|
||||
|
||||
- The ideal example works against other simulators, and is in the
|
||||
test_regress/t test format, as described in `docs/internals
|
||||
<internals.rst>`__.
|
||||
test_regress/t test format, as described in
|
||||
`Verilator Internals Documentation
|
||||
<https://github.com/verilator/verilator/blob/master/docs/internals.rst>`__.
|
||||
|
||||
|
||||
Did you write a patch that fixes a bug?
|
||||
---------------------------------------
|
||||
|
||||
- Please `Open a new issue <https://verilator.org/issues/new>`__.
|
||||
- Please `Open a new Verilator issue <https://verilator.org/issues/new>`__
|
||||
if there is not one already describing the bug.
|
||||
|
||||
- You may attach a patch to the issue, or (preferred) may request a
|
||||
GitHub pull request.
|
||||
- Please `Open a Verilator pull request
|
||||
<https://github.com/verilator/verilator/pulls>`__.
|
||||
|
||||
- Verilator uses GitHub Actions to provide continuous integration. You
|
||||
may want to enable Actions on your GitHub branch to ensure your changes
|
||||
keep the tests passing. See `docs/internals <internals.rst>`__.
|
||||
- See the coding conventions, and other developer information in
|
||||
``docs/internals.rst`` in the distribution, or as rendered at
|
||||
`Verilator Internals Documentation
|
||||
<https://github.com/verilator/verilator/blob/master/docs/internals.rst>`__.
|
||||
|
||||
- Verilator uses GitHub Actions to provide continuous integration. You
|
||||
may want to enable Actions on your GitHub branch to ensure your changes
|
||||
keep the tests passing.
|
||||
|
||||
- Your source-code contributions must be certified as open source,
|
||||
under the `Developer Certificate of
|
||||
@@ -56,13 +66,10 @@ Did you write a patch that fixes a bug?
|
||||
contribution.
|
||||
|
||||
- Your test contributions are generally considered released into the
|
||||
Creative Commons Public Domain (CC0), unless you request otherwise or
|
||||
Creative Commons Public Domain (CC0), unless you request otherwise, or
|
||||
put a GNU/Artistic license on your file.
|
||||
|
||||
- Most important is we get your patch. If you’d like to clean up
|
||||
indentation and related issues ahead of our feedback, that is
|
||||
appreciated; please see the coding conventions in `docs/internals
|
||||
<internals.rst>`__.
|
||||
- Most important is we get your patch.
|
||||
|
||||
|
||||
Do you have questions?
|
||||
|
||||
+40
-2
@@ -3,6 +3,7 @@ under the Developer Certificate of Origin (https://developercertificate.org/).
|
||||
|
||||
Please see the Verilator manual for 200+ additional contributors. Thanks to all.
|
||||
|
||||
Adam Bagley
|
||||
Adrien Le Masle
|
||||
Ahmed El-Mahmoudy
|
||||
Aleksander Kiryk
|
||||
@@ -11,8 +12,13 @@ Alex Chadwick
|
||||
Aliaksei Chapyzhenka
|
||||
Ameya Vikram Singh
|
||||
Andreas Kuster
|
||||
Andrei Kostovski
|
||||
Andrew Miloradovsky
|
||||
Andrew Nolte
|
||||
Anthony Donlon
|
||||
Arkadiusz Kozdra
|
||||
Aylon Chaim Porat
|
||||
Cameron Kirk
|
||||
Chris Randall
|
||||
Chuxuan Wang
|
||||
Conor McCullough
|
||||
@@ -22,27 +28,35 @@ David Horton
|
||||
David Metz
|
||||
David Stanford
|
||||
David Turner
|
||||
Don Williamson
|
||||
Drew Ranck
|
||||
Drew Taussig
|
||||
Driss Hafdi
|
||||
Edgar E. Iglesias
|
||||
Eric Rippey
|
||||
Ethan Sifferman
|
||||
Eyck Jentzsch
|
||||
Fan Shupei
|
||||
february cozzocrea
|
||||
Felix Neumärker
|
||||
Felix Yan
|
||||
G-A. Kamendje
|
||||
Garrett Smith
|
||||
Geza Lore
|
||||
Gianfranco Costamagna
|
||||
Glen Gibb
|
||||
Gökçe Aydos
|
||||
Graham Rushton
|
||||
Guokai Chen
|
||||
Gustav Svensk
|
||||
G-A. Kamendje
|
||||
Harald Heckmann
|
||||
Hennadii Chernyshchyk
|
||||
Howard Su
|
||||
Huang Rui
|
||||
Huanghuang Zhou
|
||||
HungMingWu
|
||||
HyungKi Jeong
|
||||
Ilya Barkov
|
||||
Iru Cai
|
||||
Ivan Vnučec
|
||||
Iztok Jeras
|
||||
@@ -50,17 +64,27 @@ Jake Merdich
|
||||
James Hanlon
|
||||
James Hutchinson
|
||||
James Pallister
|
||||
James Shi
|
||||
Jamey Hicks
|
||||
Jamie Iles
|
||||
Jan Van Winkel
|
||||
Jean Berniolles
|
||||
Jeremy Bennett
|
||||
Jesse Taube
|
||||
Jevin Sweval
|
||||
Jiacheng Qian
|
||||
Jiamin Zhu
|
||||
Jiuyang Liu
|
||||
Joey Liu
|
||||
John Coiner
|
||||
John Demme
|
||||
John Wehle
|
||||
Jonathan Drolet
|
||||
Jose Loyola
|
||||
Josep Sans
|
||||
Joseph Nwabueze
|
||||
Josh Redford
|
||||
Julian Daube
|
||||
Julie Schwartz
|
||||
Julien Margetts
|
||||
Kaleb Barrett
|
||||
@@ -70,6 +94,8 @@ Keith Colbert
|
||||
Kevin Kiningham
|
||||
Kritik Bhimani
|
||||
Krzysztof Bieganski
|
||||
Krzysztof Boronski
|
||||
Krzysztof Boroński
|
||||
Kuba Ober
|
||||
Larry Doolittle
|
||||
Ludwig Rogiers
|
||||
@@ -95,9 +121,11 @@ Mostafa Gamal
|
||||
Nandu Raj
|
||||
Nathan Kohagen
|
||||
Nathan Myers
|
||||
Oleh Maksymenko
|
||||
Patrick Stewart
|
||||
Paul Wright
|
||||
Pawel Sagan
|
||||
Peter Debacker
|
||||
Peter Horvath
|
||||
Peter Monsson
|
||||
Philipp Wagner
|
||||
@@ -108,22 +136,29 @@ Qingyao Sun
|
||||
Rafal Kapuscik
|
||||
Raynard Qiao
|
||||
Richard Myers
|
||||
Risto Pejašinović
|
||||
Robert Balas
|
||||
Rupert Swarbrick
|
||||
Ryszard Rozak
|
||||
Samuel Riedel
|
||||
Sean Cross
|
||||
Sebastien Van Cauwenberghe
|
||||
Sergi Granell
|
||||
Srinivasan Venkataramanan
|
||||
Stefan Wallentowitz
|
||||
Stephen Henry
|
||||
Steven Hugg
|
||||
Sören Tempel
|
||||
Teng Huang
|
||||
Tim Hutt
|
||||
Tim Snyder
|
||||
Tobias Rosenkranz
|
||||
Tobias Wölfel
|
||||
Todd Strader
|
||||
Tomasz Gorochowik
|
||||
Topa Topino
|
||||
Toru Niina
|
||||
Tudor Timi
|
||||
Tymoteusz Blazejczyk
|
||||
Udi Finkelstein
|
||||
Unai Martinez-Corral
|
||||
@@ -131,14 +166,17 @@ Varun Koyyalagunta
|
||||
Vassilis Papaefstathiou
|
||||
Veripool API Bot
|
||||
Victor Besyakov
|
||||
Vito Gamberini
|
||||
William D. Jones
|
||||
Wilson Snyder
|
||||
Xi Zhang
|
||||
Yinan Xu
|
||||
Yoda Lee
|
||||
Yossi Nivin
|
||||
Yu-Sheng Lin
|
||||
Yuri Victorovich
|
||||
Yutetsu TAKATSUKASA
|
||||
Yu-Sheng Lin
|
||||
Yves Mathieu
|
||||
Zhanglei Wang
|
||||
Zixi Li
|
||||
أحمد المحمودي
|
||||
|
||||
+6
-2
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Code available from: https://verilator.org
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
@@ -18,12 +18,16 @@
|
||||
RST2HTML = rst2html
|
||||
PYTHON3 = python3
|
||||
DOXYGEN = doxygen
|
||||
SPHINXOPTS ?= -c guide
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
|
||||
SOURCEDIR = guide
|
||||
BUILDDIR = _build
|
||||
|
||||
SPHINXOPTS ?= -c guide
|
||||
ifneq ($(VERILATOR_ANALYTICS_ID),)
|
||||
SPHINXOPTS += -D html_theme_options.analytics_id=$(VERILATOR_ANALYTICS_ID)
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
@@ -40,7 +40,7 @@ parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="""Read a file and extract documentation data.""",
|
||||
epilog=
|
||||
""" Copyright 2021-2022 by Wilson Snyder. This package is free software;
|
||||
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
|
||||
you can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
@@ -55,7 +55,7 @@ parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="""Post-process Sphinx HTML.""",
|
||||
epilog=
|
||||
""" Copyright 2021-2022 by Wilson Snyder. This package is free software;
|
||||
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
|
||||
you can redistribute it and/or modify it under the terms of either the GNU
|
||||
Lesser General Public License Version 3 or the Perl Artistic License
|
||||
Version 2.0.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. comment: generated by t_lint_width_docs_bad
|
||||
.. comment: generated by t_lint_widthexpand_docs_bad
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 3
|
||||
@@ -1,4 +1,4 @@
|
||||
.. comment: generated by t_lint_width_docs_bad
|
||||
.. comment: generated by t_lint_widthexpand_docs_bad
|
||||
.. code-block:: sv
|
||||
:emphasize-lines: 1
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
.. comment: generated by t_lint_widthexpand_docs_bad
|
||||
.. code-block::
|
||||
|
||||
%Warning-WIDTHEXPAND: example.v:3:29 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.
|
||||
@@ -1,4 +0,0 @@
|
||||
.. comment: generated by t_lint_width_docs_bad
|
||||
.. code-block::
|
||||
|
||||
%Warning-WIDTH: example.v:3:29 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
****************
|
||||
|
||||
+14
-10
@@ -1,6 +1,7 @@
|
||||
# pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622
|
||||
#
|
||||
# Configuration file for Verilator's Sphinx documentation builder.
|
||||
# Copyright 2003-2023 by Wilson Snyder.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
#
|
||||
# This file only contains overridden options. For a full list:
|
||||
@@ -9,7 +10,6 @@
|
||||
# ----------------------------------------------------------------------
|
||||
# -- Path setup
|
||||
|
||||
from datetime import datetime
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
@@ -23,10 +23,18 @@ def get_vlt_version():
|
||||
filename = "../../Makefile"
|
||||
with open(filename, "r", encoding="utf8") as fh:
|
||||
for line in fh:
|
||||
match = re.search(r"PACKAGE_VERSION_NUMBER *= *([a-z0-9.]+)", line)
|
||||
match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +([-0-9]+)",
|
||||
line)
|
||||
if match:
|
||||
return match.group(1)
|
||||
return "unknown"
|
||||
return match.group(1), match.group(2)
|
||||
match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +devel", line)
|
||||
if match:
|
||||
try:
|
||||
data = os.popen('git log -n 1 --pretty=%cs').read()
|
||||
except Exception: # pylint: disable=broad-except
|
||||
data = "" # fallback, and Sphinx will fill in today's date
|
||||
return "Devel " + match.group(1), data
|
||||
return "unknown", "unknown"
|
||||
|
||||
|
||||
def setup(app):
|
||||
@@ -43,8 +51,8 @@ author = 'Wilson Snyder'
|
||||
# The master toctree document.
|
||||
master_doc = "index"
|
||||
|
||||
version = get_vlt_version()
|
||||
release = get_vlt_version()
|
||||
version, today_fmt = get_vlt_version()
|
||||
release = version
|
||||
|
||||
rst_prolog = """
|
||||
.. role:: vlopt(option)
|
||||
@@ -88,9 +96,6 @@ source_suffix = [".rst"]
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# Date format to ISO
|
||||
today_fmt = datetime.now().strftime("%F")
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
||||
|
||||
@@ -110,7 +115,6 @@ html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
html_theme_options = {
|
||||
'analytics_id': 'G-D27B0C9QEB',
|
||||
'logo_only': True,
|
||||
'style_nav_header_background': "#45acf8", # Default is #2980B9
|
||||
# 'canonical_url':
|
||||
|
||||
+24
-10
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Connecting:
|
||||
@@ -120,6 +120,15 @@ code. This is a feature, as using the SystemC pin interconnect scheme
|
||||
everywhere would reduce performance by an order of magnitude.
|
||||
|
||||
|
||||
Verilated API
|
||||
=============
|
||||
|
||||
The API to a Verilated model is the C++ headers in the include/ directory
|
||||
in the distribution. These headers use Doxygen comments, `///` and `//<`,
|
||||
to indicate and document those functions that are part of the Verilated
|
||||
public API.
|
||||
|
||||
|
||||
Direct Programming Interface (DPI)
|
||||
==================================
|
||||
|
||||
@@ -374,9 +383,11 @@ changed on the specified clock edge.
|
||||
.. code-block:: bash
|
||||
|
||||
cat >our.v <<'EOF'
|
||||
module our (input clk);
|
||||
reg readme /*verilator public_flat_rd*/;
|
||||
reg writeme /*verilator public_flat_rw @(posedge clk) */;
|
||||
module our #(
|
||||
parameter WIDTH /*verilator public_flat_rd*/ = 32
|
||||
) (input clk);
|
||||
reg [WIDTH-1:0] readme /*verilator public_flat_rd*/;
|
||||
reg [WIDTH-1:0] writeme /*verilator public_flat_rw @(posedge clk) */;
|
||||
initial $finish;
|
||||
endmodule
|
||||
EOF
|
||||
@@ -398,12 +409,14 @@ accesses the above signal "readme" would be:
|
||||
vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL);
|
||||
if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found");
|
||||
const char* name = vpi_get_str(vpiName, vh1);
|
||||
printf("Module name: %s\n", name); // Prints "readme"
|
||||
const char* type = vpi_get_str(vpiType, vh1);
|
||||
const int size = vpi_get(vpiSize, vh1);
|
||||
printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32"
|
||||
|
||||
s_vpi_value v;
|
||||
v.format = vpiIntVal;
|
||||
vpi_get_value(vh1, &v);
|
||||
printf("Value of v: %d\n", v.value.integer); // Prints "readme"
|
||||
printf("Value of %s: %d\n", name, v.value.integer); // Prints "Value of readme: 0"
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
@@ -479,11 +492,12 @@ distribution.
|
||||
Verilated and VerilatedContext
|
||||
==============================
|
||||
|
||||
Multiple Verilated models may be part of the same simulation context, that
|
||||
is share a VPI interface, sense of time, and common settings. This common
|
||||
simulation context information is stored in a ``VerilatedContext``
|
||||
Multiple C++ Verilated models may be part of the same simulation context,
|
||||
that is share a VPI interface, sense of time, and common settings. This
|
||||
common simulation context information is stored in a ``VerilatedContext``
|
||||
structure. If a ``VerilatedContext`` is not created prior to creating a
|
||||
model, a default global one is created automatically.
|
||||
model, a default global one is created automatically. SystemC requires
|
||||
using only the single, default VerilatedContext.
|
||||
|
||||
The ``Verilated::`` methods, including the ``Verilated::commandArgs`` call
|
||||
shown above, call VerilatedContext methods using the default global
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
*******************************
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
************************
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
*********
|
||||
@@ -8,7 +8,7 @@ Copyright
|
||||
The latest version of Verilator is available from `https://verilator.org
|
||||
<https://verilator.org>`_.
|
||||
|
||||
Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
can redistribute it and/or modify the Verilator internals under the terms
|
||||
of either the GNU Lesser General Public License Version 3 or the Perl
|
||||
Artistic License Version 2.0.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
Deprecations
|
||||
@@ -17,14 +17,10 @@ C++11 compiler support
|
||||
Verilator will require C++20 or newer compilers for both compiling
|
||||
Verilator and compiling all Verilated models no sooner than January 2025.
|
||||
|
||||
Verilated_heavy.h
|
||||
The legacy "verilated_heavy.h" include was replaced with just including
|
||||
"verilated.h". Verilated_heavy.h is planned for removal no sooner than
|
||||
July 2022.
|
||||
|
||||
Option `--cdc`
|
||||
The experimental `--cdc` option is believed to be generally unused and is
|
||||
planned for removal no sooner than January 2023.
|
||||
32-bit compiler support
|
||||
Verilator currently regresses both 64-bit and 32-bit pointer modes (GCC's
|
||||
`-m64` and `-m32`). Support for 32-bit `-m32` mode will be deprecated no
|
||||
sooner than January 2024.
|
||||
|
||||
Option `-O<letter>`
|
||||
The debug `-O<letter>` options have been replaced with
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
Environment
|
||||
@@ -91,9 +91,29 @@ associated programs.
|
||||
|
||||
.. option:: VERILATOR_ROOT
|
||||
|
||||
Specifies the directory containing the distribution kit. This is used
|
||||
to find the executable, Perl library, and include files. If not
|
||||
specified, it will come from a default optionally specified at configure
|
||||
time (before Verilator was compiled). It should not be specified if
|
||||
using a pre-compiled Verilator package as the hard-coded value should be
|
||||
correct. See :ref:`Installation`.
|
||||
The ``VERILATOR_ROOT`` environment variable is used in several places:
|
||||
|
||||
* At ``./configure`` time: If set, it is embedded into the binary, and
|
||||
at runtime if ``VERILATOR_ROOT`` is not set, the embedded value is
|
||||
used for the runtime default.
|
||||
|
||||
* When ``verilator`` is run: If ``VERILATOR_ROOT`` is set it will be
|
||||
used to find the ``verilator_bin`` executable (this is the actual
|
||||
Verilator binary; ``verilator`` is a Perl wrapper). If not set, the
|
||||
``verilator`` script uses other methods to find ``verilator_bin``
|
||||
(looking in the same directory and falling back to ``$PATH``).
|
||||
|
||||
* When ``make`` is run on the Makefile generated by ``verilator``: The
|
||||
value of ``VERILATOR_ROOT`` (falling back to the value embedded in the
|
||||
binary if not set) is used to find the include files
|
||||
(``include/verilated.mk``).
|
||||
|
||||
If you are using a pre-compiled Verilator package, you should not need
|
||||
to set ``VERILATOR_ROOT`` - the value embedded in the binary should be
|
||||
correct. In fact this option *does not work* with Verilator packages
|
||||
that have been installed with ``make install``. If a Verilator package
|
||||
has been installed using ``./configure --prefix=/some/path && make
|
||||
install`` and then moved to another location, you cannot use
|
||||
``VERILATOR_ROOT`` to point to the new version.
|
||||
|
||||
See :ref:`Installation` for more details.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Example Create-Binary Execution:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Example C++ Execution:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
First you need Verilator installed, see :ref:`Installation`. In brief, if
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Examples in the Distribution:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Example SystemC Execution:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Examples:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Simulation Runtime Arguments:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
verilator Arguments
|
||||
@@ -155,18 +155,6 @@ Summary:
|
||||
Specify C++ without SystemC output mode; see also the :vlopt:`--sc`
|
||||
option.
|
||||
|
||||
.. option:: --cdc
|
||||
|
||||
Permanently experimental. Perform some clock domain crossing checks and
|
||||
issue related warnings (CDCRSTLOGIC) and then exit; if warnings other
|
||||
than CDC warnings are needed, make a second run with
|
||||
:vlopt:`--lint-only`. Additional warning information is also written to
|
||||
the file :file:`<prefix>__cdc.txt`.
|
||||
|
||||
Currently only checks some items that other CDC tools missed; if you are
|
||||
interested in adding more traditional CDC checks, please contact the
|
||||
authors.
|
||||
|
||||
.. option:: -CFLAGS <flags>
|
||||
|
||||
Add specified C compiler argument to the generated makefiles. For
|
||||
@@ -434,7 +422,7 @@ Summary:
|
||||
Preprocess the source code, but do not compile, similar to C++
|
||||
preprocessing using :command:`gcc -E`. Output is written to standard
|
||||
out. Beware of enabling debugging messages, as they will also go to
|
||||
standard out.
|
||||
standard out. See :vlopt:`--no-std`, which is implied by this.
|
||||
|
||||
See also :vlopt:`--dump-defines`, :vlopt:`-P`, and
|
||||
:vlopt:`--pp-comments` options.
|
||||
@@ -707,9 +695,10 @@ Summary:
|
||||
.. option:: -j [<value>]
|
||||
|
||||
Specify the level of parallelism for :vlopt:`--build` if
|
||||
:vlopt:`--build-jobs` isn't provided. If zero, uses the number of threads
|
||||
in the current hardware. Otherwise, the <value> must be a positive
|
||||
integer specifying the maximum number of parallel build jobs.
|
||||
:vlopt:`--build-jobs` isn't provided, and the internal compilation steps
|
||||
of Verilator if :vlopt:`--verilate-jobs` isn't provided. If zero, uses
|
||||
the number of threads in the current hardware. Otherwise, must be a
|
||||
positive integer specifying the maximum number of parallel build jobs.
|
||||
|
||||
.. option:: --l2-name <value>
|
||||
|
||||
@@ -819,6 +808,13 @@ Summary:
|
||||
|
||||
See also :vlopt:`--binary`.
|
||||
|
||||
.. option:: --main-top-name <string>
|
||||
|
||||
Specify the name passed to the Verilated model being constructed, in the
|
||||
generated C++ main() function.
|
||||
|
||||
If the string ``"-"`` is used, no top level scope is added.
|
||||
|
||||
.. option:: --max-num-width <value>
|
||||
|
||||
Set the maximum number literal width (e.g., in 1024'd22 this
|
||||
@@ -1112,6 +1108,18 @@ Summary:
|
||||
marking only those signals that need public_flat_rw is typically
|
||||
significantly better performing.
|
||||
|
||||
.. option:: --public-depth <level>
|
||||
|
||||
Enables public as with :vlopt:`--public-flat-rw`, but only to the specified depth of modules.
|
||||
It operates at the module maximum level, so if a module's cells are A.B.X and A.X, the
|
||||
a --public-depth 3 must be used to make module X public, and both A.B.X and A.X will be public.
|
||||
|
||||
.. option:: --public-params
|
||||
|
||||
Declares all parameters public as if they had
|
||||
:code:`/*verilator public_flat_rd*/`
|
||||
metacomments.
|
||||
|
||||
.. option:: -pvalue+<name>=<value>
|
||||
|
||||
Overwrites the given parameter(s) of the top-level module. See
|
||||
@@ -1201,13 +1209,16 @@ Summary:
|
||||
by size (plain :vlopt:`--stats` just gives a count). See
|
||||
:vlopt:`--stats`, which is implied by this.
|
||||
|
||||
.. option:: --no-std
|
||||
|
||||
Prevents parsing standard library.
|
||||
|
||||
.. option:: --structs-packed
|
||||
|
||||
Converts all unpacked structures to packed structures and issues an
|
||||
:option:`UNPACKED` warning. Currently, this is the default, and
|
||||
:vlopt:`--no-structs-packed <--structs-packed>` will not work.
|
||||
Specifying this option allows forward compatibility when a future
|
||||
version of Verilator no longer always packs unpacked structures.
|
||||
Converts all unpacked structures to packed structures, and issues an
|
||||
:option:`UNPACKED` warning. Specifying this option allows for backward
|
||||
compatibility with versions before Verilator 5.006, when Verilator would
|
||||
always pack unpacked structures.
|
||||
|
||||
.. option:: -sv
|
||||
|
||||
@@ -1430,6 +1441,15 @@ Summary:
|
||||
execute only the build. This can be useful for rebuilding the Verilated code
|
||||
produced by a previous invocation of Verilator.
|
||||
|
||||
.. option:: --verilate-jobs [<value>]
|
||||
|
||||
Specify the level of parallelism for the internal compilation steps of
|
||||
Verilator. If zero, uses the number of threads in the current hardware.
|
||||
Otherwise, must be a positive integer specifying the maximum number of
|
||||
parallel build jobs.
|
||||
|
||||
See also :vlopt:`-j`.
|
||||
|
||||
.. option:: +verilog1995ext+<ext>
|
||||
|
||||
Synonym for :vlopt:`+1364-1995ext+\<ext\>`.
|
||||
@@ -1454,8 +1474,11 @@ Summary:
|
||||
them systematically.
|
||||
|
||||
The generated file is in the Verilator Configuration format, see
|
||||
:ref:`Configuration Files`, and can directly be consumed by
|
||||
Verilator. The standard file extension is ".vlt".
|
||||
:ref:`Configuration Files`. The standard file extension is ".vlt".
|
||||
These files can directly be consumed by Verilator, typically by placing
|
||||
the filename as part of the Verilator command line options. Waiver files
|
||||
need to be listed on the command line before listing the files they are
|
||||
waiving.
|
||||
|
||||
.. option:: -Wall
|
||||
|
||||
@@ -1501,10 +1524,10 @@ Summary:
|
||||
.. option:: -Wno-lint
|
||||
|
||||
Disable all lint-related warning messages, and all style warnings. This is
|
||||
equivalent to ``-Wno-ALWCOMBORDER -Wno-BSSPACE -Wno-CASEINCOMPLETE
|
||||
equivalent to ``-Wno-ALWCOMBORDER -Wno-ASCRANGE -Wno-BSSPACE -Wno-CASEINCOMPLETE
|
||||
-Wno-CASEOVERLAP -Wno-CASEX -Wno-CASTCONST -Wno-CASEWITHX -Wno-CMPCONST -Wno-COLONPLUS
|
||||
-Wno-IMPLICIT -Wno-LITENDIAN -Wno-PINCONNECTEMPTY
|
||||
-Wno-PINMISSING -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNSIGNED
|
||||
-Wno-IMPLICIT -Wno-IMPLICITSTATIC -Wno-PINCONNECTEMPTY
|
||||
-Wno-PINMISSING -Wno-STATICVAR -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNSIGNED
|
||||
-Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL
|
||||
-Wno-WIDTH`` plus the list shown for Wno-style.
|
||||
|
||||
@@ -1516,7 +1539,7 @@ Summary:
|
||||
|
||||
Disable all code style related warning messages (note that by default, they are
|
||||
already disabled). This is equivalent to ``-Wno-DECLFILENAME -Wno-DEFPARAM
|
||||
-Wno-EOFNEWLINE -Wno-IMPORTSTAR -Wno-INCABSPATH -Wno-PINCONNECTEMPTY
|
||||
-Wno-EOFNEWLINE -Wno-GENUNNAMED -Wno-IMPORTSTAR -Wno-INCABSPATH -Wno-PINCONNECTEMPTY
|
||||
-Wno-PINNOCONNECT -Wno-SYNCASYNCNET -Wno-UNDRIVEN
|
||||
-Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL
|
||||
-Wno-VARHIDDEN``.
|
||||
@@ -1529,6 +1552,8 @@ Summary:
|
||||
:command:`gcc -Wpedantic`. Rarely used, and intended only for strict
|
||||
compliance tests.
|
||||
|
||||
This option changes :option:`ASSIGNIN` from an error to a warning.
|
||||
|
||||
.. option:: -Wwarn-<message>
|
||||
|
||||
Enables the specified warning message.
|
||||
@@ -1537,16 +1562,17 @@ Summary:
|
||||
|
||||
Enable all lint-related warning messages (note that by default, they are already
|
||||
enabled), but do not affect style messages. This is equivalent to
|
||||
``-Wwarn-ALWCOMBORDER -Wwarn-BSSPACE -Wwarn-CASEINCOMPLETE
|
||||
-Wwarn-CASEOVERLAP -Wwarn-CASEX -Wwarn-CASTCONST -Wwarn-CASEWITHX -Wwarn-CMPCONST
|
||||
-Wwarn-COLONPLUS -Wwarn-IMPLICIT -Wwarn-LITENDIAN
|
||||
-Wwarn-PINMISSING -Wwarn-REALCVT -Wwarn-UNSIGNED -Wwarn-WIDTH``.
|
||||
``-Wwarn-ALWCOMBORDER -Wwarn-ASCRANGE -Wwarn-BSSPACE -Wwarn-CASEINCOMPLETE
|
||||
-Wwarn-CASEOVERLAP -Wwarn-CASEWITHX -Wwarn-CASEX -Wwarn-CASTCONST -Wwarn-CMPCONST
|
||||
-Wwarn-COLONPLUS -Wwarn-IMPLICIT -Wwarn-IMPLICITSTATIC -Wwarn-LATCH -Wwarn-MISINDENT
|
||||
-Wwarn-NEWERSTD -Wwarn-PINMISSING -Wwarn-REALCVT -Wwarn-STATICVAR -Wwarn-UNSIGNED
|
||||
-Wwarn-WIDTHTRUNC -Wwarn-WIDTHEXPAND -Wwarn-WIDTHXZEXPAND``.
|
||||
|
||||
.. option:: -Wwarn-style
|
||||
|
||||
Enable all code style-related warning messages. This is equivalent to
|
||||
``-Wwarn ASSIGNDLY -Wwarn-DECLFILENAME -Wwarn-DEFPARAM -Wwarn-EOFNEWLINE
|
||||
-Wwarn-INCABSPATH -Wwarn-PINNOCONNECT -Wwarn-SYNCASYNCNET -Wwarn-UNDRIVEN
|
||||
-Wwarn-GENUNNAMED -Wwarn-INCABSPATH -Wwarn-PINNOCONNECT -Wwarn-SYNCASYNCNET -Wwarn-UNDRIVEN
|
||||
-Wwarn-UNUSEDGENVAR -Wwarn-UNUSEDPARAM -Wwarn-UNUSEDSIGNAL -Wwarn-VARHIDDEN``.
|
||||
|
||||
.. option:: --x-assign 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
verilator_coverage
|
||||
@@ -6,10 +6,10 @@ verilator_coverage
|
||||
|
||||
Verilator_coverage processes Verilated model-generated coverage reports.
|
||||
|
||||
With --annotate, it reads the specified coverage data file and generates
|
||||
annotated source code with coverage metrics annotated. If multiple
|
||||
coverage points exist on the same source code line, additional lines will
|
||||
be inserted to report the additional points.
|
||||
With `--annotate`, it reads the specified coverage data file and generates
|
||||
annotated source code with coverage metrics annotated. With
|
||||
`--annotate-points` the coverage points corresponding to each line are also
|
||||
shown.
|
||||
|
||||
Additional Verilog-XL-style standard arguments specify the search paths
|
||||
necessary to find the source code on which the coverage analysis was
|
||||
@@ -58,6 +58,18 @@ to read multiple inputs. If no data file is specified, by default,
|
||||
Specifies the directory name to which source files with annotated coverage
|
||||
data should be written.
|
||||
|
||||
Converting from the Verilator coverage data format to the info format is
|
||||
lossy; the info will have all forms of coverage merged line coverage, and
|
||||
if there are multiple coverage points on a single line they will merge.
|
||||
The minimum coverage across all merged points will be used to report
|
||||
coverage of the line.
|
||||
|
||||
The first character of the line shows a summary of the coverage; this
|
||||
allows use of grep to filter the report. `%` indicates at least one point
|
||||
on the line was below the coverage limit. `+` indicates an
|
||||
:option:`--annotate-points` point was at or above the limit, and `-` that
|
||||
the point was below the limit.
|
||||
|
||||
.. option:: --annotate-all
|
||||
|
||||
Specifies all files should be shown. By default, only those source files
|
||||
@@ -70,6 +82,13 @@ coverage hits, then the coverage point will be considered above the
|
||||
threshold, and the coverage report will put a "%" to indicate the coverage
|
||||
is insufficient. Defaults to 10.
|
||||
|
||||
.. option:: --annotate-points
|
||||
|
||||
Specifies all coverage points should be shown after each line of text. By
|
||||
default, only source lines are shown.
|
||||
|
||||
with low coverage are written to the output directory.
|
||||
|
||||
.. option:: --help
|
||||
|
||||
Displays a help summary, the program version, and exits.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
verilator_gantt
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
verilator_profcfunc
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
*********************************
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
*******************
|
||||
@@ -446,6 +446,33 @@ or "`ifdef`"'s may break other tools.
|
||||
|
||||
Same as :option:`public_flat_rw` configuration file option.
|
||||
|
||||
.. option:: /*verilator&32;public_[|flat|flat_rd|flat_rw]_on [@(<edge_list>)]*/ (as scope)
|
||||
|
||||
Used to wrap multiple signals and parameters with the respective public attribute.
|
||||
See attribute above for their respective behavior. Cannot be nested. e.g:
|
||||
|
||||
.. code-block:: sv
|
||||
|
||||
/*verilator public_flat_rw_on*/
|
||||
logic clk;
|
||||
logic rst;
|
||||
parameter width = 8;
|
||||
/* verilator public_off*/
|
||||
logic data;
|
||||
|
||||
Is equivalent to:
|
||||
|
||||
.. code-block:: sv
|
||||
|
||||
logic clk /*verilator public_flat_rw*/;
|
||||
logic rst /*verilator public_flat_rw*/;
|
||||
parameter width /*verilator public_flat_rw*/ = 8;
|
||||
logic data;
|
||||
|
||||
.. option:: /*verilator&32;public_off*/
|
||||
|
||||
Terminates the previous `/*verilator public*_on*/` directive; see above.
|
||||
|
||||
.. option:: /*verilator&32;public_module*/
|
||||
|
||||
Used after a module statement to indicate the module should not be
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
******************************
|
||||
@@ -356,8 +356,8 @@ Why do I get "undefined reference to \`VL_RAND_RESET_I' or \`Verilated::...'"?
|
||||
You need to link your compiled Verilated code against the
|
||||
:code:`verilated.cpp` file found in the include directory of the Verilator
|
||||
kit. This is one target in the ``$(VK_GLOBAL_OBJS)`` make variable, which
|
||||
should be part of your Makefile's link rule. If you use :vlopt:`--exe`,
|
||||
this is done for you.
|
||||
should be part of your Makefile's link rule. If you use :vlopt:`--exe` or
|
||||
:vlopt:`--binary`, this is done for you.
|
||||
|
||||
|
||||
Is the PLI supported?
|
||||
@@ -486,7 +486,7 @@ From the sc_main.cpp file, you'd then:
|
||||
|
||||
#include "Vour.h"
|
||||
#include "Vour_our.h"
|
||||
cout << "clock is " << top->our->clk << endl;
|
||||
std::cout << "clock is " << top->our->clk << std::endl;
|
||||
|
||||
|
||||
In this example, clk is a bool you can read or set as any other variable.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
*****
|
||||
@@ -126,8 +126,10 @@ In specific debug and other modes, it also creates:
|
||||
- Debugging graph files (from --debug)
|
||||
* - *{prefix}{misc}*\ .tree
|
||||
- Debugging files (from --debug)
|
||||
* - {mod_prefix}_{each_verilog_base_filename}*\ .vpp
|
||||
- Pre-processed verilog (from --debug)
|
||||
* - *{prefix}*\ __inputs\ .vpp
|
||||
- Pre-processed verilog for all files (from --debug)
|
||||
* - *{prefix}*\ _ *{each_verilog_base_filename}*\ .vpp
|
||||
- Pre-processed verilog for each file (from --debug)
|
||||
|
||||
After running Make, the C++ compiler may produce the following:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
######################
|
||||
@@ -12,6 +12,7 @@ Verilator User's Guide
|
||||
overview.rst
|
||||
examples.rst
|
||||
install.rst
|
||||
install-cmake.rst
|
||||
|
||||
|
||||
.. toctree::
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _CMakeInstallation:
|
||||
|
||||
******************
|
||||
CMake Installation
|
||||
******************
|
||||
|
||||
This section discusses how to build and install Verilator using cmake.
|
||||
Currently cmake is only officially supported for Windows builds (not Linux).
|
||||
|
||||
.. _Tools Install:
|
||||
|
||||
Quick Install
|
||||
=============
|
||||
|
||||
1. Install Python for your platform from https://www.python.org/downloads/.
|
||||
2. Install CMake for your platform from https://cmake.org/download/ or build it from source.
|
||||
3. If the compiler of your choice is MSVC, then install https://visualstudio.microsoft.com/downloads/.
|
||||
If the compiler of your choice is Clang, then install https://releases.llvm.org/download.html or build it from source.
|
||||
4. For flex and bison use https://github.com/lexxmark/winflexbison to build and install.
|
||||
5. For build on Windows using MSVC set environment variable WIN_FLEX_BISON to install directory.
|
||||
For build on Windows/Linux/OS-X using ninja set the environment variable
|
||||
FLEX_INCLUDE to the directory containing FlexLexer.h and ensure that flex/bison
|
||||
is available within the PATH.
|
||||
|
||||
To obtain verilator sources download https://github.com/verilator/verilator/archive/refs/heads/master.zip
|
||||
or clone https://github.com/verilator/verilator using git :ref:`Obtain Sources`.
|
||||
|
||||
To build using MSVC:
|
||||
|
||||
::
|
||||
|
||||
cd verilator # directory containing source files of verilator
|
||||
mkdir build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release --install-prefix $PWD/../install
|
||||
cmake --build . --config Release
|
||||
cmake --install . --prefix $PWD/../install
|
||||
|
||||
|
||||
To build using ninja:
|
||||
|
||||
::
|
||||
|
||||
cd verilator
|
||||
mkdir build
|
||||
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release --install-prefix $PWD/../install -DCMAKE_MAKE_PROGRAM=<path to ninja binary> -DBISON_EXECUTABLE=<path to bison> -DFLEX_EXECUTABLE=<path to flex>
|
||||
<path to ninja binary> #execute ninja
|
||||
cmake --install . --prefix $PWD/../install
|
||||
|
||||
|
||||
.. _CMake Usage:
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
To use Verilator set the environment variable ``VERILATOR_ROOT`` to the
|
||||
install directory specified in the above build.
|
||||
|
||||
Example
|
||||
=======
|
||||
|
||||
::
|
||||
|
||||
cd verilator/examples
|
||||
cd cmake_hello_c
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. # cmake -G Ninja ..
|
||||
cmake --build . --config Release # ninja
|
||||
# execute the generated binary
|
||||
+26
-36
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Installation:
|
||||
@@ -39,7 +39,7 @@ In brief, to install from git:
|
||||
::
|
||||
|
||||
# Prerequisites:
|
||||
#sudo apt-get install git perl python3 make autoconf g++ flex bison ccache
|
||||
#sudo apt-get install git help2man perl python3 make autoconf g++ flex bison ccache
|
||||
#sudo apt-get install libgoogle-perftools-dev numactl perl-doc
|
||||
#sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
|
||||
#sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
|
||||
@@ -91,7 +91,7 @@ To build or run Verilator, you need these standard packages:
|
||||
|
||||
::
|
||||
|
||||
sudo apt-get install git perl python3 make
|
||||
sudo apt-get install git help2man perl python3 make
|
||||
sudo apt-get install g++ # Alternatively, clang
|
||||
sudo apt-get install libgz # Non-Ubuntu (ignore if gives error)
|
||||
sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
|
||||
@@ -104,6 +104,7 @@ for good performance:
|
||||
::
|
||||
|
||||
sudo apt-get install ccache # If present at build, needed for run
|
||||
sudo apt-get install mold # If present at build, needed for run
|
||||
sudo apt-get install libgoogle-perftools-dev numactl
|
||||
|
||||
The following is optional but is recommended for nicely rendered command line
|
||||
@@ -124,9 +125,9 @@ Those developing Verilator itself may also want these (see internals.rst):
|
||||
|
||||
::
|
||||
|
||||
sudo apt-get install gdb graphviz cmake clang clang-format-14 gprof lcov
|
||||
sudo apt-get install yapf3
|
||||
sudo pip3 install sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe
|
||||
sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov
|
||||
sudo apt-get install libclang-dev yapf3
|
||||
sudo pip3 install clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
|
||||
cpan install Pod::Perldoc
|
||||
cpan install Parallel::Forker
|
||||
|
||||
@@ -150,6 +151,8 @@ To make use of Verilator FST tracing you will want `GTKwave
|
||||
required at Verilator build time.
|
||||
|
||||
|
||||
.. _Obtain Sources:
|
||||
|
||||
Obtain Sources
|
||||
--------------
|
||||
|
||||
@@ -199,8 +202,9 @@ These are the installation options:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Our personal favorite is to always run Verilator in-place from its Git
|
||||
directory. This allows the easiest experimentation and upgrading, and
|
||||
allows many versions of Verilator to co-exist on a system.
|
||||
directory (don't run ``make install``). This allows the easiest
|
||||
experimentation and upgrading, and allows many versions of Verilator to
|
||||
co-exist on a system.
|
||||
|
||||
::
|
||||
|
||||
@@ -209,17 +213,18 @@ allows many versions of Verilator to co-exist on a system.
|
||||
./configure
|
||||
# Running will use files from $VERILATOR_ROOT, so no install needed
|
||||
|
||||
Note after installing (below steps), a calling program or shell must set
|
||||
the environment variable :option:`VERILATOR_ROOT` to point to this Git
|
||||
directory, then execute ``$VERILATOR_ROOT/bin/verilator``, which will find
|
||||
the path to all needed files.
|
||||
Note after installing (see `Installation`_), a calling program or shell
|
||||
must set the environment variable :option:`VERILATOR_ROOT` to point to this
|
||||
Git directory, then execute ``$VERILATOR_ROOT/bin/verilator``, which will
|
||||
find the path to all needed files.
|
||||
|
||||
|
||||
2. Install into a specific location
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2. Install into a Specific Prefix
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You may eventually be installing onto a project/company-wide "CAD" tools
|
||||
disk that may support multiple versions of every tool. Tell configure the
|
||||
You may be an OS package maintainer building a Verilator package, or you
|
||||
may eventually be installing onto a project/company-wide "CAD" tools disk
|
||||
that may support multiple versions of every tool. Tell configure the
|
||||
eventual destination directory name. We recommend that the destination
|
||||
location include the Verilator version name:
|
||||
|
||||
@@ -230,7 +235,8 @@ location include the Verilator version name:
|
||||
# For the tarball, use the version number instead of git describe
|
||||
./configure --prefix /CAD_DISK/verilator/`git describe | sed "s/verilator_//"`
|
||||
|
||||
Note after installing (below steps), if you use `modulecmd
|
||||
Note after installing (see `Installation`_), you need to add the path to
|
||||
the ``bin`` directory to your ``PATH``. Or, if you use `modulecmd
|
||||
<http://modules.sourceforge.net/>`__, you'll want a module file like the
|
||||
following:
|
||||
|
||||
@@ -243,23 +249,7 @@ following:
|
||||
prepend-path PKG_CONFIG_PATH $install_root/share/pkgconfig
|
||||
|
||||
|
||||
3. Install into a Specific Path
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You may eventually install Verilator into a specific installation prefix,
|
||||
as most GNU tools support:
|
||||
|
||||
::
|
||||
|
||||
unset VERILATOR_ROOT # if your shell is bash
|
||||
unsetenv VERILATOR_ROOT # if your shell is csh
|
||||
./configure --prefix /opt/verilator-VERSION
|
||||
|
||||
Then after installing (below steps), you will need to add
|
||||
``/opt/verilator-VERSION/bin`` to your ``$PATH`` environment variable.
|
||||
|
||||
|
||||
4. Install System Globally
|
||||
3. Install System Globally
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The final option is to eventually install Verilator globally, using
|
||||
@@ -271,8 +261,8 @@ configure's default system paths:
|
||||
unsetenv VERILATOR_ROOT # if your shell is csh
|
||||
./configure
|
||||
|
||||
Then after installing (below), the binaries should be in a location
|
||||
already in your ``$PATH`` environment variable.
|
||||
Then after installing (see `Installation`_), the binaries should be in a
|
||||
location already in your ``$PATH`` environment variable.
|
||||
|
||||
|
||||
Configure
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
***************
|
||||
@@ -130,11 +130,11 @@ simulation (perhaps using :vlopt:`--build`) and run it.
|
||||
With :vlopt:`--no-timing`, all timing controls cause the :option:`NOTIMING`
|
||||
error, except:
|
||||
|
||||
* delay statements – they are ignored (as they are in synthesis), though they
|
||||
* delay statements - they are ignored (as they are in synthesis), though they
|
||||
do issue a :option:`STMTDLY` warning,
|
||||
* intra-assignment timing controls – they are ignored, though they do issue an
|
||||
* intra-assignment timing controls - they are ignored, though they do issue an
|
||||
:option:`ASSIGNDLY` warning,
|
||||
* net delays – they are ignored,
|
||||
* net delays - they are ignored,
|
||||
* event controls at the top of the procedure,
|
||||
|
||||
Forks cause this error as well, except:
|
||||
@@ -461,6 +461,10 @@ chandle
|
||||
Treated as a "longint"; does not yet warn about operations specified as
|
||||
illegal on chandles.
|
||||
|
||||
checker
|
||||
Treated as a "module"; does not yet warn about many constructs illegal
|
||||
inside a checker.
|
||||
|
||||
disable
|
||||
Disable statements may be used only if the block being disabled is a
|
||||
block the disable statement itself is inside. This was commonly used to
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
********
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. _Simulating:
|
||||
@@ -143,7 +143,7 @@ Functional Coverage
|
||||
-------------------
|
||||
|
||||
With :vlopt:`--coverage` or :vlopt:`--coverage-user`, Verilator will
|
||||
translate functional coverage points the user has inserted manually win
|
||||
translate functional coverage points the user has inserted manually in
|
||||
SystemVerilog code through into the Verilated model.
|
||||
|
||||
Currently, all functional coverage points are specified using SystemVerilog
|
||||
@@ -498,3 +498,20 @@ Clang. The process in GCC 10 was as follows:
|
||||
Clang and GCC also support -fauto-profile, which uses sample-based
|
||||
feedback-directed optimization. See the appropriate compiler
|
||||
documentation.
|
||||
|
||||
|
||||
.. _Runtime Debugging:
|
||||
|
||||
Runtime Debugging
|
||||
=================
|
||||
|
||||
To debug a Verilated executable, use the standard GNU debugger ``gdb`` or a
|
||||
similar tool. Typically you will want to have debugger symbols inserted by
|
||||
the compiler, assertions enabled in the C library, and assertions enabled
|
||||
in the Verilated library. (These options slow down the executable, so do
|
||||
this only when debugging.) To enable this, Verilate with:
|
||||
|
||||
-CFLAGS -ggdb -LDFLAGS -ggdb -CFLAGS -DVL_DEBUG=1 -CFLAGS -D_GLIBCXX_DEBUG
|
||||
|
||||
The :vlopt:`-CFLAGS` and/or :vlopt:`-LDFLAGS` options pass arguments
|
||||
directly to the compiler or linker.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
**********
|
||||
@@ -165,7 +165,7 @@ compiled on the different target system.
|
||||
|
||||
To support this, none of the files that Verilator produces will reference
|
||||
any configure-generated build-system-specific files, such as
|
||||
:file:`config.h` (which is renamed in Verilator to :file:`config_build.h`
|
||||
:file:`config.h` (which is renamed in Verilator to :file:`config_package.h`
|
||||
to reduce confusion.) The disadvantage of this approach is that
|
||||
:file:`include/verilatedos.h` must self-detect the requirements of the
|
||||
target system, rather than using configure.
|
||||
|
||||
+292
-21
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2003-2022 by Wilson Snyder.
|
||||
.. Copyright 2003-2023 by Wilson Snyder.
|
||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
*******************
|
||||
@@ -74,7 +74,8 @@ List Of Warnings
|
||||
.. option:: Unsupported: ....
|
||||
|
||||
This error indicates that the code uses a Verilog language construct
|
||||
that is not yet supported in Verilator. See the Limitations chapter.
|
||||
that is not yet supported in Verilator. See also :ref:`Language
|
||||
Limitations`.
|
||||
|
||||
|
||||
.. option:: ALWCOMBORDER
|
||||
@@ -96,6 +97,24 @@ List Of Warnings
|
||||
simulate correctly.
|
||||
|
||||
|
||||
.. option:: ASCRANGE
|
||||
|
||||
.. TODO better example
|
||||
|
||||
Warns that a packed vector is declared with ascending bit range
|
||||
(i.e. [0:7]). Descending bit range is now the overwhelming standard,
|
||||
and ascending ranges are now thus often due to simple oversight
|
||||
instead of intent (a notable exception is the OpenPOWER code base).
|
||||
|
||||
It also warns that an instance is declared with ascending range
|
||||
(i.e. [0:7] or [7]) and is connected to an N-wide signal.
|
||||
The bits will likely be in the reversed order from what people may expect
|
||||
(i.e., instance [0] will connect to signal bit [N-1] not bit [0]).
|
||||
|
||||
Ignoring this warning will only suppress the lint check; it will
|
||||
simulate correctly.
|
||||
|
||||
|
||||
.. option:: ASSIGNDLY
|
||||
|
||||
.. TODO better example
|
||||
@@ -317,9 +336,11 @@ List Of Warnings
|
||||
|
||||
.. option:: CDCRSTLOGIC
|
||||
|
||||
With :vlopt:`--cdc` only, it warns that asynchronous flop reset terms come
|
||||
from other than primary inputs or flopped outputs, creating the
|
||||
potential for reset glitches.
|
||||
Historical, never issued since version 5.008.
|
||||
|
||||
Warned with a no longer supported clock domain crossing option that
|
||||
asynchronous flop reset terms came from other than primary inputs or
|
||||
flopped outputs, creating the potential for reset glitches.
|
||||
|
||||
|
||||
.. option:: CLKDATA
|
||||
@@ -375,6 +396,16 @@ List Of Warnings
|
||||
simulators.
|
||||
|
||||
|
||||
.. option:: CONSTRAINTIGN
|
||||
|
||||
Warns that Verilator does not support :code:`constraint`,
|
||||
:code:`constraint_mode`, or :code:`rand_mode`, and the construct was are
|
||||
ignored.
|
||||
|
||||
Ignoring this warning may make Verilator randomize() simulations differ
|
||||
from other simulators.
|
||||
|
||||
|
||||
.. option:: CONTASSREG
|
||||
|
||||
.. TODO better example
|
||||
@@ -639,6 +670,52 @@ List Of Warnings
|
||||
used as a clock.
|
||||
|
||||
|
||||
.. option:: GENUNNAMED
|
||||
|
||||
Warns that a generate block was unnamed and "genblk" will be used per
|
||||
IEEE.
|
||||
|
||||
The potential issue is that adding additional generate blocks will
|
||||
renumber the assigned names, which may cause eventual problems with
|
||||
synthesis constraints or other tools that depend on hierarchical paths
|
||||
remaining consistent.
|
||||
|
||||
Blocks that are empty may not be reported with this warning, as no
|
||||
scopes are created for empty blocks, so there is no harm in having them
|
||||
unnamed.
|
||||
|
||||
Disabled by default as this is a code-style warning; it will simulate
|
||||
correctly.
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 2
|
||||
|
||||
generate
|
||||
if (PARAM == 1) begin //<--- Warning
|
||||
end
|
||||
|
||||
Results in:
|
||||
|
||||
.. code-block::
|
||||
|
||||
%Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2017 27.6)
|
||||
|
||||
To fix this assign a label (often with the naming convention prefix of
|
||||
:code:`gen_` or :code:`g_`), for example:
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 2
|
||||
|
||||
generate
|
||||
if (PARAM == 1) begin : gen_param_1 //<--- Repaired
|
||||
end
|
||||
|
||||
Other tools with similar warnings: Verible's generate-label, "All
|
||||
generate block statements must have a label."
|
||||
|
||||
|
||||
.. option:: HIERBLOCK
|
||||
|
||||
Warns that the top module is marked as a hierarchy block by the
|
||||
@@ -727,6 +804,30 @@ List Of Warnings
|
||||
implicit definition of wire '...'".
|
||||
|
||||
|
||||
.. option:: IMPLICITSTATIC
|
||||
|
||||
Warns that the lifetime of a task or a function was not provided and so
|
||||
was implicitly set to static. The warning is suppressed when no
|
||||
variables inside the task or a function are assigned to.
|
||||
|
||||
This is a warning because the static default differs from C++, differs
|
||||
from class member function/tasks. Static is a more dangerous default
|
||||
then automatic as static prevents the function from being reentrant,
|
||||
which may be a source of bugs, and/or performance issues.
|
||||
|
||||
If the function is in a module, and does not require static behavior,
|
||||
change it to "function automatic".
|
||||
|
||||
If the function is in a module, and requires static behavior, change it
|
||||
to "function static".
|
||||
|
||||
If the function is in a package, it defaults to static, and label the
|
||||
function's variables as static.
|
||||
|
||||
Ignoring this warning will only suppress the lint check; it will
|
||||
simulate correctly.
|
||||
|
||||
|
||||
.. option:: IMPORTSTAR
|
||||
|
||||
.. TODO better example
|
||||
@@ -821,23 +922,111 @@ List Of Warnings
|
||||
Ignoring this warning will only suppress the lint check; it will
|
||||
simulate correctly.
|
||||
|
||||
.. option:: LIFETIME
|
||||
|
||||
Error when a variable is referenced in a process that can outlive the process
|
||||
in which it was declared. This can happen when using 'fork..join_none' or
|
||||
'fork..join_any' blocks, which spawn process that can outlive their parents.
|
||||
This error occurs only when Verilator can't replace the reference with a
|
||||
reference to copy of this variable, local to the forked process. For example:
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 3
|
||||
|
||||
task foo(int local_var);
|
||||
fork
|
||||
#10 local_var++;
|
||||
#20 $display("local_var = %d", local_var);
|
||||
join_none
|
||||
endtask
|
||||
|
||||
In the example above 'local_var' exists only within scope of 'foo', once foo
|
||||
finishes, the stack frame containing 'i' gets removed. However, the process
|
||||
forked from foo continues, as it contains a delay. After 10 units of time
|
||||
pass, this process attempts to modify 'local_var'. However, this variable no
|
||||
longer exits. It can't be made local to the forked process upon spawning, because
|
||||
it's modified and can be referenced somewhere else, for example in the other
|
||||
forked process, that was delayed by 20 units of time in this example. Thus,
|
||||
there's no viable stack allocation for it.
|
||||
|
||||
In order to fix it, if the intent is not to share the variable's state outside
|
||||
of the process, then create a local copy of the variable.
|
||||
|
||||
For example:
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 4
|
||||
|
||||
task foo(int local_var);
|
||||
fork
|
||||
#10 begin
|
||||
int forked_var = local_var;
|
||||
forked_var++;
|
||||
end
|
||||
#20 begin
|
||||
// Note that we are going to print the original value here,
|
||||
// as `forked_var`is a local copy that was initialized while
|
||||
// `foo` was still alive.
|
||||
int forked_var = local_var;
|
||||
$display("forked_var = %d", forked_var)
|
||||
end
|
||||
join_none
|
||||
endtask
|
||||
|
||||
If you need to share its state, another strategy is to ensure it's allocated
|
||||
statically:
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 1
|
||||
|
||||
int static_var;
|
||||
|
||||
task foo();
|
||||
fork
|
||||
#10 static_var++;
|
||||
#20 $display("static_var = %d", static_var);
|
||||
join_none
|
||||
endtask
|
||||
|
||||
However, if you need to be able to instantiate at runtime, the solution would be to
|
||||
wrap it in an object, since the forked process can hold a reference to that object
|
||||
and ensure that the variable stays alive this way:
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 2
|
||||
|
||||
class Wrapper;
|
||||
int m_var;
|
||||
|
||||
// Here we implicitly hold a reference to `this`
|
||||
task foo();
|
||||
fork
|
||||
#10 m_var++;
|
||||
#20 $display("this.m_var = %d", m_var);
|
||||
join_none
|
||||
endtask
|
||||
endclass
|
||||
|
||||
// Here we explicitly hold a handle to an object
|
||||
task bar(Wrapper wrapper);
|
||||
fork
|
||||
#10 wrapper.m_var++;
|
||||
#20 $display("wrapper.m_var = %d", wrapper.m_var);
|
||||
join_none
|
||||
endtask
|
||||
|
||||
.. option:: LITENDIAN
|
||||
|
||||
.. TODO better example
|
||||
|
||||
Warns that a packed vector is declared with little endian bit numbering
|
||||
(i.e. [0:7]). Big endian bit numbering is now the overwhelming
|
||||
standard, and little numbering is now thus often due to simple oversight
|
||||
instead of intent.
|
||||
|
||||
It also warns that an instance is declared with little endian range
|
||||
(i.e. [0:7] or [7]) and is connected to an N-wide signal. Based on IEEE
|
||||
the bits will likely be backward from what people may expect
|
||||
(i.e., instance [0] will connect to signal bit [N-1] not bit [0]).
|
||||
|
||||
Ignoring this warning will only suppress the lint check; it will
|
||||
simulate correctly.
|
||||
The naming of this warning is in contradiction with the common
|
||||
interpretation of little endian. It was therefore renamed to
|
||||
:option:`ASCRANGE`. While :option:`LITENDIAN` remains for
|
||||
backwards compatibility, new projects should use :option:`ASCRANGE`.
|
||||
|
||||
|
||||
.. option:: MINTYPMAX
|
||||
@@ -850,6 +1039,51 @@ List Of Warnings
|
||||
unsupported. Verilator uses only the typical delay value.
|
||||
|
||||
|
||||
.. option:: MISINDENT
|
||||
|
||||
Warns that the indentation of a statement is misleading, suggesting the
|
||||
statement is part of a previous :code:`if` or :code:`while` block while
|
||||
it is not.
|
||||
|
||||
Verilator suppresses this check when there is an inconsistent mix of
|
||||
spaces and tabs, as it cannot ensure the width of tabs. Verilator also
|
||||
ignores blocks with :code:`begin`/:code:`end`, as the :code:`end`
|
||||
visually indicates the earlier statement's end.
|
||||
|
||||
Ignoring this warning will only suppress the lint check; it will
|
||||
simulate correctly.
|
||||
|
||||
For example
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 3
|
||||
|
||||
if (something)
|
||||
statement_in_if;
|
||||
statement_not_in_if; //<--- Warning
|
||||
|
||||
Results in:
|
||||
|
||||
.. code-block::
|
||||
|
||||
%Warning-MISINDENT: example.v:3:9: Misleading indentation
|
||||
|
||||
To fix this repair the indentation to match the correct earlier
|
||||
statement, for example:
|
||||
|
||||
.. code-block:: sv
|
||||
:linenos:
|
||||
:emphasize-lines: 3
|
||||
|
||||
if (something)
|
||||
statement_in_if;
|
||||
statement_not_in_if; //<--- Repaired
|
||||
|
||||
Other tools with similar warnings: GCC -Wmisleading-indentation,
|
||||
clang-tidy readability-misleading-indentation.
|
||||
|
||||
|
||||
.. option:: MODDUP
|
||||
|
||||
.. TODO better example
|
||||
@@ -928,6 +1162,21 @@ List Of Warnings
|
||||
(neither :vlopt:`--timing` nor :vlopt:`--no-timing` option was provided).
|
||||
|
||||
|
||||
.. option:: NEWERSTD
|
||||
|
||||
Warns that a feature requires a newer standard of Verilog or SystemVerilog
|
||||
than the one specified by the :vlopt:`--language` option. For example, unsized
|
||||
unbased literals (`'0`, `'1`, `'z`, `'x`) require 1800-2005 or later.
|
||||
|
||||
To avoid this warning, use a Verilog or SystemVerilog standard that
|
||||
supports the feature. Alternatively, modify your code to use a different
|
||||
syntax that is supported by the Verilog/SystemVerilog standard specified
|
||||
by the :vlopt:`--language` option.
|
||||
|
||||
Ignoring this warning will only suppress the lint check; it will
|
||||
simulate correctly.
|
||||
|
||||
|
||||
.. option:: NOLATCH
|
||||
|
||||
.. TODO better example
|
||||
@@ -1278,6 +1527,17 @@ List Of Warnings
|
||||
* The variable is tristate or bidirectional. (e.g., :code:`inout`).
|
||||
|
||||
|
||||
.. option:: STATICVAR
|
||||
|
||||
Warns that a static variable declared in a loop with declaration assignment
|
||||
was converted to automatic. Often such variables were intended to
|
||||
instead be declared "automatic".
|
||||
|
||||
Ignoring this warning may make Verilator differ from other simulators,
|
||||
which will treat the variable as static. Verilator may in future versions also
|
||||
treat the variable as static.
|
||||
|
||||
|
||||
.. option:: STMTDLY
|
||||
|
||||
Warns that the code has a statement with a delayed time in front of it.
|
||||
@@ -1769,16 +2029,27 @@ List Of Warnings
|
||||
|
||||
For example, this is a missized index:
|
||||
|
||||
.. include:: ../../docs/gen/ex_WIDTH_1_faulty.rst
|
||||
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_faulty.rst
|
||||
|
||||
Results in:
|
||||
Results in a WIDTHEXPAND warning:
|
||||
|
||||
.. include:: ../../docs/gen/ex_WIDTH_1_msg.rst
|
||||
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_msg.rst
|
||||
|
||||
One possible fix:
|
||||
|
||||
.. include:: ../../docs/gen/ex_WIDTH_1_fixed.rst
|
||||
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst
|
||||
|
||||
.. option:: WIDTHTRUNC
|
||||
|
||||
A more granular WIDTH warning, for when a value is truncated
|
||||
|
||||
.. option:: WIDTHEXPAND
|
||||
|
||||
A more granular WIDTH warning, for when a value is zero expanded
|
||||
|
||||
.. option:: WIDTHXZEXPAND
|
||||
|
||||
A more granular WIDTH warning, for when a value is X/Z expanded
|
||||
|
||||
.. option:: WIDTHCONCAT
|
||||
|
||||
|
||||
+565
-211
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ Alexandre
|
||||
Ami
|
||||
Amir
|
||||
Anastasiadis
|
||||
Anglin
|
||||
Anikin
|
||||
Antmicro
|
||||
Antonin
|
||||
@@ -42,6 +43,8 @@ Chandan
|
||||
Chitlesh
|
||||
Christophe
|
||||
Cochrane
|
||||
Conda
|
||||
Corteggiani
|
||||
Cuan
|
||||
Cygwin
|
||||
DErrico
|
||||
@@ -53,6 +56,7 @@ Das
|
||||
Dcache
|
||||
Deadman
|
||||
Debacker
|
||||
Deepa
|
||||
Defparams
|
||||
Denio
|
||||
Deprecations
|
||||
@@ -96,6 +100,7 @@ Fredieu
|
||||
GTKWave
|
||||
Galbi
|
||||
Gantt
|
||||
Garnal
|
||||
Gartner
|
||||
Gelinek
|
||||
Geoff
|
||||
@@ -188,6 +193,7 @@ Laurens
|
||||
Lavino
|
||||
Leber
|
||||
Leendert
|
||||
Lem
|
||||
Lesik
|
||||
Liland
|
||||
Liu
|
||||
@@ -207,12 +213,14 @@ Matveyenko
|
||||
Maupin
|
||||
Mdir
|
||||
Mednick
|
||||
Menküc
|
||||
Michiels
|
||||
Microsystems
|
||||
Milanovic
|
||||
Millis
|
||||
MinW
|
||||
Mindspeed
|
||||
MingW
|
||||
Miodrag
|
||||
ModelSim
|
||||
Modport
|
||||
@@ -222,8 +230,10 @@ Muhlestein
|
||||
Multithreaded
|
||||
Multithreading
|
||||
NOUNOPTFLAT
|
||||
NaN
|
||||
Nalbantis
|
||||
Narayan
|
||||
Nassim
|
||||
Nauticus
|
||||
Newgard
|
||||
Nigam
|
||||
@@ -237,6 +247,7 @@ Olof
|
||||
Olofsson
|
||||
Oyvind
|
||||
PLI
|
||||
Palaniappan
|
||||
Patricio
|
||||
Petr
|
||||
Piechotka
|
||||
@@ -251,6 +262,7 @@ Prateek
|
||||
Pre
|
||||
Preprocess
|
||||
Pretet
|
||||
Pretl
|
||||
Priyadharshini
|
||||
Pullup
|
||||
Pulver
|
||||
@@ -294,6 +306,7 @@ Solomatnikov
|
||||
Solt
|
||||
Southwell
|
||||
Srini
|
||||
Srinivasan
|
||||
Stamness
|
||||
Stephane
|
||||
Stoddard
|
||||
@@ -318,6 +331,7 @@ Thiede
|
||||
Thierry
|
||||
Thyer
|
||||
Tichelaar
|
||||
Timi
|
||||
Tomov
|
||||
Tood
|
||||
Topa
|
||||
@@ -342,6 +356,7 @@ Vdeeptemp
|
||||
Vdly
|
||||
Vemumtab
|
||||
Vemuri
|
||||
Venkataramanan
|
||||
Veriable
|
||||
Verialted
|
||||
Verilate
|
||||
@@ -352,6 +367,7 @@ Verilator
|
||||
Verilog
|
||||
Vighnesh
|
||||
Viktor
|
||||
Vilp
|
||||
Vm
|
||||
Vukobratovic
|
||||
Wai
|
||||
@@ -362,6 +378,7 @@ Wfuture
|
||||
Whatson
|
||||
Wildman
|
||||
Wim
|
||||
Wmisleading
|
||||
Wno
|
||||
Wojciech
|
||||
Wolfel
|
||||
@@ -375,6 +392,7 @@ Xuan
|
||||
Xuanqi
|
||||
Yazdanbakhsh
|
||||
Yi
|
||||
Yike
|
||||
Yinan
|
||||
Yosys
|
||||
Yu
|
||||
@@ -395,6 +413,7 @@ architected
|
||||
args
|
||||
arrarys
|
||||
assertOn
|
||||
astgen
|
||||
async
|
||||
ato
|
||||
atoi
|
||||
@@ -416,6 +435,7 @@ bitop
|
||||
bitstoreal
|
||||
blackbox
|
||||
bokke
|
||||
bool
|
||||
brancoliticus
|
||||
buf
|
||||
bufif
|
||||
@@ -450,12 +470,14 @@ commandArgsPlusMatch
|
||||
compilable
|
||||
concat
|
||||
concats
|
||||
conf
|
||||
config
|
||||
const
|
||||
constexpr
|
||||
constpool
|
||||
coredump
|
||||
coroutine
|
||||
coroutines
|
||||
countbits
|
||||
countones
|
||||
cout
|
||||
@@ -510,6 +532,7 @@ dumpportson
|
||||
dumpvars
|
||||
dut
|
||||
dx
|
||||
dynarray
|
||||
elab
|
||||
elike
|
||||
elsif
|
||||
@@ -518,6 +541,7 @@ endcelldefine
|
||||
endfunction
|
||||
endgenerate
|
||||
endian
|
||||
endianness
|
||||
endif
|
||||
endmodule
|
||||
endprotect
|
||||
@@ -539,6 +563,7 @@ exe
|
||||
executables
|
||||
expr
|
||||
extern
|
||||
ezchi
|
||||
fanin
|
||||
fasttrace
|
||||
fauto
|
||||
@@ -583,6 +608,7 @@ genvar
|
||||
genvars
|
||||
getenv
|
||||
getline
|
||||
ggdb
|
||||
gmake
|
||||
gmon
|
||||
gotFinish
|
||||
@@ -626,12 +652,14 @@ iostream
|
||||
ish
|
||||
isunbounded
|
||||
isunknown
|
||||
jobserver
|
||||
killua
|
||||
lang
|
||||
lcov
|
||||
ld
|
||||
leavinel
|
||||
len
|
||||
libc
|
||||
libext
|
||||
libgoogle
|
||||
libsystemc
|
||||
@@ -650,7 +678,9 @@ logicals
|
||||
longint
|
||||
lossy
|
||||
lsb
|
||||
lubc
|
||||
lvalue
|
||||
lvalues
|
||||
lxt
|
||||
macromodule
|
||||
makefile
|
||||
@@ -675,12 +705,15 @@ mtasks
|
||||
mulithreaded
|
||||
mult
|
||||
multidim
|
||||
multidriven
|
||||
multiinterfaces
|
||||
multiline
|
||||
multipling
|
||||
multipoint
|
||||
multithread
|
||||
multithreaded
|
||||
multithreading
|
||||
musl
|
||||
mutexes
|
||||
mux
|
||||
myftptoyman
|
||||
@@ -711,6 +744,7 @@ ortegon
|
||||
oversubscription
|
||||
parallelized
|
||||
param
|
||||
parameterization
|
||||
parameterized
|
||||
params
|
||||
parens
|
||||
@@ -731,6 +765,8 @@ portlists
|
||||
posedge
|
||||
posix
|
||||
postfix
|
||||
postincreemnt
|
||||
postincrement
|
||||
pragma
|
||||
pragmas
|
||||
pre
|
||||
@@ -757,10 +793,12 @@ pulldowns
|
||||
pullup
|
||||
pvalue
|
||||
pwd
|
||||
py
|
||||
qrq
|
||||
radix
|
||||
randc
|
||||
randcase
|
||||
randstate
|
||||
rarr
|
||||
rdtsc
|
||||
reStructuredText
|
||||
@@ -802,6 +840,7 @@ specparam
|
||||
splitme
|
||||
spp
|
||||
sqrt
|
||||
srandom
|
||||
src
|
||||
srcdir
|
||||
srcfile
|
||||
@@ -820,6 +859,7 @@ structs
|
||||
subcell
|
||||
subcells
|
||||
subexpressions
|
||||
submakes
|
||||
submodule
|
||||
submodules
|
||||
substring
|
||||
@@ -832,6 +872,7 @@ svdpi
|
||||
swrite
|
||||
sys
|
||||
systemc
|
||||
tenghtt
|
||||
testbench
|
||||
threadsafe
|
||||
threashold
|
||||
@@ -863,10 +904,12 @@ typedefs
|
||||
typename
|
||||
uint
|
||||
un
|
||||
unbased
|
||||
undef
|
||||
undefineall
|
||||
undriven
|
||||
ungetc
|
||||
unhandled
|
||||
uniquified
|
||||
unistd
|
||||
unlink
|
||||
@@ -903,6 +946,7 @@ vlt
|
||||
vltstd
|
||||
vluint
|
||||
vpi
|
||||
vpiDefName
|
||||
vpiLeftRange
|
||||
vpiModule
|
||||
vpiSize
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
PROJECT_NAME = "Verilog to Routing - ABC"
|
||||
PROJECT_NAME = "Verilator"
|
||||
INPUT = ../../include
|
||||
OUTPUT_DIRECTORY = _build/doxygen/verilated
|
||||
|
||||
|
||||
+3
-1
@@ -70,8 +70,10 @@ The XML document consists of 4 sections within the top level
|
||||
Distribution
|
||||
============
|
||||
|
||||
Copyright 2020-2022 by Wilson Snyder. Verilator is free software; you can
|
||||
Copyright 2020-2023 by Wilson Snyder. Verilator is free software; you can
|
||||
redistribute it and/or modify it under the terms of either the GNU Lesser
|
||||
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||
|
||||
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
.. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
# cmake ..
|
||||
# cmake --build .
|
||||
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
project(cmake_hello_c)
|
||||
|
||||
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
# cmake ..
|
||||
# cmake --build .
|
||||
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
project(cmake_hello_sc CXX)
|
||||
|
||||
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
# cmake ..
|
||||
# cmake --build .
|
||||
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
project(cmake_protect_lib)
|
||||
|
||||
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
# cmake ..
|
||||
# cmake --build .
|
||||
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
project(cmake_tracing_c)
|
||||
|
||||
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
# cmake ..
|
||||
# cmake --build .
|
||||
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
|
||||
project(cmake_tracing_sc_example CXX)
|
||||
|
||||
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//======================================================================
|
||||
|
||||
// SystemC global header
|
||||
#include <systemc.h>
|
||||
#include <systemc>
|
||||
|
||||
// Include common routines
|
||||
#include <verilated.h>
|
||||
@@ -15,6 +15,8 @@
|
||||
// Include model header, generated from Verilating "top.v"
|
||||
#include "Vtop.h"
|
||||
|
||||
using namespace sc_core;
|
||||
|
||||
int sc_main(int argc, char* argv[]) {
|
||||
// See a similar example walkthrough in the verilator manpage.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ CPPFLAGS += -DVL_DEBUG=1
|
||||
# Turn on some more compiler lint flags (when configured appropriately)
|
||||
# For testing inside Verilator, "configure --enable-ccwarn" will do this
|
||||
# automatically; otherwise you may want this unconditionally enabled
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
USER_CPPFLAGS_WALL += -W -Werror -Wall
|
||||
endif
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ CPPFLAGS += -Wno-deprecated
|
||||
# Turn on some more flags (when configured appropriately)
|
||||
# For testing inside Verilator, "configure --enable-ccwarn" will do this
|
||||
# automatically; otherwise you may want this unconditionally enabled
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
USER_CPPFLAGS_WALL += -W -Werror -Wall
|
||||
endif
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <memory>
|
||||
|
||||
// SystemC global header
|
||||
#include <systemc.h>
|
||||
#include <systemc>
|
||||
|
||||
// Include common routines
|
||||
#include <verilated.h>
|
||||
@@ -23,6 +23,8 @@
|
||||
// Include model header, generated from Verilating "top.v"
|
||||
#include "Vtop.h"
|
||||
|
||||
using namespace sc_core;
|
||||
|
||||
int sc_main(int argc, char* argv[]) {
|
||||
// This is a more complicated example, please also see the simpler examples/make_hello_c.
|
||||
|
||||
|
||||
+67
-71
@@ -58,6 +58,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
@@ -131,7 +132,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
|
||||
#define FST_GZIO_LEN (32768)
|
||||
#define FST_HDR_FOURPACK_DUO_SIZE (4*1024*1024)
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_AIX)
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_AIX) || defined(__aarch64__)
|
||||
#define FST_DO_MISALIGNED_OPS
|
||||
#endif
|
||||
|
||||
@@ -334,26 +335,22 @@ return(NULL);
|
||||
/*
|
||||
* mmap compatibility
|
||||
*/
|
||||
#if defined __CYGWIN__ || defined __MINGW32__
|
||||
#if defined __MINGW32__
|
||||
#include <limits.h>
|
||||
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
|
||||
#define fstMunmap(__addr,__len) free(__addr)
|
||||
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)
|
||||
|
||||
static void *fstMmap2(size_t __len, int __fd, fst_off_t __off)
|
||||
{
|
||||
(void)__off;
|
||||
HANDLE handle = CreateFileMapping((HANDLE)_get_osfhandle(__fd), NULL,
|
||||
PAGE_READWRITE, (DWORD)(__len >> 32),
|
||||
(DWORD)__len, NULL);
|
||||
if (!handle) { return NULL; }
|
||||
|
||||
unsigned char *pnt = (unsigned char *)malloc(__len);
|
||||
fst_off_t cur_offs = lseek(__fd, 0, SEEK_CUR);
|
||||
size_t i;
|
||||
|
||||
lseek(__fd, 0, SEEK_SET);
|
||||
for(i=0;i<__len;i+=SSIZE_MAX)
|
||||
{
|
||||
read(__fd, pnt + i, ((__len - i) >= SSIZE_MAX) ? SSIZE_MAX : (__len - i));
|
||||
}
|
||||
lseek(__fd, cur_offs, SEEK_SET);
|
||||
return(pnt);
|
||||
void *ptr = MapViewOfFileEx(handle, FILE_MAP_READ | FILE_MAP_WRITE,
|
||||
0, (DWORD)__off, (SIZE_T)__len, (LPVOID)NULL);
|
||||
CloseHandle(handle);
|
||||
return ptr;
|
||||
}
|
||||
#else
|
||||
#include <sys/mman.h>
|
||||
@@ -984,14 +981,26 @@ fflush(xc->handle);
|
||||
*/
|
||||
static void fstWriterMmapSanity(void *pnt, const char *file, int line, const char *usage)
|
||||
{
|
||||
#if !defined(__CYGWIN__) && !defined(__MINGW32__)
|
||||
if(pnt == MAP_FAILED)
|
||||
if(pnt == NULL
|
||||
#ifdef MAP_FAILED
|
||||
|| pnt == MAP_FAILED
|
||||
#endif
|
||||
)
|
||||
{
|
||||
fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line);
|
||||
#if !defined(__MINGW32__)
|
||||
perror("Why");
|
||||
#else
|
||||
LPSTR mbuf = NULL;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
|
||||
| FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPSTR)&mbuf, 0, NULL);
|
||||
fprintf(stderr, "%s", mbuf);
|
||||
LocalFree(mbuf);
|
||||
#endif
|
||||
pnt = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1037,34 +1046,11 @@ if(!xc->curval_mem)
|
||||
|
||||
static void fstDestroyMmaps(struct fstWriterContext *xc, int is_closing)
|
||||
{
|
||||
#if !defined __CYGWIN__ && !defined __MINGW32__
|
||||
(void)is_closing;
|
||||
#endif
|
||||
|
||||
fstMunmap(xc->valpos_mem, xc->maxhandle * 4 * sizeof(uint32_t));
|
||||
xc->valpos_mem = NULL;
|
||||
|
||||
#if defined __CYGWIN__ || defined __MINGW32__
|
||||
if(xc->curval_mem)
|
||||
{
|
||||
if(!is_closing) /* need to flush out for next emulated mmap() read */
|
||||
{
|
||||
unsigned char *pnt = xc->curval_mem;
|
||||
int __fd = fileno(xc->curval_handle);
|
||||
fst_off_t cur_offs = lseek(__fd, 0, SEEK_CUR);
|
||||
size_t i;
|
||||
size_t __len = xc->maxvalpos;
|
||||
|
||||
lseek(__fd, 0, SEEK_SET);
|
||||
for(i=0;i<__len;i+=SSIZE_MAX)
|
||||
{
|
||||
write(__fd, pnt + i, ((__len - i) >= SSIZE_MAX) ? SSIZE_MAX : (__len - i));
|
||||
}
|
||||
lseek(__fd, cur_offs, SEEK_SET);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
fstMunmap(xc->curval_mem, xc->maxvalpos);
|
||||
xc->curval_mem = NULL;
|
||||
}
|
||||
@@ -2066,7 +2052,8 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
|
||||
int zfd;
|
||||
int fourpack_duo = 0;
|
||||
#ifndef __MINGW32__
|
||||
char *fnam = (char *)malloc(strlen(xc->filename) + 5 + 1);
|
||||
int fnam_len = strlen(xc->filename) + 5 + 1;
|
||||
char *fnam = (char *)malloc(fnam_len);
|
||||
#endif
|
||||
|
||||
fixup_offs = ftello(xc->handle);
|
||||
@@ -2156,7 +2143,7 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
|
||||
fflush(xc->handle);
|
||||
|
||||
#ifndef __MINGW32__
|
||||
sprintf(fnam, "%s.hier", xc->filename);
|
||||
snprintf(fnam, fnam_len, "%s.hier", xc->filename);
|
||||
unlink(fnam);
|
||||
free(fnam);
|
||||
#endif
|
||||
@@ -2835,7 +2822,7 @@ if(ctx && name && literal_arr && val_arr && (elem_count != 0))
|
||||
uint32_t i;
|
||||
|
||||
name_len = strlen(name);
|
||||
elem_count_len = sprintf(elem_count_buf, "%" PRIu32, elem_count);
|
||||
elem_count_len = snprintf(elem_count_buf, 16, "%" PRIu32, elem_count);
|
||||
|
||||
literal_lens = (unsigned int *)calloc(elem_count, sizeof(unsigned int));
|
||||
val_lens = (unsigned int *)calloc(elem_count, sizeof(unsigned int));
|
||||
@@ -3412,6 +3399,7 @@ int flat_hier_alloc_len;
|
||||
unsigned do_rewind : 1;
|
||||
char str_scope_nam[FST_ID_NAM_SIZ+1];
|
||||
char str_scope_comp[FST_ID_NAM_SIZ+1];
|
||||
char *str_scope_attr;
|
||||
|
||||
unsigned fseek_failed : 1;
|
||||
|
||||
@@ -3922,7 +3910,8 @@ int pass_status = 1;
|
||||
if(!xc->fh)
|
||||
{
|
||||
fst_off_t offs_cache = ftello(xc->f);
|
||||
char *fnam = (char *)malloc(strlen(xc->filename) + 6 + 16 + 32 + 1);
|
||||
int fnam_len = strlen(xc->filename) + 6 + 16 + 32 + 1;
|
||||
char *fnam = (char *)malloc(fnam_len);
|
||||
unsigned char *mem = (unsigned char *)malloc(FST_GZIO_LEN);
|
||||
fst_off_t hl, uclen;
|
||||
fst_off_t clen = 0;
|
||||
@@ -3941,7 +3930,7 @@ if(!xc->fh)
|
||||
htyp = xc->contains_hier_section_lz4duo ? FST_BL_HIER_LZ4DUO : FST_BL_HIER_LZ4;
|
||||
}
|
||||
|
||||
sprintf(fnam, "%s.hier_%d_%p", xc->filename, getpid(), (void *)xc);
|
||||
snprintf(fnam, fnam_len, "%s.hier_%d_%p", xc->filename, getpid(), (void *)xc);
|
||||
fstReaderFseeko(xc, xc->f, xc->hier_pos, SEEK_SET);
|
||||
uclen = fstReaderUint64(xc->f);
|
||||
#ifndef __MINGW32__
|
||||
@@ -4140,7 +4129,7 @@ if(!(isfeof=feof(xc->fh)))
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_SIZ)
|
||||
if(cl < FST_ID_NAM_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
@@ -4152,7 +4141,7 @@ if(!(isfeof=feof(xc->fh)))
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_SIZ)
|
||||
if(cl < FST_ID_NAM_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
@@ -4169,15 +4158,19 @@ if(!(isfeof=feof(xc->fh)))
|
||||
xc->hier.htyp = FST_HT_ATTRBEGIN;
|
||||
xc->hier.u.attr.typ = fgetc(xc->fh);
|
||||
xc->hier.u.attr.subtype = fgetc(xc->fh);
|
||||
xc->hier.u.attr.name = pnt = xc->str_scope_nam;
|
||||
if(!xc->str_scope_attr)
|
||||
{
|
||||
xc->str_scope_attr = (char *)calloc(1, FST_ID_NAM_ATTR_SIZ+1);
|
||||
}
|
||||
xc->hier.u.attr.name = pnt = xc->str_scope_attr;
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_SIZ)
|
||||
if(cl < FST_ID_NAM_ATTR_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
}; /* scopename */
|
||||
}; /* attrname */
|
||||
pnt[cl] = 0;
|
||||
xc->hier.u.attr.name_length = cl;
|
||||
|
||||
@@ -4237,7 +4230,7 @@ if(!(isfeof=feof(xc->fh)))
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_SIZ)
|
||||
if(cl < FST_ID_NAM_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
@@ -4376,7 +4369,7 @@ while(!feof(xc->fh))
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_ATTR_SIZ)
|
||||
if(cl < FST_ID_NAM_ATTR_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
@@ -4398,7 +4391,7 @@ while(!feof(xc->fh))
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_ATTR_SIZ)
|
||||
if(cl < FST_ID_NAM_ATTR_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
@@ -4487,7 +4480,7 @@ while(!feof(xc->fh))
|
||||
cl = 0;
|
||||
while((ch = fgetc(xc->fh)))
|
||||
{
|
||||
if(cl <= FST_ID_NAM_ATTR_SIZ)
|
||||
if(cl < FST_ID_NAM_ATTR_SIZ)
|
||||
{
|
||||
pnt[cl++] = ch;
|
||||
}
|
||||
@@ -4594,15 +4587,17 @@ if(sectype == FST_BL_ZWRAPPER)
|
||||
int zfd;
|
||||
int flen = strlen(xc->filename);
|
||||
char *hf;
|
||||
int hf_len;
|
||||
|
||||
seclen = fstReaderUint64(xc->f);
|
||||
uclen = fstReaderUint64(xc->f);
|
||||
|
||||
if(!seclen) return(0); /* not finished compressing, this is a failed read */
|
||||
|
||||
hf = (char *)calloc(1, flen + 16 + 32 + 1);
|
||||
hf_len = flen + 16 + 32 + 1;
|
||||
hf = (char *)calloc(1, hf_len);
|
||||
|
||||
sprintf(hf, "%s.upk_%d_%p", xc->filename, getpid(), (void *)xc);
|
||||
snprintf(hf, hf_len, "%s.upk_%d_%p", xc->filename, getpid(), (void *)xc);
|
||||
fcomp = fopen(hf, "w+b");
|
||||
if(!fcomp)
|
||||
{
|
||||
@@ -4974,6 +4969,7 @@ if(xc)
|
||||
free(xc->signal_typs); xc->signal_typs = NULL;
|
||||
free(xc->signal_lens); xc->signal_lens = NULL;
|
||||
free(xc->filename); xc->filename = NULL;
|
||||
free(xc->str_scope_attr); xc->str_scope_attr = NULL;
|
||||
|
||||
if(xc->fh)
|
||||
{
|
||||
@@ -5197,16 +5193,16 @@ for(;;)
|
||||
|
||||
if(beg_tim)
|
||||
{
|
||||
if(dumpvars_state == 1) { wx_len = sprintf(wx_buf, "$end\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 2; }
|
||||
wx_len = sprintf(wx_buf, "#%" PRIu64 "\n", beg_tim);
|
||||
if(dumpvars_state == 1) { wx_len = snprintf(wx_buf, 32, "$end\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 2; }
|
||||
wx_len = snprintf(wx_buf, 32, "#%" PRIu64 "\n", beg_tim);
|
||||
fstWritex(xc, wx_buf, wx_len);
|
||||
if(!dumpvars_state) { wx_len = sprintf(wx_buf, "$dumpvars\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 1; }
|
||||
if(!dumpvars_state) { wx_len = snprintf(wx_buf, 32, "$dumpvars\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 1; }
|
||||
}
|
||||
if((xc->num_blackouts)&&(cur_blackout != xc->num_blackouts))
|
||||
{
|
||||
if(beg_tim == xc->blackout_times[cur_blackout])
|
||||
{
|
||||
wx_len = sprintf(wx_buf, "$dump%s $end\n", (xc->blackout_activity[cur_blackout++]) ? "on" : "off");
|
||||
wx_len = snprintf(wx_buf, 32, "$dump%s $end\n", (xc->blackout_activity[cur_blackout++]) ? "on" : "off");
|
||||
fstWritex(xc, wx_buf, wx_len);
|
||||
}
|
||||
}
|
||||
@@ -5340,7 +5336,7 @@ for(;;)
|
||||
clone_d[j] = srcdata[7-j];
|
||||
}
|
||||
}
|
||||
sprintf((char *)xc->temp_signal_value_buf, "%.16g", d);
|
||||
snprintf((char *)xc->temp_signal_value_buf, xc->longest_signal_value_len + 1, "%.16g", d);
|
||||
value_change_callback(user_callback_data_pointer, beg_tim, idx+1, xc->temp_signal_value_buf);
|
||||
}
|
||||
}
|
||||
@@ -5368,7 +5364,7 @@ for(;;)
|
||||
}
|
||||
|
||||
fstVcdID(vcdid_buf, idx+1);
|
||||
wx_len = sprintf(wx_buf, "r%.16g %s\n", d, vcdid_buf);
|
||||
wx_len = snprintf(wx_buf, 64, "r%.16g %s\n", d, vcdid_buf);
|
||||
fstWritex(xc, wx_buf, wx_len);
|
||||
}
|
||||
}
|
||||
@@ -5633,16 +5629,16 @@ for(;;)
|
||||
}
|
||||
}
|
||||
|
||||
if(dumpvars_state == 1) { wx_len = sprintf(wx_buf, "$end\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 2; }
|
||||
wx_len = sprintf(wx_buf, "#%" PRIu64 "\n", time_table[i]);
|
||||
if(dumpvars_state == 1) { wx_len = snprintf(wx_buf, 32, "$end\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 2; }
|
||||
wx_len = snprintf(wx_buf, 32, "#%" PRIu64 "\n", time_table[i]);
|
||||
fstWritex(xc, wx_buf, wx_len);
|
||||
if(!dumpvars_state) { wx_len = sprintf(wx_buf, "$dumpvars\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 1; }
|
||||
if(!dumpvars_state) { wx_len = snprintf(wx_buf, 32, "$dumpvars\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 1; }
|
||||
|
||||
if((xc->num_blackouts)&&(cur_blackout != xc->num_blackouts))
|
||||
{
|
||||
if(time_table[i] == xc->blackout_times[cur_blackout])
|
||||
{
|
||||
wx_len = sprintf(wx_buf, "$dump%s $end\n", (xc->blackout_activity[cur_blackout++]) ? "on" : "off");
|
||||
wx_len = snprintf(wx_buf, 32, "$dump%s $end\n", (xc->blackout_activity[cur_blackout++]) ? "on" : "off");
|
||||
fstWritex(xc, wx_buf, wx_len);
|
||||
}
|
||||
}
|
||||
@@ -5892,7 +5888,7 @@ for(;;)
|
||||
clone_d[j] = srcdata[7-j];
|
||||
}
|
||||
}
|
||||
sprintf((char *)xc->temp_signal_value_buf, "%.16g", d);
|
||||
snprintf((char *)xc->temp_signal_value_buf, xc->longest_signal_value_len + 1, "%.16g", d);
|
||||
value_change_callback(user_callback_data_pointer, time_table[i], idx+1, xc->temp_signal_value_buf);
|
||||
}
|
||||
}
|
||||
@@ -5918,7 +5914,7 @@ for(;;)
|
||||
}
|
||||
}
|
||||
|
||||
wx_len = sprintf(wx_buf, "r%.16g", d);
|
||||
wx_len = snprintf(wx_buf, 32, "r%.16g", d);
|
||||
fstWritex(xc, wx_buf, wx_len);
|
||||
}
|
||||
}
|
||||
@@ -6024,7 +6020,7 @@ if(xc->signal_lens[facidx] == 1)
|
||||
}
|
||||
}
|
||||
|
||||
sprintf((char *)buf, "%.16g", d);
|
||||
snprintf((char *)buf, 32, "%.16g", d); /* this will write 18 bytes */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6616,7 +6612,7 @@ if(xc->signal_lens[facidx] == 1)
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buf, "r%.16g", d);
|
||||
snprintf(buf, 32, "r%.16g", d); /* this will write 19 bytes */
|
||||
return(buf);
|
||||
}
|
||||
}
|
||||
|
||||
+197
-86
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -67,7 +67,7 @@
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
# include <direct.h> // mkdir
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
# include <execinfo.h>
|
||||
# define _VL_HAVE_STACKTRACE
|
||||
#endif
|
||||
@@ -232,9 +232,9 @@ std::string _vl_string_vprintf(const char* formatp, va_list ap) VL_MT_SAFE {
|
||||
char* const bufp = new char[len + 1];
|
||||
VL_VSNPRINTF(bufp, len + 1, formatp, ap);
|
||||
|
||||
std::string out{bufp, len}; // Not const to allow move optimization
|
||||
std::string result{bufp, len}; // Not const to allow move optimization
|
||||
delete[] bufp;
|
||||
return out;
|
||||
return result;
|
||||
}
|
||||
|
||||
uint64_t _vl_dbg_sequence_number() VL_MT_SAFE {
|
||||
@@ -255,30 +255,89 @@ void VL_DBG_MSGF(const char* formatp, ...) VL_MT_SAFE {
|
||||
// includes that otherwise would be required in every Verilated module
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
const std::string out = _vl_string_vprintf(formatp, ap);
|
||||
const std::string result = _vl_string_vprintf(formatp, ap);
|
||||
va_end(ap);
|
||||
// printf("-imm-V{t%d,%" PRId64 "}%s", VL_THREAD_ID(), _vl_dbg_sequence_number(),
|
||||
// out.c_str());
|
||||
// result.c_str());
|
||||
|
||||
// Using VL_PRINTF not VL_PRINTF_MT so that we can call VL_DBG_MSGF
|
||||
// from within the guts of the thread execution machinery (and it goes
|
||||
// to the screen and not into the queues we're debugging)
|
||||
VL_PRINTF("-V{t%u,%" PRIu64 "}%s", VL_THREAD_ID(), _vl_dbg_sequence_number(), out.c_str());
|
||||
VL_PRINTF("-V{t%u,%" PRIu64 "}%s", VL_THREAD_ID(), _vl_dbg_sequence_number(), result.c_str());
|
||||
}
|
||||
|
||||
void VL_PRINTF_MT(const char* formatp, ...) VL_MT_SAFE {
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
const std::string out = _vl_string_vprintf(formatp, ap);
|
||||
const std::string result = _vl_string_vprintf(formatp, ap);
|
||||
va_end(ap);
|
||||
VerilatedThreadMsgQueue::post(VerilatedMsg{[=]() { //
|
||||
VL_PRINTF("%s", out.c_str());
|
||||
VL_PRINTF("%s", result.c_str());
|
||||
}});
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Random -- Mostly called at init time, so not inline.
|
||||
|
||||
VlRNG::VlRNG() VL_MT_SAFE {
|
||||
// Starting point for this new class comes from the global RNG
|
||||
VlRNG& fromr = vl_thread_rng();
|
||||
m_state = fromr.m_state;
|
||||
// Advance the *source* so it can later generate a new number
|
||||
// Xoroshiro128+ algorithm
|
||||
fromr.m_state[1] ^= fromr.m_state[0];
|
||||
fromr.m_state[0] = (((fromr.m_state[0] << 55) | (fromr.m_state[0] >> 9)) ^ fromr.m_state[1]
|
||||
^ (fromr.m_state[1] << 14));
|
||||
fromr.m_state[1] = (fromr.m_state[1] << 36) | (fromr.m_state[1] >> 28);
|
||||
}
|
||||
uint64_t VlRNG::rand64() VL_MT_UNSAFE {
|
||||
// Xoroshiro128+ algorithm
|
||||
const uint64_t result = m_state[0] + m_state[1];
|
||||
m_state[1] ^= m_state[0];
|
||||
m_state[0] = (((m_state[0] << 55) | (m_state[0] >> 9)) ^ m_state[1] ^ (m_state[1] << 14));
|
||||
m_state[1] = (m_state[1] << 36) | (m_state[1] >> 28);
|
||||
return result;
|
||||
}
|
||||
uint64_t VlRNG::vl_thread_rng_rand64() VL_MT_SAFE {
|
||||
VlRNG& fromr = vl_thread_rng();
|
||||
const uint64_t result = fromr.m_state[0] + fromr.m_state[1];
|
||||
fromr.m_state[1] ^= fromr.m_state[0];
|
||||
fromr.m_state[0] = (((fromr.m_state[0] << 55) | (fromr.m_state[0] >> 9)) ^ fromr.m_state[1]
|
||||
^ (fromr.m_state[1] << 14));
|
||||
fromr.m_state[1] = (fromr.m_state[1] << 36) | (fromr.m_state[1] >> 28);
|
||||
return result;
|
||||
}
|
||||
void VlRNG::srandom(uint64_t n) VL_MT_UNSAFE {
|
||||
m_state[0] = n;
|
||||
m_state[1] = m_state[0];
|
||||
// Fix state as algorithm is slow to randomize if many zeros
|
||||
// This causes a loss of ~ 1 bit of seed entropy, no big deal
|
||||
if (VL_COUNTONES_I(m_state[0]) < 10) m_state[0] = ~m_state[0];
|
||||
if (VL_COUNTONES_I(m_state[1]) < 10) m_state[1] = ~m_state[1];
|
||||
}
|
||||
std::string VlRNG::get_randstate() const VL_MT_UNSAFE {
|
||||
// Though not stated in IEEE, assumption is the string must be printable
|
||||
const char* const stateCharsp = reinterpret_cast<const char*>(&m_state);
|
||||
static_assert(sizeof(m_state) == 16, "");
|
||||
std::string result{"R00112233445566770011223344556677"};
|
||||
for (int i = 0; i < sizeof(m_state); ++i) {
|
||||
result[1 + i * 2] = 'a' + ((stateCharsp[i] >> 4) & 15);
|
||||
result[1 + i * 2 + 1] = 'a' + (stateCharsp[i] & 15);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
void VlRNG::set_randstate(const std::string& state) VL_MT_UNSAFE {
|
||||
if (VL_UNLIKELY((state.length() != 1 + 2 * sizeof(m_state)) || (state[0] != 'R'))) {
|
||||
VL_PRINTF_MT("%%Warning: set_randstate ignored as state string not from get_randstate\n");
|
||||
return;
|
||||
}
|
||||
char* const stateCharsp = reinterpret_cast<char*>(&m_state);
|
||||
for (int i = 0; i < sizeof(m_state); ++i) {
|
||||
stateCharsp[i]
|
||||
= (((state[1 + i * 2] - 'a') & 15) << 4) | ((state[1 + i * 2 + 1] - 'a') & 15);
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t vl_sys_rand32() VL_MT_SAFE {
|
||||
// Return random 32-bits using system library.
|
||||
// Used only to construct seed for Verilator's PRNG.
|
||||
@@ -292,27 +351,23 @@ static uint32_t vl_sys_rand32() VL_MT_SAFE {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t vl_rand64() VL_MT_SAFE {
|
||||
static thread_local uint64_t t_state[2];
|
||||
VlRNG& VlRNG::vl_thread_rng() VL_MT_SAFE {
|
||||
static thread_local VlRNG t_rng{0};
|
||||
static thread_local uint32_t t_seedEpoch = 0;
|
||||
// For speed, we use a thread-local epoch number to know when to reseed
|
||||
// A thread always belongs to a single context, so this works out ok
|
||||
if (VL_UNLIKELY(t_seedEpoch != VerilatedContextImp::randSeedEpoch())) {
|
||||
// Set epoch before state, to avoid race case with new seeding
|
||||
t_seedEpoch = VerilatedContextImp::randSeedEpoch();
|
||||
t_state[0] = Verilated::threadContextp()->impp()->randSeedDefault64();
|
||||
t_state[1] = t_state[0];
|
||||
// Same as srandom() but here as needs to be VL_MT_SAFE
|
||||
t_rng.m_state[0] = Verilated::threadContextp()->impp()->randSeedDefault64();
|
||||
t_rng.m_state[1] = t_rng.m_state[0];
|
||||
// Fix state as algorithm is slow to randomize if many zeros
|
||||
// This causes a loss of ~ 1 bit of seed entropy, no big deal
|
||||
if (VL_COUNTONES_I(t_state[0]) < 10) t_state[0] = ~t_state[0];
|
||||
if (VL_COUNTONES_I(t_state[1]) < 10) t_state[1] = ~t_state[1];
|
||||
if (VL_COUNTONES_I(t_rng.m_state[0]) < 10) t_rng.m_state[0] = ~t_rng.m_state[0];
|
||||
if (VL_COUNTONES_I(t_rng.m_state[1]) < 10) t_rng.m_state[1] = ~t_rng.m_state[1];
|
||||
}
|
||||
// Xoroshiro128+ algorithm
|
||||
const uint64_t result = t_state[0] + t_state[1];
|
||||
t_state[1] ^= t_state[0];
|
||||
t_state[0] = (((t_state[0] << 55) | (t_state[0] >> 9)) ^ t_state[1] ^ (t_state[1] << 14));
|
||||
t_state[1] = (t_state[1] << 36) | (t_state[1] >> 28);
|
||||
return result;
|
||||
return t_rng;
|
||||
}
|
||||
|
||||
WDataOutP VL_RANDOM_W(int obits, WDataOutP outwp) VL_MT_SAFE {
|
||||
@@ -321,6 +376,12 @@ WDataOutP VL_RANDOM_W(int obits, WDataOutP outwp) VL_MT_SAFE {
|
||||
return outwp;
|
||||
}
|
||||
|
||||
WDataOutP VL_RANDOM_RNG_W(VlRNG& rngr, int obits, WDataOutP outwp) VL_MT_UNSAFE {
|
||||
for (int i = 0; i < VL_WORDS_I(obits); ++i) outwp[i] = rngr.rand64();
|
||||
// Last word is unclean
|
||||
return outwp;
|
||||
}
|
||||
|
||||
IData VL_RANDOM_SEEDED_II(IData& seedr) VL_MT_SAFE {
|
||||
// $random - seed is a new seed to apply, then we return new seed
|
||||
Verilated::threadContextp()->randSeed(static_cast<int>(seedr));
|
||||
@@ -355,10 +416,9 @@ WDataOutP VL_RAND_RESET_W(int obits, WDataOutP outwp) VL_MT_SAFE {
|
||||
outwp[VL_WORDS_I(obits) - 1] = VL_RAND_RESET_I(32) & VL_MASK_E(obits);
|
||||
return outwp;
|
||||
}
|
||||
|
||||
WDataOutP VL_ZERO_RESET_W(int obits, WDataOutP outwp) VL_MT_SAFE {
|
||||
for (int i = 0; i < VL_WORDS_I(obits); ++i) outwp[i] = 0;
|
||||
return outwp;
|
||||
// Not inlined to speed up compilation of slowpath code
|
||||
return VL_ZERO_W(obits, outwp);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -519,12 +579,12 @@ QData VL_POW_QQW(int, int, int rbits, QData lhs, const WDataInP rwp) VL_MT_SAFE
|
||||
// Skip check for rhs == 0, as short-circuit doesn't save time
|
||||
if (VL_UNLIKELY(lhs == 0)) return 0;
|
||||
QData power = lhs;
|
||||
QData out = 1ULL;
|
||||
QData result = 1ULL;
|
||||
for (int bit = 0; bit < rbits; ++bit) {
|
||||
if (bit > 0) power = power * power;
|
||||
if (VL_BITISSET_W(rwp, bit)) out *= power;
|
||||
if (VL_BITISSET_W(rwp, bit)) result *= power;
|
||||
}
|
||||
return out;
|
||||
return result;
|
||||
}
|
||||
|
||||
WDataOutP VL_POWSS_WWW(int obits, int, int rbits, WDataOutP owp, const WDataInP lwp,
|
||||
@@ -611,7 +671,7 @@ std::string VL_DECIMAL_NW(int width, const WDataInP lwp) VL_MT_SAFE {
|
||||
const int maxdecwidth = (width + 3) * 4 / 3;
|
||||
// Or (maxdecwidth+7)/8], but can't have more than 4 BCD bits per word
|
||||
VlWide<VL_VALUE_STRING_MAX_WIDTH / 4 + 2> bcd;
|
||||
VL_ZERO_RESET_W(maxdecwidth, bcd);
|
||||
VL_ZERO_W(maxdecwidth, bcd);
|
||||
VlWide<VL_VALUE_STRING_MAX_WIDTH / 4 + 2> tmp;
|
||||
VlWide<VL_VALUE_STRING_MAX_WIDTH / 4 + 2> tmp2;
|
||||
int from_bit = width - 1;
|
||||
@@ -622,7 +682,7 @@ std::string VL_DECIMAL_NW(int width, const WDataInP lwp) VL_MT_SAFE {
|
||||
// Any digits >= 5 need an add 3 (via tmp)
|
||||
for (int nibble_bit = 0; nibble_bit < maxdecwidth; nibble_bit += 4) {
|
||||
if ((VL_BITRSHIFT_W(bcd, nibble_bit) & 0xf) >= 5) {
|
||||
VL_ZERO_RESET_W(maxdecwidth, tmp2);
|
||||
VL_ZERO_W(maxdecwidth, tmp2);
|
||||
tmp2[VL_BITWORD_E(nibble_bit)] |= VL_EUL(0x3) << VL_BITBIT_E(nibble_bit);
|
||||
VL_ASSIGN_W(maxdecwidth, tmp, bcd);
|
||||
VL_ADD_W(VL_WORDS_I(maxdecwidth), bcd, tmp, tmp2);
|
||||
@@ -646,7 +706,7 @@ std::string VL_DECIMAL_NW(int width, const WDataInP lwp) VL_MT_SAFE {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string _vl_vsformat_time(char* tmp, T ld, int timeunit, bool left, size_t width) {
|
||||
std::string _vl_vsformat_time(char* tmp, T ld, int timeunit, bool left, size_t width) VL_MT_SAFE {
|
||||
const VerilatedContextImp* const ctxImpp = Verilated::threadContextp()->impp();
|
||||
const std::string suffix = ctxImpp->timeFormatSuffix();
|
||||
const int userUnits = ctxImpp->timeFormatUnits(); // 0..-15
|
||||
@@ -1083,7 +1143,8 @@ static void _vl_vsss_read_str(FILE* fp, int& floc, const WDataInP fromp, const s
|
||||
// VL_DBG_MSGF(" _read got='"<<tmpp<<"'\n");
|
||||
}
|
||||
static char* _vl_vsss_read_bin(FILE* fp, int& floc, const WDataInP fromp, const std::string& fstr,
|
||||
char* beginp, std::size_t n, const bool inhibit = false) {
|
||||
char* beginp, std::size_t n,
|
||||
const bool inhibit = false) VL_MT_SAFE {
|
||||
// Variant of _vl_vsss_read_str using the same underlying I/O functions but optimized
|
||||
// specifically for block reads of N bytes (read operations are not demarcated by
|
||||
// whitespace). In the fp case, except descriptor to have been opened in binary mode.
|
||||
@@ -1095,12 +1156,13 @@ static char* _vl_vsss_read_bin(FILE* fp, int& floc, const WDataInP fromp, const
|
||||
}
|
||||
return beginp;
|
||||
}
|
||||
static void _vl_vsss_setbit(WDataOutP owp, int obits, int lsb, int nbits, IData ld) VL_MT_SAFE {
|
||||
for (; nbits && lsb < obits; nbits--, lsb++, ld >>= 1) { VL_ASSIGNBIT_WI(lsb, owp, ld & 1); }
|
||||
static void _vl_vsss_setbit(WDataOutP iowp, int obits, int lsb, int nbits, IData ld) VL_MT_SAFE {
|
||||
for (; nbits && lsb < obits; nbits--, lsb++, ld >>= 1) VL_ASSIGNBIT_WI(lsb, iowp, ld & 1);
|
||||
}
|
||||
static void _vl_vsss_based(WDataOutP owp, int obits, int baseLog2, const char* strp,
|
||||
size_t posstart, size_t posend) VL_MT_SAFE {
|
||||
// Read in base "2^^baseLog2" digits from strp[posstart..posend-1] into owp of size obits.
|
||||
VL_ZERO_W(obits, owp);
|
||||
int lsb = 0;
|
||||
for (int i = 0, pos = static_cast<int>(posend) - 1;
|
||||
i < obits && pos >= static_cast<int>(posstart); --pos) {
|
||||
@@ -1311,16 +1373,18 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
|
||||
*p = t_tmp;
|
||||
} else if (obits <= VL_BYTESIZE) {
|
||||
CData* const p = va_arg(ap, CData*);
|
||||
*p = owp[0];
|
||||
*p = VL_CLEAN_II(obits, obits, owp[0]);
|
||||
} else if (obits <= VL_SHORTSIZE) {
|
||||
SData* const p = va_arg(ap, SData*);
|
||||
*p = owp[0];
|
||||
*p = VL_CLEAN_II(obits, obits, owp[0]);
|
||||
} else if (obits <= VL_IDATASIZE) {
|
||||
IData* const p = va_arg(ap, IData*);
|
||||
*p = owp[0];
|
||||
*p = VL_CLEAN_II(obits, obits, owp[0]);
|
||||
} else if (obits <= VL_QUADSIZE) {
|
||||
QData* const p = va_arg(ap, QData*);
|
||||
*p = VL_SET_QW(owp);
|
||||
*p = VL_CLEAN_QQ(obits, obits, VL_SET_QW(owp));
|
||||
} else {
|
||||
_vl_clean_inplace_w(obits, owp);
|
||||
}
|
||||
}
|
||||
} // switch
|
||||
@@ -1381,7 +1445,7 @@ static IData getLine(std::string& str, IData fpi, size_t maxLen) VL_MT_SAFE {
|
||||
str.push_back(c);
|
||||
if (c == '\n') break;
|
||||
}
|
||||
return str.size();
|
||||
return static_cast<IData>(str.size());
|
||||
}
|
||||
|
||||
IData VL_FGETS_IXI(int obits, void* destp, IData fpi) VL_MT_SAFE {
|
||||
@@ -1410,6 +1474,12 @@ IData VL_FERROR_IN(IData, std::string& outputr) VL_MT_SAFE {
|
||||
outputr = std::string{::std::strerror(ret)};
|
||||
return ret;
|
||||
}
|
||||
IData VL_FERROR_IW(IData fpi, int obits, WDataOutP outwp) VL_MT_SAFE {
|
||||
std::string output;
|
||||
const IData ret = VL_FERROR_IN(fpi, output /*ref*/);
|
||||
_vl_string_to_vint(obits, outwp, output.length(), output.c_str());
|
||||
return ret;
|
||||
}
|
||||
|
||||
IData VL_FOPEN_NN(const std::string& filename, const std::string& mode) {
|
||||
return Verilated::threadContextp()->impp()->fdNew(filename.c_str(), mode.c_str());
|
||||
@@ -1612,7 +1682,7 @@ IData VL_FREAD_I(int width, int array_lsb, int array_size, void* memp, IData fpi
|
||||
*datap |= ((static_cast<QData>(c) << static_cast<QData>(shift)) & VL_MASK_Q(width));
|
||||
} else {
|
||||
WDataOutP datap = &(reinterpret_cast<WDataOutP>(memp))[entry * VL_WORDS_I(width)];
|
||||
if (shift == start_shift) VL_ZERO_RESET_W(width, datap);
|
||||
if (shift == start_shift) VL_ZERO_W(width, datap);
|
||||
datap[VL_BITWORD_E(shift)] |= (static_cast<EData>(c) << VL_BITBIT_E(shift));
|
||||
}
|
||||
// Prep for next
|
||||
@@ -1631,12 +1701,12 @@ std::string VL_STACKTRACE_N() VL_MT_SAFE {
|
||||
static VerilatedMutex s_stackTraceMutex;
|
||||
const VerilatedLockGuard lock{s_stackTraceMutex};
|
||||
|
||||
constexpr int BT_BUF_SIZE = 100;
|
||||
void* buffer[BT_BUF_SIZE];
|
||||
int nptrs = 0;
|
||||
char** strings = nullptr;
|
||||
|
||||
#ifdef _VL_HAVE_STACKTRACE
|
||||
constexpr int BT_BUF_SIZE = 100;
|
||||
void* buffer[BT_BUF_SIZE];
|
||||
nptrs = backtrace(buffer, BT_BUF_SIZE);
|
||||
strings = backtrace_symbols(buffer, nptrs);
|
||||
#endif
|
||||
@@ -1644,15 +1714,15 @@ std::string VL_STACKTRACE_N() VL_MT_SAFE {
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (!strings) return "Unable to backtrace\n";
|
||||
|
||||
std::string out = "Backtrace:\n";
|
||||
for (int j = 0; j < nptrs; j++) out += std::string{strings[j]} + std::string{"\n"};
|
||||
std::string result = "Backtrace:\n";
|
||||
for (int j = 0; j < nptrs; j++) result += std::string{strings[j]} + std::string{"\n"};
|
||||
free(strings);
|
||||
return out;
|
||||
return result;
|
||||
}
|
||||
|
||||
void VL_STACKTRACE() VL_MT_SAFE {
|
||||
const std::string out = VL_STACKTRACE_N();
|
||||
VL_PRINTF("%s", out.c_str());
|
||||
const std::string result = VL_STACKTRACE_N();
|
||||
VL_PRINTF("%s", result.c_str());
|
||||
}
|
||||
|
||||
IData VL_SYSTEM_IQ(QData lhs) VL_MT_SAFE {
|
||||
@@ -1701,7 +1771,7 @@ IData VL_VALUEPLUSARGS_INW(int rbits, const std::string& ld, WDataOutP rwp) VL_M
|
||||
const char* const dp = match.c_str() + 1 /*leading + */ + prefix.length();
|
||||
if (match.empty()) return 0;
|
||||
|
||||
VL_ZERO_RESET_W(rbits, rwp);
|
||||
VL_ZERO_W(rbits, rwp);
|
||||
switch (std::tolower(fmt)) {
|
||||
case 'd': {
|
||||
int64_t lld = 0;
|
||||
@@ -1792,22 +1862,23 @@ std::string VL_TO_STRING(CData lhs) { return VL_SFORMATF_NX("'h%0x", 8, lhs); }
|
||||
std::string VL_TO_STRING(SData lhs) { return VL_SFORMATF_NX("'h%0x", 16, lhs); }
|
||||
std::string VL_TO_STRING(IData lhs) { return VL_SFORMATF_NX("'h%0x", 32, lhs); }
|
||||
std::string VL_TO_STRING(QData lhs) { return VL_SFORMATF_NX("'h%0x", 64, lhs); }
|
||||
std::string VL_TO_STRING(double lhs) { return VL_SFORMATF_NX("%d", 64, lhs); }
|
||||
std::string VL_TO_STRING_W(int words, const WDataInP obj) {
|
||||
return VL_SFORMATF_NX("'h%0x", words * VL_EDATASIZE, obj);
|
||||
}
|
||||
|
||||
std::string VL_TOLOWER_NN(const std::string& ld) VL_PURE {
|
||||
std::string out = ld;
|
||||
for (auto& cr : out) cr = std::tolower(cr);
|
||||
return out;
|
||||
std::string result = ld;
|
||||
for (auto& cr : result) cr = std::tolower(cr);
|
||||
return result;
|
||||
}
|
||||
std::string VL_TOUPPER_NN(const std::string& ld) VL_PURE {
|
||||
std::string out = ld;
|
||||
for (auto& cr : out) cr = std::toupper(cr);
|
||||
return out;
|
||||
std::string result = ld;
|
||||
for (auto& cr : result) cr = std::toupper(cr);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string VL_CVT_PACK_STR_NW(int lwords, const WDataInP lwp) VL_MT_SAFE {
|
||||
std::string VL_CVT_PACK_STR_NW(int lwords, const WDataInP lwp) VL_PURE {
|
||||
// See also _vl_vint_to_string
|
||||
char destout[VL_VALUE_STRING_MAX_CHARS + 1];
|
||||
const int obits = lwords * VL_EDATASIZE;
|
||||
@@ -1825,6 +1896,12 @@ std::string VL_CVT_PACK_STR_NW(int lwords, const WDataInP lwp) VL_MT_SAFE {
|
||||
return std::string{destout, len};
|
||||
}
|
||||
|
||||
std::string VL_CVT_PACK_STR_ND(const VlQueue<std::string>& q) VL_PURE {
|
||||
std::string output;
|
||||
for (const std::string& s : q) output += s;
|
||||
return output;
|
||||
}
|
||||
|
||||
std::string VL_PUTC_N(const std::string& lhs, IData rhs, CData ths) VL_PURE {
|
||||
std::string lstring = lhs;
|
||||
const int32_t rhs_s = rhs; // To signed value
|
||||
@@ -1860,6 +1937,32 @@ IData VL_ATOI_N(const std::string& str, int base) VL_PURE {
|
||||
if (errno != 0) v = 0;
|
||||
return static_cast<IData>(v);
|
||||
}
|
||||
IData VL_NTOI_I(int obits, const std::string& str) VL_PURE { return VL_NTOI_Q(obits, str); }
|
||||
QData VL_NTOI_Q(int obits, const std::string& str) VL_PURE {
|
||||
QData out = 0;
|
||||
const char* const datap = str.data();
|
||||
int pos = static_cast<int>(str.length()) - 1;
|
||||
int bit = 0;
|
||||
while (bit < obits && pos >= 0) {
|
||||
out |= static_cast<QData>(datap[pos]) << VL_BITBIT_Q(bit);
|
||||
bit += 8;
|
||||
--pos;
|
||||
}
|
||||
return out & VL_MASK_Q(obits);
|
||||
}
|
||||
void VL_NTOI_W(int obits, WDataOutP owp, const std::string& str) VL_PURE {
|
||||
const int words = VL_WORDS_I(obits);
|
||||
for (int i = 0; i < words; ++i) owp[i] = 0;
|
||||
const char* const datap = str.data();
|
||||
int pos = static_cast<int>(str.length()) - 1;
|
||||
int bit = 0;
|
||||
while (bit < obits && pos >= 0) {
|
||||
owp[VL_BITWORD_I(bit)] |= static_cast<EData>(datap[pos]) << VL_BITBIT_I(bit);
|
||||
bit += 8;
|
||||
--pos;
|
||||
}
|
||||
owp[words - 1] &= VL_MASK_E(obits);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Readmem/writemem
|
||||
@@ -2023,7 +2126,7 @@ void VlReadMem::setData(void* valuep, const std::string& rhs) {
|
||||
& VL_MASK_Q(m_bits);
|
||||
} else {
|
||||
WDataOutP datap = reinterpret_cast<WDataOutP>(valuep);
|
||||
if (!innum) VL_ZERO_RESET_W(m_bits, datap);
|
||||
if (!innum) VL_ZERO_W(m_bits, datap);
|
||||
_vl_shiftl_inplace_w(m_bits, datap, static_cast<IData>(shift));
|
||||
datap[0] |= value;
|
||||
}
|
||||
@@ -2567,7 +2670,7 @@ std::pair<int, char**> VerilatedContextImp::argc_argv() VL_MT_SAFE_EXCLUDES(m_ar
|
||||
static char** s_argvp = nullptr;
|
||||
if (VL_UNLIKELY(!s_loaded)) {
|
||||
s_loaded = true;
|
||||
s_argc = m_args.m_argVec.size();
|
||||
s_argc = static_cast<int>(m_args.m_argVec.size());
|
||||
s_argvp = new char*[s_argc + 1];
|
||||
int in = 0;
|
||||
for (const auto& i : m_args.m_argVec) {
|
||||
@@ -2789,27 +2892,38 @@ static struct {
|
||||
VoidPCbList s_exitCbs VL_GUARDED_BY(s_exitMutex);
|
||||
} VlCbStatic;
|
||||
|
||||
static void addCb(Verilated::VoidPCb cb, void* datap, VoidPCbList& cbs) VL_MT_UNSAFE {
|
||||
static void addCbFlush(Verilated::VoidPCb cb, void* datap)
|
||||
VL_MT_SAFE_EXCLUDES(VlCbStatic.s_flushMutex) {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_flushMutex};
|
||||
std::pair<Verilated::VoidPCb, void*> pair(cb, datap);
|
||||
cbs.remove(pair); // Just in case it's a duplicate
|
||||
cbs.push_back(pair);
|
||||
VlCbStatic.s_flushCbs.remove(pair); // Just in case it's a duplicate
|
||||
VlCbStatic.s_flushCbs.push_back(pair);
|
||||
}
|
||||
static void removeCb(Verilated::VoidPCb cb, void* datap, VoidPCbList& cbs) VL_MT_UNSAFE {
|
||||
static void addCbExit(Verilated::VoidPCb cb, void* datap)
|
||||
VL_MT_SAFE_EXCLUDES(VlCbStatic.s_exitMutex) {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_exitMutex};
|
||||
std::pair<Verilated::VoidPCb, void*> pair(cb, datap);
|
||||
cbs.remove(pair);
|
||||
VlCbStatic.s_exitCbs.remove(pair); // Just in case it's a duplicate
|
||||
VlCbStatic.s_exitCbs.push_back(pair);
|
||||
}
|
||||
static void removeCbFlush(Verilated::VoidPCb cb, void* datap)
|
||||
VL_MT_SAFE_EXCLUDES(VlCbStatic.s_flushMutex) {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_flushMutex};
|
||||
std::pair<Verilated::VoidPCb, void*> pair(cb, datap);
|
||||
VlCbStatic.s_flushCbs.remove(pair);
|
||||
}
|
||||
static void removeCbExit(Verilated::VoidPCb cb, void* datap)
|
||||
VL_MT_SAFE_EXCLUDES(VlCbStatic.s_exitMutex) {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_exitMutex};
|
||||
std::pair<Verilated::VoidPCb, void*> pair(cb, datap);
|
||||
VlCbStatic.s_exitCbs.remove(pair);
|
||||
}
|
||||
static void runCallbacks(const VoidPCbList& cbs) VL_MT_SAFE {
|
||||
for (const auto& i : cbs) i.first(i.second);
|
||||
}
|
||||
|
||||
void Verilated::addFlushCb(VoidPCb cb, void* datap) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_flushMutex};
|
||||
addCb(cb, datap, VlCbStatic.s_flushCbs);
|
||||
}
|
||||
void Verilated::removeFlushCb(VoidPCb cb, void* datap) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_flushMutex};
|
||||
removeCb(cb, datap, VlCbStatic.s_flushCbs);
|
||||
}
|
||||
void Verilated::addFlushCb(VoidPCb cb, void* datap) VL_MT_SAFE { addCbFlush(cb, datap); }
|
||||
void Verilated::removeFlushCb(VoidPCb cb, void* datap) VL_MT_SAFE { removeCbFlush(cb, datap); }
|
||||
void Verilated::runFlushCallbacks() VL_MT_SAFE {
|
||||
// Flush routines may call flush, so avoid mutex deadlock
|
||||
static std::atomic<int> s_recursing;
|
||||
@@ -2826,14 +2940,8 @@ void Verilated::runFlushCallbacks() VL_MT_SAFE {
|
||||
VL_GCOV_DUMP();
|
||||
}
|
||||
|
||||
void Verilated::addExitCb(VoidPCb cb, void* datap) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_exitMutex};
|
||||
addCb(cb, datap, VlCbStatic.s_exitCbs);
|
||||
}
|
||||
void Verilated::removeExitCb(VoidPCb cb, void* datap) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock{VlCbStatic.s_exitMutex};
|
||||
removeCb(cb, datap, VlCbStatic.s_exitCbs);
|
||||
}
|
||||
void Verilated::addExitCb(VoidPCb cb, void* datap) VL_MT_SAFE { addCbExit(cb, datap); }
|
||||
void Verilated::removeExitCb(VoidPCb cb, void* datap) VL_MT_SAFE { removeCbExit(cb, datap); }
|
||||
void Verilated::runExitCallbacks() VL_MT_SAFE {
|
||||
static std::atomic<int> s_recursing;
|
||||
if (!s_recursing++) {
|
||||
@@ -2942,7 +3050,7 @@ VerilatedModule::~VerilatedModule() {
|
||||
// VerilatedVar:: Methods
|
||||
|
||||
// cppcheck-suppress unusedFunction // Used by applications
|
||||
uint32_t VerilatedVarProps::entSize() const {
|
||||
uint32_t VerilatedVarProps::entSize() const VL_MT_SAFE {
|
||||
uint32_t size = 1;
|
||||
switch (vltype()) {
|
||||
case VLVT_PTR: size = sizeof(void*); break;
|
||||
@@ -2962,7 +3070,7 @@ size_t VerilatedVarProps::totalSize() const {
|
||||
return size;
|
||||
}
|
||||
|
||||
void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const {
|
||||
void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const VL_MT_SAFE {
|
||||
if (VL_UNLIKELY(dim <= 0 || dim > udims())) return nullptr;
|
||||
if (VL_UNLIKELY(indx < low(dim) || indx > high(dim))) return nullptr;
|
||||
const int indxAdj = indx - low(dim);
|
||||
@@ -3081,7 +3189,7 @@ void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* VerilatedScope::exportFindError(int funcnum) const {
|
||||
void* VerilatedScope::exportFindError(int funcnum) const VL_MT_SAFE {
|
||||
// Slowpath - Called only when find has failed
|
||||
const std::string msg
|
||||
= (std::string{"Testbench C called '"} + VerilatedImp::exportName(funcnum)
|
||||
@@ -3126,15 +3234,18 @@ void VerilatedAssertOneThread::fatal_different() VL_MT_SAFE {
|
||||
//===========================================================================
|
||||
// VlDeleter:: Methods
|
||||
|
||||
void VlDeleter::deleteAll() {
|
||||
void VlDeleter::deleteAll() VL_EXCLUDES(m_mutex) VL_EXCLUDES(m_deleteMutex) VL_MT_SAFE {
|
||||
while (true) {
|
||||
VerilatedLockGuard lock{m_mutex};
|
||||
if (m_newGarbage.empty()) break;
|
||||
VerilatedLockGuard deleteLock{m_deleteMutex};
|
||||
std::swap(m_newGarbage, m_toDelete);
|
||||
lock.unlock(); // So destructors can enqueue new objects
|
||||
{
|
||||
VerilatedLockGuard lock{m_mutex};
|
||||
if (m_newGarbage.empty()) break;
|
||||
m_deleteMutex.lock();
|
||||
std::swap(m_newGarbage, m_toDelete);
|
||||
// m_mutex is unlocked here, so destructors can enqueue new objects
|
||||
}
|
||||
for (VlDeletable* const objp : m_toDelete) delete objp;
|
||||
m_toDelete.clear();
|
||||
m_deleteMutex.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+45
-17
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -30,6 +30,13 @@
|
||||
#ifndef VERILATOR_VERILATED_H_
|
||||
#define VERILATOR_VERILATED_H_
|
||||
#define VERILATOR_VERILATED_H_INTERNAL_
|
||||
#ifdef VERILATOR_INTERNAL_
|
||||
// This file contains definition of VerilationMutex that should
|
||||
// only be used by verilated code. Verilator itself should use
|
||||
// mutex from V3Mutex.h. Make sure this file isn't included in
|
||||
// verilator code.
|
||||
#error "verilated.h should only be included in verilated code"
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
#include "verilatedos.h"
|
||||
@@ -47,6 +54,7 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <deque>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
@@ -141,6 +149,15 @@ enum VerilatedVarFlags {
|
||||
VLVF_DPI_CLAY = (1 << 10) // DPI compatible C standard layout
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Utility functions
|
||||
|
||||
template <size_t N>
|
||||
inline constexpr size_t roundUpToMultipleOf(size_t value) {
|
||||
static_assert((N & (N - 1)) == 0, "'N' must be a power of 2");
|
||||
return (value + N - 1) & ~(N - 1);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Mutex and threading support
|
||||
|
||||
@@ -158,6 +175,7 @@ public:
|
||||
/// Construct mutex (without locking it)
|
||||
VerilatedMutex() = default;
|
||||
~VerilatedMutex() = default;
|
||||
VL_UNCOPYABLE(VerilatedMutex);
|
||||
const VerilatedMutex& operator!() const { return *this; } // For -fthread_safety
|
||||
/// Acquire/lock mutex
|
||||
void lock() VL_ACQUIRE() VL_MT_SAFE {
|
||||
@@ -175,6 +193,19 @@ public:
|
||||
void unlock() VL_RELEASE() VL_MT_SAFE { m_mutex.unlock(); }
|
||||
/// Try to acquire mutex. Returns true on success, and false on failure.
|
||||
bool try_lock() VL_TRY_ACQUIRE(true) VL_MT_SAFE { return m_mutex.try_lock(); }
|
||||
/// Acquire/lock mutex and check for stop request
|
||||
/// It tries to lock the mutex and if it fails, it check if stop request was send.
|
||||
/// It returns after locking mutex.
|
||||
/// This function should be extracted to V3ThreadPool, but due to clang thread-safety
|
||||
/// limitations it needs to be placed here.
|
||||
void lockCheckStopRequest(std::function<void()> checkStopRequestFunction)
|
||||
VL_ACQUIRE() VL_MT_SAFE {
|
||||
while (true) {
|
||||
checkStopRequestFunction();
|
||||
if (m_mutex.try_lock()) return;
|
||||
VL_CPU_RELAX();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// Lock guard for mutex (ala std::unique_lock), wrapped to allow -fthread_safety checks
|
||||
@@ -188,14 +219,10 @@ public:
|
||||
/// Construct and hold given mutex lock until destruction or unlock()
|
||||
explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) VL_MT_SAFE
|
||||
: m_mutexr(mutexr) { // Need () or GCC 4.8 false warning
|
||||
m_mutexr.lock();
|
||||
mutexr.lock();
|
||||
}
|
||||
/// Destruct and unlock the mutex
|
||||
~VerilatedLockGuard() VL_RELEASE() { m_mutexr.unlock(); }
|
||||
/// Unlock the mutex
|
||||
void lock() VL_ACQUIRE() VL_MT_SAFE { m_mutexr.lock(); }
|
||||
/// Lock the mutex
|
||||
void unlock() VL_RELEASE() VL_MT_SAFE { m_mutexr.unlock(); }
|
||||
};
|
||||
|
||||
// Internals: Remember the calling thread at construction time, and make
|
||||
@@ -364,7 +391,7 @@ protected:
|
||||
// assumption is that the restore is allowed to pass different arguments
|
||||
struct NonSerializedCommandArgs {
|
||||
// Medium speed
|
||||
std::vector<std::string> m_argVec; // Aargument list
|
||||
std::vector<std::string> m_argVec; // Argument list
|
||||
bool m_argVecLoaded = false; // Ever loaded argument list
|
||||
} m_args VL_GUARDED_BY(m_argMutex);
|
||||
|
||||
@@ -469,7 +496,7 @@ public:
|
||||
int randSeed() const VL_MT_SAFE { return m_s.m_randSeed; }
|
||||
|
||||
// Time handling
|
||||
/// Returns current simulation time.
|
||||
/// Returns current simulation time in units of timeprecision().
|
||||
///
|
||||
/// How Verilator runtime gets the current simulation time:
|
||||
///
|
||||
@@ -584,6 +611,7 @@ public: // But for internal use only
|
||||
VerilatedEvalMsgQueue* __Vm_evalMsgQp;
|
||||
explicit VerilatedSyms(VerilatedContext* contextp); // Pass null for default context
|
||||
~VerilatedSyms();
|
||||
VL_UNCOPYABLE(VerilatedSyms);
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
@@ -600,7 +628,7 @@ private:
|
||||
// Fastpath:
|
||||
VerilatedSyms* m_symsp = nullptr; // Symbol table
|
||||
void** m_callbacksp = nullptr; // Callback table pointer (Fastpath)
|
||||
int m_funcnumMax = 0; // Maxium function number stored (Fastpath)
|
||||
int m_funcnumMax = 0; // Maximum function number stored (Fastpath)
|
||||
// 4 bytes padding (on -m64), for rent.
|
||||
VerilatedVarNameMap* m_varsp = nullptr; // Variable map
|
||||
const char* m_namep = nullptr; // Scope name (Slowpath)
|
||||
@@ -624,7 +652,7 @@ public: // But internals only - called from VerilatedModule's
|
||||
VerilatedVar* varFind(const char* namep) const VL_MT_SAFE_POSTINIT;
|
||||
VerilatedVarNameMap* varsp() const VL_MT_SAFE_POSTINIT { return m_varsp; }
|
||||
void scopeDump() const;
|
||||
void* exportFindError(int funcnum) const;
|
||||
void* exportFindError(int funcnum) const VL_MT_SAFE;
|
||||
static void* exportFindNullError(int funcnum) VL_MT_SAFE;
|
||||
static void* exportFind(const VerilatedScope* scopep, int funcnum) VL_MT_SAFE {
|
||||
if (VL_UNLIKELY(!scopep)) return exportFindNullError(funcnum);
|
||||
@@ -922,18 +950,18 @@ void VerilatedContext::timeprecision(int value) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock{m_mutex};
|
||||
m_s.m_timeprecision = value;
|
||||
#if VM_SC
|
||||
const sc_time sc_res = sc_get_time_resolution();
|
||||
if (sc_res == sc_time(1, SC_SEC)) {
|
||||
const sc_core::sc_time sc_res = sc_core::sc_get_time_resolution();
|
||||
if (sc_res == sc_core::sc_time(1, sc_core::SC_SEC)) {
|
||||
sc_prec = 0;
|
||||
} else if (sc_res == sc_time(1, SC_MS)) {
|
||||
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_MS)) {
|
||||
sc_prec = 3;
|
||||
} else if (sc_res == sc_time(1, SC_US)) {
|
||||
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_US)) {
|
||||
sc_prec = 6;
|
||||
} else if (sc_res == sc_time(1, SC_NS)) {
|
||||
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_NS)) {
|
||||
sc_prec = 9;
|
||||
} else if (sc_res == sc_time(1, SC_PS)) {
|
||||
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_PS)) {
|
||||
sc_prec = 12;
|
||||
} else if (sc_res == sc_time(1, SC_FS)) {
|
||||
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_FS)) {
|
||||
sc_prec = 15;
|
||||
}
|
||||
#endif
|
||||
|
||||
+26
-8
@@ -2,7 +2,7 @@
|
||||
######################################################################
|
||||
# DESCRIPTION: Makefile commands for all verilated target files
|
||||
#
|
||||
# Copyright 2003-2022 by Wilson Snyder. This program is free software; you
|
||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
@@ -21,7 +21,9 @@ CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
|
||||
|
||||
# Compiler flags to enable profiling
|
||||
CFG_CXXFLAGS_PROFILE = @CFG_CXXFLAGS_PROFILE@
|
||||
# Select newest language
|
||||
# Select language required to compile (often empty)
|
||||
CFG_CXXFLAGS_STD = @CFG_CXXFLAGS_STD@
|
||||
# Select newest language (unused by this Makefile, for some test's Makefiles)
|
||||
CFG_CXXFLAGS_STD_NEWEST = @CFG_CXXFLAGS_STD_NEWEST@
|
||||
# Compiler flags to use to turn off unused and generated code warnings, such as -Wno-div-by-zero
|
||||
CFG_CXXFLAGS_NO_UNUSED = @CFG_CXXFLAGS_NO_UNUSED@
|
||||
@@ -29,6 +31,8 @@ CFG_CXXFLAGS_NO_UNUSED = @CFG_CXXFLAGS_NO_UNUSED@
|
||||
CFG_CXXFLAGS_WEXTRA = @CFG_CXXFLAGS_WEXTRA@
|
||||
# Compiler flags that enable coroutine support
|
||||
CFG_CXXFLAGS_COROUTINES = @CFG_CXXFLAGS_COROUTINES@
|
||||
# Linker flags
|
||||
CFG_LDFLAGS_VERILATED = @CFG_LDFLAGS_VERILATED@
|
||||
# Linker libraries for multithreading
|
||||
CFG_LDLIBS_THREADS = @CFG_LDLIBS_THREADS@
|
||||
|
||||
@@ -36,7 +40,7 @@ CFG_LDLIBS_THREADS = @CFG_LDLIBS_THREADS@
|
||||
# Programs
|
||||
|
||||
VERILATOR_COVERAGE = $(PERL) $(VERILATOR_ROOT)/bin/verilator_coverage
|
||||
VERILATOR_INCLUDER = $(PERL) $(VERILATOR_ROOT)/bin/verilator_includer
|
||||
VERILATOR_INCLUDER = $(PYTHON3) $(VERILATOR_ROOT)/bin/verilator_includer
|
||||
VERILATOR_CCACHE_REPORT = $(PYTHON3) $(VERILATOR_ROOT)/bin/verilator_ccache_report
|
||||
|
||||
######################################################################
|
||||
@@ -46,6 +50,10 @@ ifneq ($(words $(CURDIR)),1)
|
||||
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# OS detection
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
######################################################################
|
||||
# C Preprocessor flags
|
||||
|
||||
@@ -61,7 +69,7 @@ VK_CPPFLAGS_ALWAYS += \
|
||||
-DVM_TRACE_VCD=$(VM_TRACE_VCD) \
|
||||
$(CFG_CXXFLAGS_NO_UNUSED) \
|
||||
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
||||
VK_CPPFLAGS_WALL += -Wall $(CFG_CXXFLAGS_WEXTRA) -Werror
|
||||
endif
|
||||
|
||||
@@ -71,6 +79,8 @@ VPATH += ..
|
||||
VPATH += $(VERILATOR_ROOT)/include
|
||||
VPATH += $(VERILATOR_ROOT)/include/vltstd
|
||||
|
||||
LDFLAGS += $(CFG_LDFLAGS_VERILATED)
|
||||
|
||||
#OPT = -ggdb -DPRINTINITSTR -DDETECTCHANGE
|
||||
#OPT = -ggdb -DPRINTINITSTR
|
||||
CPPFLAGS += $(OPT)
|
||||
@@ -78,6 +88,12 @@ CPPFLAGS += $(OPT)
|
||||
CPPFLAGS += $(M32)
|
||||
LDFLAGS += $(M32)
|
||||
|
||||
# On macOS, specify all weak symbols as dynamic_lookup.
|
||||
# Otherwise, you get undefined symbol errors.
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
LDFLAGS += -Wl,-U,__Z15vl_time_stamp64v,-U,__Z13sc_time_stampv
|
||||
endif
|
||||
|
||||
# Allow upper level user makefiles to specify flags they want.
|
||||
# These aren't ever set by Verilator, so users are free to override them.
|
||||
CPPFLAGS += $(USER_CPPFLAGS)
|
||||
@@ -130,7 +146,7 @@ endif
|
||||
#######################################################################
|
||||
##### Threaded builds
|
||||
|
||||
CPPFLAGS += $(CFG_CXXFLAGS_STD_NEWEST)
|
||||
CPPFLAGS += $(CFG_CXXFLAGS_STD)
|
||||
LDLIBS += $(CFG_LDLIBS_THREADS)
|
||||
|
||||
ifneq ($(VM_TIMING),0)
|
||||
@@ -223,14 +239,16 @@ $(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS)
|
||||
ifneq ($(VM_DEFAULT_RULES),0)
|
||||
# Anything not in $(VK_SLOW_OBJS) or $(VK_GLOBAL_OBJS), including verilated.o
|
||||
# and user files passed on the Verilator command line use this rule.
|
||||
# We put OPT_FAST/OPT_SLOW/OPT_GLOBAL before the other flags to
|
||||
# allow USER_CPPFLAGS to override them
|
||||
%.o: %.cpp
|
||||
$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o $@ $<
|
||||
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
||||
$(VK_SLOW_OBJS): %.o: %.cpp
|
||||
$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_SLOW) -c -o $@ $<
|
||||
$(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
||||
$(VK_GLOBAL_OBJS): %.o: %.cpp
|
||||
$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_GLOBAL) -c -o $@ $<
|
||||
$(OBJCACHE) $(CXX) $(OPT_GLOBAL) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
endif
|
||||
|
||||
#Default rule embedded in make:
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -208,11 +208,11 @@ private:
|
||||
// Forward to . so we have a whole word
|
||||
const std::string suffix = *bpost ? std::string{bpost + 1} : "";
|
||||
|
||||
std::string out = prefix + "*" + suffix;
|
||||
std::string result = prefix + "*" + suffix;
|
||||
|
||||
// cout << "\nch pre="<<prefix<<" s="<<suffix<<"\nch a="<<old<<"\nch b="<<add
|
||||
// <<"\ncho="<<out<<endl;
|
||||
return out;
|
||||
// std::cout << "\nch pre=" << prefix << " s=" << suffix << "\nch a="
|
||||
// << old << "\nch b=" << add << "\ncho=" << result << std::endl;
|
||||
return result;
|
||||
}
|
||||
bool itemMatchesString(VerilatedCovImpItem* itemp, const std::string& match)
|
||||
VL_REQUIRES(m_mutex) {
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
valps[2] = page_default.c_str();
|
||||
|
||||
// Keys -> strings
|
||||
std::string keys[VerilatedCovConst::MAX_KEYS];
|
||||
std::array<std::string, VerilatedCovConst::MAX_KEYS> keys;
|
||||
for (int i = 0; i < VerilatedCovConst::MAX_KEYS; ++i) {
|
||||
if (ckeyps[i] && ckeyps[i][0]) keys[i] = ckeyps[i];
|
||||
}
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
const std::string key = keys[i];
|
||||
if (!keys[i].empty()) {
|
||||
const std::string val = valps[i];
|
||||
// cout<<" "<<__FUNCTION__<<" "<<key<<" = "<<val<<endl;
|
||||
// std::cout << " " << __FUNCTION__ << " " << key << " = " << val << std::endl;
|
||||
m_insertp->m_keys[addKeynum] = valueIndex(key);
|
||||
m_insertp->m_vals[addKeynum] = valueIndex(val);
|
||||
++addKeynum;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2009-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2009-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -191,7 +191,7 @@ void VerilatedFst::declare(uint32_t code, const char* name, int dtypenum, fstVar
|
||||
if ((new_it->back() & 0x80)) {
|
||||
tmpModName = *new_it;
|
||||
tmpModName.pop_back();
|
||||
// If the scope ends with a non-ascii character, it will be 0x80 + fstScopeType
|
||||
// If the scope ends with a non-ASCII character, it will be 0x80 + fstScopeType
|
||||
fstWriterSetScope(m_fst, static_cast<fstScopeType>(new_it->back() & 0x7f),
|
||||
tmpModName.c_str(), nullptr);
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// THIS MODULE IS PUBLICLY LICENSED
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
+12
-12
@@ -1,7 +1,7 @@
|
||||
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
||||
//=============================================================================
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -19,8 +19,8 @@
|
||||
///
|
||||
//=============================================================================
|
||||
|
||||
#ifndef VERILATOR_VERILATED_VCD_SC_H_
|
||||
#define VERILATOR_VERILATED_VCD_SC_H_
|
||||
#ifndef VERILATOR_VERILATED_FST_SC_H_
|
||||
#define VERILATOR_VERILATED_FST_SC_H_
|
||||
|
||||
#include "verilatedos.h"
|
||||
|
||||
@@ -36,23 +36,23 @@
|
||||
/// with the SystemC simulation kernel, just like a SystemC-documented
|
||||
/// trace format.
|
||||
|
||||
class VerilatedFstSc final : sc_trace_file, public VerilatedFstC {
|
||||
class VerilatedFstSc final : sc_core::sc_trace_file, public VerilatedFstC {
|
||||
// CONSTRUCTORS
|
||||
VL_UNCOPYABLE(VerilatedFstSc);
|
||||
|
||||
public:
|
||||
/// Construct a SC trace object, and register with the SystemC kernel
|
||||
VerilatedFstSc() {
|
||||
sc_get_curr_simcontext()->add_trace_file(this);
|
||||
sc_core::sc_get_curr_simcontext()->add_trace_file(this);
|
||||
// We want to avoid a depreciated warning, but still be back compatible.
|
||||
// Turning off the message just for this still results in an
|
||||
// annoying "to turn off" message.
|
||||
const sc_time t1sec{1, SC_SEC};
|
||||
const sc_core::sc_time t1sec{1, sc_core::SC_SEC};
|
||||
if (t1sec.to_default_time_units() != 0) {
|
||||
const sc_time tunits{1.0 / t1sec.to_default_time_units(), SC_SEC};
|
||||
const sc_core::sc_time tunits{1.0 / t1sec.to_default_time_units(), sc_core::SC_SEC};
|
||||
spTrace()->set_time_unit(tunits.to_string());
|
||||
}
|
||||
spTrace()->set_time_resolution(sc_get_time_resolution().to_string());
|
||||
spTrace()->set_time_resolution(sc_core::sc_get_time_resolution().to_string());
|
||||
}
|
||||
/// Destruct, flush, and close the dump
|
||||
~VerilatedFstSc() override { close(); }
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
// METHODS - for SC kernel
|
||||
// Called by SystemC simulate()
|
||||
void cycle(bool delta_cycle) override {
|
||||
if (!delta_cycle) this->dump(sc_time_stamp().to_double());
|
||||
if (!delta_cycle) this->dump(sc_core::sc_time_stamp().to_double());
|
||||
}
|
||||
|
||||
// Override VerilatedFstC. Must be called after starting simulation.
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
// Cadence Incisive has these as abstract functions so we must create them
|
||||
void set_time_unit(int exponent10_seconds) override {} // deprecated
|
||||
#endif
|
||||
void set_time_unit(double v, sc_time_unit tu) override {} // LCOV_EXCL_LINE
|
||||
void set_time_unit(double v, sc_core::sc_time_unit tu) override {} // LCOV_EXCL_LINE
|
||||
|
||||
//--------------------------------------------------
|
||||
// SystemC 2.1.v1
|
||||
@@ -96,8 +96,8 @@ private:
|
||||
// Formatting matches that of sc_trace.h
|
||||
// LCOV_EXCL_START
|
||||
#if (SYSTEMC_VERSION >= 20171012)
|
||||
DECL_TRACE_METHOD_A( sc_event )
|
||||
DECL_TRACE_METHOD_A( sc_time )
|
||||
DECL_TRACE_METHOD_A( sc_core::sc_event )
|
||||
DECL_TRACE_METHOD_A( sc_core::sc_time )
|
||||
#endif
|
||||
|
||||
DECL_TRACE_METHOD_A( bool )
|
||||
|
||||
+76
-51
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -100,12 +100,11 @@ inline IData VL_URANDOM_RANGE_I(IData hi, IData lo) {
|
||||
}
|
||||
}
|
||||
|
||||
// These are init time only, so slow is fine
|
||||
/// Random reset a signal of given width
|
||||
/// Random reset a signal of given width (init time only)
|
||||
extern IData VL_RAND_RESET_I(int obits) VL_MT_SAFE;
|
||||
/// Random reset a signal of given width
|
||||
/// Random reset a signal of given width (init time only)
|
||||
extern QData VL_RAND_RESET_Q(int obits) VL_MT_SAFE;
|
||||
/// Random reset a signal of given width
|
||||
/// Random reset a signal of given width (init time only)
|
||||
extern WDataOutP VL_RAND_RESET_W(int obits, WDataOutP outwp) VL_MT_SAFE;
|
||||
/// Zero reset a signal (slow - else use VL_ZERO_W)
|
||||
extern WDataOutP VL_ZERO_RESET_W(int obits, WDataOutP outwp) VL_MT_SAFE;
|
||||
@@ -153,9 +152,11 @@ extern const char* vl_mc_scan_plusargs(const char* prefixp) VL_MT_SAFE; // PLIi
|
||||
// Base macros
|
||||
|
||||
// Return true if data[bit] set; not 0/1 return, but 0/non-zero return.
|
||||
// Arguments must not have side effects
|
||||
#define VL_BITISSETLIMIT_W(data, width, bit) (((bit) < (width)) && VL_BITISSET_W(data, bit))
|
||||
|
||||
// Shift appropriate word by bit. Does not account for wrapping between two words
|
||||
// Argument 'bit' must not have side effects
|
||||
#define VL_BITRSHIFT_W(data, bit) ((data)[VL_BITWORD_E(bit)] >> VL_BITBIT_E(bit))
|
||||
|
||||
// Create two 32-bit words from quadword
|
||||
@@ -261,7 +262,7 @@ extern void _vl_debug_print_w(int lbits, WDataInP const iwp) VL_MT_SAFE;
|
||||
#if defined(SYSTEMC_VERSION)
|
||||
/// Return current simulation time
|
||||
// Already defined: extern sc_time sc_time_stamp();
|
||||
inline uint64_t vl_time_stamp64() VL_MT_SAFE { return sc_time_stamp().value(); }
|
||||
inline uint64_t vl_time_stamp64() VL_MT_SAFE { return sc_core::sc_time_stamp().value(); }
|
||||
#else // Non-SystemC
|
||||
# if !defined(VL_TIME_CONTEXT) && !defined(VL_NO_LEGACY)
|
||||
# ifdef VL_TIME_STAMP64
|
||||
@@ -507,7 +508,7 @@ static inline void VL_ASSIGNBIT_WO(int bit, WDataOutP owp) VL_MT_SAFE {
|
||||
int32_t lsb = 0; \
|
||||
uint32_t* chunkp = _butemp.get_raw(); \
|
||||
while (lsb + VL_SC_BITS_PER_DIGIT < (obits)) { \
|
||||
static_assert(std::is_same<IData, EData>::value, "IData and EData missmatch"); \
|
||||
static_assert(std::is_same<IData, EData>::value, "IData and EData mismatch"); \
|
||||
const uint32_t data = VL_SEL_IWII(lsb + VL_SC_BITS_PER_DIGIT + 1, (rwp).data(), lsb, \
|
||||
VL_SC_BITS_PER_DIGIT); \
|
||||
*chunkp = data & VL_MASK_E(VL_SC_BITS_PER_DIGIT); \
|
||||
@@ -759,6 +760,7 @@ static inline IData VL_ONEHOT0_W(int words, WDataInP const lwp) VL_PURE {
|
||||
|
||||
static inline IData VL_CLOG2_I(IData lhs) VL_PURE {
|
||||
// There are faster algorithms, or fls GCC4 builtins, but rarely used
|
||||
// In C++20 there will be std::bit_width(lhs) - 1
|
||||
if (VL_UNLIKELY(!lhs)) return 0;
|
||||
--lhs;
|
||||
int shifts = 0;
|
||||
@@ -954,11 +956,19 @@ static inline void VL_NEGATE_INPLACE_W(int words, WDataOutP owp_lwp) VL_MT_SAFE
|
||||
// EMIT_RULE: VL_MUL: oclean=dirty; lclean==clean; rclean==clean;
|
||||
// EMIT_RULE: VL_DIV: oclean=dirty; lclean==clean; rclean==clean;
|
||||
// EMIT_RULE: VL_MODDIV: oclean=dirty; lclean==clean; rclean==clean;
|
||||
#define VL_DIV_III(lbits, lhs, rhs) (((rhs) == 0) ? 0 : (lhs) / (rhs))
|
||||
#define VL_DIV_QQQ(lbits, lhs, rhs) (((rhs) == 0) ? 0 : (lhs) / (rhs))
|
||||
static inline IData VL_DIV_III(int lbits, IData lhs, IData rhs) {
|
||||
return (rhs == 0) ? 0 : lhs / rhs;
|
||||
}
|
||||
static inline QData VL_DIV_QQQ(int lbits, QData lhs, QData rhs) {
|
||||
return (rhs == 0) ? 0 : lhs / rhs;
|
||||
}
|
||||
#define VL_DIV_WWW(lbits, owp, lwp, rwp) (_vl_moddiv_w(lbits, owp, lwp, rwp, 0))
|
||||
#define VL_MODDIV_III(lbits, lhs, rhs) (((rhs) == 0) ? 0 : (lhs) % (rhs))
|
||||
#define VL_MODDIV_QQQ(lbits, lhs, rhs) (((rhs) == 0) ? 0 : (lhs) % (rhs))
|
||||
static inline IData VL_MODDIV_III(int lbits, IData lhs, IData rhs) {
|
||||
return (rhs == 0) ? 0 : lhs % rhs;
|
||||
}
|
||||
static inline QData VL_MODDIV_QQQ(int lbits, QData lhs, QData rhs) {
|
||||
return (rhs == 0) ? 0 : lhs % rhs;
|
||||
}
|
||||
#define VL_MODDIV_WWW(lbits, owp, lwp, rwp) (_vl_moddiv_w(lbits, owp, lwp, rwp, 1))
|
||||
|
||||
static inline WDataOutP VL_ADD_W(int words, WDataOutP owp, WDataInP const lwp,
|
||||
@@ -1246,7 +1256,7 @@ static inline void _vl_insert_QQ(QData& lhsr, QData ld, int hbit, int lbit, int
|
||||
const QData insmask = (VL_MASK_Q(hbit - lbit + 1)) << lbit;
|
||||
lhsr = (lhsr & ~insmask) | ((ld << lbit) & (insmask & cleanmask));
|
||||
}
|
||||
static inline void _vl_insert_WI(WDataOutP owp, IData ld, int hbit, int lbit,
|
||||
static inline void _vl_insert_WI(WDataOutP iowp, IData ld, int hbit, int lbit,
|
||||
int rbits = 0) VL_MT_SAFE {
|
||||
const int hoffset = VL_BITBIT_E(hbit);
|
||||
const int loffset = VL_BITBIT_E(lbit);
|
||||
@@ -1258,28 +1268,28 @@ static inline void _vl_insert_WI(WDataOutP owp, IData ld, int hbit, int lbit,
|
||||
|
||||
if (hoffset == VL_SIZEBITS_E && loffset == 0) {
|
||||
// Fast and common case, word based insertion
|
||||
owp[VL_BITWORD_E(lbit)] = ld & cleanmask;
|
||||
iowp[VL_BITWORD_E(lbit)] = ld & cleanmask;
|
||||
} else {
|
||||
const EData lde = static_cast<EData>(ld);
|
||||
if (hword == lword) { // know < EData bits because above checks it
|
||||
// Assignment is contained within one word of destination
|
||||
const EData insmask = (VL_MASK_E(hoffset - loffset + 1)) << loffset;
|
||||
owp[lword] = (owp[lword] & ~insmask) | ((lde << loffset) & (insmask & cleanmask));
|
||||
iowp[lword] = (iowp[lword] & ~insmask) | ((lde << loffset) & (insmask & cleanmask));
|
||||
} else {
|
||||
// Assignment crosses a word boundary in destination
|
||||
const EData hinsmask = (VL_MASK_E(hoffset - 0 + 1)) << 0;
|
||||
const EData linsmask = (VL_MASK_E((VL_EDATASIZE - 1) - loffset + 1)) << loffset;
|
||||
const int nbitsonright = VL_EDATASIZE - loffset; // bits that end up in lword
|
||||
owp[lword] = (owp[lword] & ~linsmask) | ((lde << loffset) & linsmask);
|
||||
owp[hword]
|
||||
= (owp[hword] & ~hinsmask) | ((lde >> nbitsonright) & (hinsmask & cleanmask));
|
||||
iowp[lword] = (iowp[lword] & ~linsmask) | ((lde << loffset) & linsmask);
|
||||
iowp[hword]
|
||||
= (iowp[hword] & ~hinsmask) | ((lde >> nbitsonright) & (hinsmask & cleanmask));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// INTERNAL: Stuff large LHS bit 0++ into OUTPUT at specified offset
|
||||
// lwp may be "dirty"
|
||||
static inline void _vl_insert_WW(WDataOutP owp, WDataInP const lwp, int hbit, int lbit,
|
||||
static inline void _vl_insert_WW(WDataOutP iowp, WDataInP const lwp, int hbit, int lbit,
|
||||
int rbits = 0) VL_MT_SAFE {
|
||||
const int hoffset = VL_BITBIT_E(hbit);
|
||||
const int loffset = VL_BITBIT_E(lbit);
|
||||
@@ -1294,14 +1304,14 @@ static inline void _vl_insert_WW(WDataOutP owp, WDataInP const lwp, int hbit, in
|
||||
|
||||
if (hoffset == VL_SIZEBITS_E && loffset == 0) {
|
||||
// Fast and common case, word based insertion
|
||||
for (int i = 0; i < (words - 1); ++i) owp[lword + i] = lwp[i];
|
||||
owp[hword] = lwp[words - 1] & cleanmask;
|
||||
for (int i = 0; i < (words - 1); ++i) iowp[lword + i] = lwp[i];
|
||||
iowp[hword] = lwp[words - 1] & cleanmask;
|
||||
} else if (loffset == 0) {
|
||||
// Non-32bit, but nicely aligned, so stuff all but the last word
|
||||
for (int i = 0; i < (words - 1); ++i) owp[lword + i] = lwp[i];
|
||||
for (int i = 0; i < (words - 1); ++i) iowp[lword + i] = lwp[i];
|
||||
// Know it's not a full word as above fast case handled it
|
||||
const EData hinsmask = (VL_MASK_E(hoffset - 0 + 1));
|
||||
owp[hword] = (owp[hword] & ~hinsmask) | (lwp[words - 1] & (hinsmask & cleanmask));
|
||||
iowp[hword] = (iowp[hword] & ~hinsmask) | (lwp[words - 1] & (hinsmask & cleanmask));
|
||||
} else {
|
||||
const EData hinsmask = (VL_MASK_E(hoffset - 0 + 1)) << 0;
|
||||
const EData linsmask = (VL_MASK_E((VL_EDATASIZE - 1) - loffset + 1)) << loffset;
|
||||
@@ -1312,22 +1322,22 @@ static inline void _vl_insert_WW(WDataOutP owp, WDataInP const lwp, int hbit, in
|
||||
{ // Lower word
|
||||
const int oword = lword + i;
|
||||
const EData d = lwp[i] << loffset;
|
||||
const EData od = (owp[oword] & ~linsmask) | (d & linsmask);
|
||||
const EData od = (iowp[oword] & ~linsmask) | (d & linsmask);
|
||||
if (oword == hword) {
|
||||
owp[oword] = (owp[oword] & ~hinsmask) | (od & (hinsmask & cleanmask));
|
||||
iowp[oword] = (iowp[oword] & ~hinsmask) | (od & (hinsmask & cleanmask));
|
||||
} else {
|
||||
owp[oword] = od;
|
||||
iowp[oword] = od;
|
||||
}
|
||||
}
|
||||
{ // Upper word
|
||||
const int oword = lword + i + 1;
|
||||
if (oword <= hword) {
|
||||
const EData d = lwp[i] >> nbitsonright;
|
||||
const EData od = (d & ~linsmask) | (owp[oword] & linsmask);
|
||||
const EData od = (d & ~linsmask) | (iowp[oword] & linsmask);
|
||||
if (oword == hword) {
|
||||
owp[oword] = (owp[oword] & ~hinsmask) | (od & (hinsmask & cleanmask));
|
||||
iowp[oword] = (iowp[oword] & ~hinsmask) | (od & (hinsmask & cleanmask));
|
||||
} else {
|
||||
owp[oword] = od;
|
||||
iowp[oword] = od;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1335,11 +1345,11 @@ static inline void _vl_insert_WW(WDataOutP owp, WDataInP const lwp, int hbit, in
|
||||
}
|
||||
}
|
||||
|
||||
static inline void _vl_insert_WQ(WDataOutP owp, QData ld, int hbit, int lbit,
|
||||
static inline void _vl_insert_WQ(WDataOutP iowp, QData ld, int hbit, int lbit,
|
||||
int rbits = 0) VL_MT_SAFE {
|
||||
VlWide<VL_WQ_WORDS_E> lwp;
|
||||
VL_SET_WQ(lwp, ld);
|
||||
_vl_insert_WW(owp, lwp, hbit, lbit, rbits);
|
||||
_vl_insert_WW(iowp, lwp, hbit, lbit, rbits);
|
||||
}
|
||||
|
||||
// EMIT_RULE: VL_REPLICATE: oclean=clean>width32, dirty<=width32; lclean=clean; rclean==clean;
|
||||
@@ -1366,6 +1376,9 @@ static inline QData VL_REPLICATE_QII(int lbits, IData ld, IData rep) VL_PURE {
|
||||
static inline WDataOutP VL_REPLICATE_WII(int lbits, WDataOutP owp, IData ld,
|
||||
IData rep) VL_MT_SAFE {
|
||||
owp[0] = ld;
|
||||
// Zeroing all words isn't strictly needed but allows compiler to know
|
||||
// it does not need to preserve data in word(s) not being written
|
||||
for (unsigned i = 1; i < VL_WORDS_I(static_cast<unsigned>(lbits) * rep); ++i) owp[i] = 0;
|
||||
for (unsigned i = 1; i < rep; ++i) {
|
||||
_vl_insert_WI(owp, ld, i * lbits + lbits - 1, i * lbits);
|
||||
}
|
||||
@@ -1374,6 +1387,9 @@ static inline WDataOutP VL_REPLICATE_WII(int lbits, WDataOutP owp, IData ld,
|
||||
static inline WDataOutP VL_REPLICATE_WQI(int lbits, WDataOutP owp, QData ld,
|
||||
IData rep) VL_MT_SAFE {
|
||||
VL_SET_WQ(owp, ld);
|
||||
// Zeroing all words isn't strictly needed but allows compiler to know
|
||||
// it does not need to preserve data in word(s) not being written
|
||||
for (unsigned i = 2; i < VL_WORDS_I(static_cast<unsigned>(lbits) * rep); ++i) owp[i] = 0;
|
||||
for (unsigned i = 1; i < rep; ++i) {
|
||||
_vl_insert_WQ(owp, ld, i * lbits + lbits - 1, i * lbits);
|
||||
}
|
||||
@@ -1381,7 +1397,12 @@ static inline WDataOutP VL_REPLICATE_WQI(int lbits, WDataOutP owp, QData ld,
|
||||
}
|
||||
static inline WDataOutP VL_REPLICATE_WWI(int lbits, WDataOutP owp, WDataInP const lwp,
|
||||
IData rep) VL_MT_SAFE {
|
||||
for (int i = 0; i < VL_WORDS_I(lbits); ++i) owp[i] = lwp[i];
|
||||
for (unsigned i = 0; i < VL_WORDS_I(static_cast<unsigned>(lbits)); ++i) owp[i] = lwp[i];
|
||||
// Zeroing all words isn't strictly needed but allows compiler to know
|
||||
// it does not need to preserve data in word(s) not being written
|
||||
for (unsigned i = VL_WORDS_I(static_cast<unsigned>(lbits));
|
||||
i < VL_WORDS_I(static_cast<unsigned>(lbits * rep)); ++i)
|
||||
owp[i] = 0;
|
||||
for (unsigned i = 1; i < rep; ++i) {
|
||||
_vl_insert_WW(owp, lwp, i * lbits + lbits - 1, i * lbits);
|
||||
}
|
||||
@@ -1706,7 +1727,7 @@ static inline WDataOutP VL_SHIFTR_WWQ(int obits, int lbits, int rbits, WDataOutP
|
||||
}
|
||||
|
||||
static inline IData VL_SHIFTR_IIW(int obits, int, int rbits, IData lhs,
|
||||
WDataInP const rwp) VL_MT_SAFE {
|
||||
WDataInP const rwp) VL_PURE {
|
||||
for (int i = 1; i < VL_WORDS_I(rbits); ++i) {
|
||||
if (VL_UNLIKELY(rwp[i])) { // Huge shift 1>>32 or more
|
||||
return 0;
|
||||
@@ -1715,7 +1736,7 @@ static inline IData VL_SHIFTR_IIW(int obits, int, int rbits, IData lhs,
|
||||
return VL_CLEAN_II(obits, obits, lhs >> rwp[0]);
|
||||
}
|
||||
static inline QData VL_SHIFTR_QQW(int obits, int, int rbits, QData lhs,
|
||||
WDataInP const rwp) VL_MT_SAFE {
|
||||
WDataInP const rwp) VL_PURE {
|
||||
for (int i = 1; i < VL_WORDS_I(rbits); ++i) {
|
||||
if (VL_UNLIKELY(rwp[i])) { // Huge shift 1>>32 or more
|
||||
return 0;
|
||||
@@ -1724,11 +1745,11 @@ static inline QData VL_SHIFTR_QQW(int obits, int, int rbits, QData lhs,
|
||||
// Above checks rwp[1]==0 so not needed in below shift
|
||||
return VL_CLEAN_QQ(obits, obits, lhs >> (static_cast<QData>(rwp[0])));
|
||||
}
|
||||
static inline IData VL_SHIFTR_IIQ(int obits, int, int, IData lhs, QData rhs) VL_MT_SAFE {
|
||||
static inline IData VL_SHIFTR_IIQ(int obits, int, int, IData lhs, QData rhs) VL_PURE {
|
||||
if (VL_UNLIKELY(rhs >= VL_IDATASIZE)) return 0;
|
||||
return VL_CLEAN_QQ(obits, obits, lhs >> rhs);
|
||||
}
|
||||
static inline QData VL_SHIFTR_QQQ(int obits, int, int, QData lhs, QData rhs) VL_MT_SAFE {
|
||||
static inline QData VL_SHIFTR_QQQ(int obits, int, int, QData lhs, QData rhs) VL_PURE {
|
||||
if (VL_UNLIKELY(rhs >= VL_QUADSIZE)) return 0;
|
||||
return VL_CLEAN_QQ(obits, obits, lhs >> rhs);
|
||||
}
|
||||
@@ -1803,7 +1824,7 @@ static inline WDataOutP VL_SHIFTRS_WWQ(int obits, int lbits, int rbits, WDataOut
|
||||
return VL_SHIFTRS_WWW(obits, lbits, rbits, owp, lwp, rwp);
|
||||
}
|
||||
static inline IData VL_SHIFTRS_IIW(int obits, int lbits, int rbits, IData lhs,
|
||||
WDataInP const rwp) VL_MT_SAFE {
|
||||
WDataInP const rwp) VL_PURE {
|
||||
EData overshift = 0; // Huge shift 1>>32 or more
|
||||
for (int i = 1; i < VL_WORDS_I(rbits); ++i) overshift |= rwp[i];
|
||||
if (VL_UNLIKELY(overshift || rwp[0] >= static_cast<IData>(obits))) {
|
||||
@@ -1813,7 +1834,7 @@ static inline IData VL_SHIFTRS_IIW(int obits, int lbits, int rbits, IData lhs,
|
||||
return VL_SHIFTRS_III(obits, lbits, 32, lhs, rwp[0]);
|
||||
}
|
||||
static inline QData VL_SHIFTRS_QQW(int obits, int lbits, int rbits, QData lhs,
|
||||
WDataInP const rwp) VL_MT_SAFE {
|
||||
WDataInP const rwp) VL_PURE {
|
||||
EData overshift = 0; // Huge shift 1>>32 or more
|
||||
for (int i = 1; i < VL_WORDS_I(rbits); ++i) overshift |= rwp[i];
|
||||
if (VL_UNLIKELY(overshift || rwp[0] >= static_cast<IData>(obits))) {
|
||||
@@ -1822,8 +1843,7 @@ static inline QData VL_SHIFTRS_QQW(int obits, int lbits, int rbits, QData lhs,
|
||||
}
|
||||
return VL_SHIFTRS_QQI(obits, lbits, 32, lhs, rwp[0]);
|
||||
}
|
||||
static inline IData VL_SHIFTRS_IIQ(int obits, int lbits, int rbits, IData lhs,
|
||||
QData rhs) VL_MT_SAFE {
|
||||
static inline IData VL_SHIFTRS_IIQ(int obits, int lbits, int rbits, IData lhs, QData rhs) VL_PURE {
|
||||
VlWide<VL_WQ_WORDS_E> rwp;
|
||||
VL_SET_WQ(rwp, rhs);
|
||||
return VL_SHIFTRS_IIW(obits, lbits, rbits, lhs, rwp);
|
||||
@@ -1985,17 +2005,17 @@ static inline void VL_ASSIGNSEL_QQ(int rbits, int obits, int lsb, QData& lhsr, Q
|
||||
}
|
||||
// static inline void VL_ASSIGNSEL_IIIW(int obits, int lsb, IData& lhsr, WDataInP const rwp)
|
||||
// VL_MT_SAFE { Illegal, as lhs width >= rhs width
|
||||
static inline void VL_ASSIGNSEL_WI(int rbits, int obits, int lsb, WDataOutP owp,
|
||||
static inline void VL_ASSIGNSEL_WI(int rbits, int obits, int lsb, WDataOutP iowp,
|
||||
IData rhs) VL_MT_SAFE {
|
||||
_vl_insert_WI(owp, rhs, lsb + obits - 1, lsb, rbits);
|
||||
_vl_insert_WI(iowp, rhs, lsb + obits - 1, lsb, rbits);
|
||||
}
|
||||
static inline void VL_ASSIGNSEL_WQ(int rbits, int obits, int lsb, WDataOutP owp,
|
||||
static inline void VL_ASSIGNSEL_WQ(int rbits, int obits, int lsb, WDataOutP iowp,
|
||||
QData rhs) VL_MT_SAFE {
|
||||
_vl_insert_WQ(owp, rhs, lsb + obits - 1, lsb, rbits);
|
||||
_vl_insert_WQ(iowp, rhs, lsb + obits - 1, lsb, rbits);
|
||||
}
|
||||
static inline void VL_ASSIGNSEL_WW(int rbits, int obits, int lsb, WDataOutP owp,
|
||||
static inline void VL_ASSIGNSEL_WW(int rbits, int obits, int lsb, WDataOutP iowp,
|
||||
WDataInP const rwp) VL_MT_SAFE {
|
||||
_vl_insert_WW(owp, rwp, lsb + obits - 1, lsb, rbits);
|
||||
_vl_insert_WW(iowp, rwp, lsb + obits - 1, lsb, rbits);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -2155,6 +2175,9 @@ inline IData VL_CMP_NN(const std::string& lhs, const std::string& rhs, bool igno
|
||||
}
|
||||
|
||||
extern IData VL_ATOI_N(const std::string& str, int base) VL_PURE;
|
||||
extern IData VL_NTOI_I(int obits, const std::string& str) VL_PURE;
|
||||
extern QData VL_NTOI_Q(int obits, const std::string& str) VL_PURE;
|
||||
extern void VL_NTOI_W(int obits, WDataOutP owp, const std::string& str) VL_PURE;
|
||||
|
||||
extern IData VL_FGETS_NI(std::string& dest, IData fpi) VL_MT_SAFE;
|
||||
|
||||
@@ -2172,7 +2195,8 @@ extern IData VL_DIST_UNIFORM(IData& seedr, IData ustart, IData uend) VL_MT_SAFE;
|
||||
//======================================================================
|
||||
// Conversion functions
|
||||
|
||||
extern std::string VL_CVT_PACK_STR_NW(int lwords, const WDataInP lwp) VL_MT_SAFE;
|
||||
extern std::string VL_CVT_PACK_STR_NW(int lwords, const WDataInP lwp) VL_PURE;
|
||||
extern std::string VL_CVT_PACK_STR_ND(const VlQueue<std::string>& q) VL_PURE;
|
||||
inline std::string VL_CVT_PACK_STR_NQ(QData lhs) VL_PURE {
|
||||
VlWide<VL_WQ_WORDS_E> lw;
|
||||
VL_SET_WQ(lw, lhs);
|
||||
@@ -2189,20 +2213,21 @@ inline std::string VL_CONCATN_NNN(const std::string& lhs, const std::string& rhs
|
||||
return lhs + rhs;
|
||||
}
|
||||
inline std::string VL_REPLICATEN_NNQ(const std::string& lhs, IData rep) VL_PURE {
|
||||
std::string out;
|
||||
out.reserve(lhs.length() * rep);
|
||||
for (unsigned times = 0; times < rep; ++times) out += lhs;
|
||||
return out;
|
||||
std::string result;
|
||||
result.reserve(lhs.length() * rep);
|
||||
for (unsigned times = 0; times < rep; ++times) result += lhs;
|
||||
return result;
|
||||
}
|
||||
inline std::string VL_REPLICATEN_NNI(const std::string& lhs, IData rep) VL_PURE {
|
||||
return VL_REPLICATEN_NNQ(lhs, rep);
|
||||
}
|
||||
|
||||
inline IData VL_LEN_IN(const std::string& ld) { return ld.length(); }
|
||||
inline IData VL_LEN_IN(const std::string& ld) { return static_cast<IData>(ld.length()); }
|
||||
extern std::string VL_TOLOWER_NN(const std::string& ld) VL_PURE;
|
||||
extern std::string VL_TOUPPER_NN(const std::string& ld) VL_PURE;
|
||||
|
||||
extern IData VL_FERROR_IN(IData fpi, std::string& outputr) VL_MT_SAFE;
|
||||
extern IData VL_FERROR_IW(IData fpi, int obits, WDataOutP outwp) VL_MT_SAFE;
|
||||
extern IData VL_FOPEN_NN(const std::string& filename, const std::string& mode) VL_MT_SAFE;
|
||||
extern IData VL_FOPEN_MCD_N(const std::string& filename) VL_MT_SAFE;
|
||||
extern void VL_READMEM_N(bool hex, int bits, QData depth, int array_lsb,
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
||||
//*************************************************************************
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2010-2022 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
//
|
||||
//*************************************************************************
|
||||
///
|
||||
/// \file
|
||||
/// \brief Verilated old string and data-type header
|
||||
///
|
||||
/// This file is deprecated, and provided for backwards compatibility.
|
||||
/// Include verilated.h instead.
|
||||
///
|
||||
//*************************************************************************
|
||||
|
||||
#ifndef VERILATOR_VERILATED_HEAVY_H_
|
||||
#define VERILATOR_VERILATED_HEAVY_H_
|
||||
|
||||
#ifdef VL_NO_LEGACY
|
||||
#error "Include <verilated.h> instead of <verilated_heavy.h>"
|
||||
#endif
|
||||
|
||||
#include "verilated.h"
|
||||
|
||||
#endif // Guard
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2009-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2009-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
private:
|
||||
VL_UNCOPYABLE(VerilatedThreadMsgQueue);
|
||||
// METHODS
|
||||
static VerilatedThreadMsgQueue& threadton() {
|
||||
static VerilatedThreadMsgQueue& threadton() VL_MT_SAFE {
|
||||
static thread_local VerilatedThreadMsgQueue t_s;
|
||||
return t_s;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2003-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2012-2022 by Wilson Snyder. This program is free software; you can
|
||||
// Copyright 2012-2023 by Wilson Snyder. This program is free software; you can
|
||||
// redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2012-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2012-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Code available from: https://verilator.org
|
||||
//
|
||||
// Copyright 2001-2022 by Wilson Snyder. This program is free software; you
|
||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
||||
// can redistribute it and/or modify it under the terms of either the GNU
|
||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||
// Version 2.0.
|
||||
@@ -60,7 +60,7 @@ static const char* const VLTSAVE_TRAILER_STR = "vltsaved";
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Searalization
|
||||
// Serialization
|
||||
|
||||
bool VerilatedDeserialize::readDiffers(const void* __restrict datap,
|
||||
size_t size) VL_MT_UNSAFE_ONE {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user