mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
522bead374 | ||
|
|
030286142f | ||
|
|
8a4ceb5717 | ||
|
|
63fa6accc4 | ||
|
|
28718f964a | ||
|
|
1d486e3a59 | ||
|
|
9b396f7125 | ||
|
|
e16cbce52e | ||
|
|
840970e8f7 | ||
|
|
e390d6779d | ||
|
|
39ee522f92 | ||
|
|
9526efcf72 | ||
|
|
d397e0d838 | ||
|
|
8301fdc6d3 | ||
|
|
f645382f11 | ||
|
|
1ed5557d2d | ||
|
|
28b9216f8a | ||
|
|
0114cb67ca | ||
|
|
ea8f86dd30 | ||
|
|
0ff77fc352 | ||
|
|
341963e820 | ||
|
|
db60b92613 | ||
|
|
98206a4f04 | ||
|
|
4df9e2e0e5 | ||
|
|
34e4cffb62 | ||
|
|
71d76c993c | ||
|
|
e67bdb4c08 | ||
|
|
23f013f2d7 | ||
|
|
9b729b80e0 | ||
|
|
38ad328956 | ||
|
|
f767f0cfaa | ||
|
|
1c79df8630 | ||
|
|
248573205b | ||
|
|
88831ca21b | ||
|
|
26f15e11c4 | ||
|
|
5c0a7e06dc | ||
|
|
290b313dc0 | ||
|
|
93e5ca3f6d | ||
|
|
6ffff8565f | ||
|
|
494e05b326 | ||
|
|
a24f61403a | ||
|
|
292cc54768 | ||
|
|
e8a9662eb5 | ||
|
|
0262819c20 | ||
|
|
d3b93a1113 | ||
|
|
5f8c06c805 | ||
|
|
a5ad26cd28 | ||
|
|
5802818b9a | ||
|
|
df519ff16e | ||
|
|
bf8a88a0ad | ||
|
|
878204db73 | ||
|
|
08c76b1da6 | ||
|
|
e82c9db6da | ||
|
|
65c3cb4708 | ||
|
|
0cab076b86 | ||
|
|
3a28ed24ea | ||
|
|
71775eae4c | ||
|
|
953249aa43 | ||
|
|
229dbbb100 | ||
|
|
4a439beae5 | ||
|
|
49022c3e73 | ||
|
|
c92ced4ac7 | ||
|
|
ba47da6587 | ||
|
|
2c27f22900 | ||
|
|
c0391990ad | ||
|
|
2247e1e345 | ||
|
|
e4847464d4 | ||
|
|
7694a7bf41 | ||
|
|
a686e547cf | ||
|
|
1481d34959 | ||
|
|
04512e5d04 | ||
|
|
9a3aed57b1 | ||
|
|
5a69321be3 | ||
|
|
5ee938fd1c | ||
|
|
f78783e187 | ||
|
|
11bfe7a7bb | ||
|
|
8ba494c71f | ||
|
|
acb63c929b | ||
|
|
26dd5d4550 | ||
|
|
32f288084a | ||
|
|
6db149c588 | ||
|
|
0fed5f8b3e | ||
|
|
a30930bdcc | ||
|
|
3a1355fb54 | ||
|
|
97db128d66 | ||
|
|
3d57256070 | ||
|
|
5dc8fb5b4f | ||
|
|
3f0d434f82 | ||
|
|
2cdc5ea48b | ||
|
|
745605efe3 | ||
|
|
0fbd4313b2 | ||
|
|
9f8f61ef2f | ||
|
|
4b1f4938b8 | ||
|
|
5f1dc73a1b | ||
|
|
5e1fc6e24d | ||
|
|
0ec32ee404 | ||
|
|
97b21b3849 | ||
|
|
214173c6b8 | ||
|
|
3786f59e03 | ||
|
|
fa7234ff68 | ||
|
|
91dd3c5fac | ||
|
|
a378dbd9b2 | ||
|
|
da9521a351 | ||
|
|
af51107587 | ||
|
|
e60f652a64 | ||
|
|
a4813ec677 | ||
|
|
01dadb0a8d | ||
|
|
9dcb7ea6a9 | ||
|
|
adfe072b89 | ||
|
|
b12f8b3d73 | ||
|
|
f56f318217 | ||
|
|
3af0eb7fa0 | ||
|
|
a69cb9b044 | ||
|
|
b68a696859 | ||
|
|
e320b0b581 | ||
|
|
42041f2403 | ||
|
|
881c6ee655 | ||
|
|
d8b2993974 | ||
|
|
30e711aa5c | ||
|
|
51ae8e13fb | ||
|
|
0892b39ad2 | ||
|
|
5964d5cf63 | ||
|
|
2162a31d3a | ||
|
|
e00e4d4245 | ||
|
|
4b9532fe24 | ||
|
|
c3ff52208a | ||
|
|
cfb73923bd | ||
|
|
a951446f9b | ||
|
|
a187a16e56 | ||
|
|
d1dec38f38 | ||
|
|
65b632a7dd | ||
|
|
ec0787015e | ||
|
|
cbc76a7816 | ||
|
|
d667b73e8d | ||
|
|
248de2be2e | ||
|
|
365537d8e3 | ||
|
|
a23cf1ceea | ||
|
|
be471e9ccc | ||
|
|
d0e7eaafc9 | ||
|
|
13b7cce8be | ||
|
|
efff630763 | ||
|
|
e2e0795538 | ||
|
|
c20634e4f8 | ||
|
|
715dce546f | ||
|
|
07d86bf91d | ||
|
|
fe8c7c5a94 | ||
|
|
7ada5195d8 | ||
|
|
a6ad85244f | ||
|
|
f13f2296de | ||
|
|
b1d901f100 | ||
|
|
8ab576f7e6 | ||
|
|
6f92c9c974 | ||
|
|
7425037db6 | ||
|
|
6ca60429ce | ||
|
|
c702fc944e | ||
|
|
999c9ae21c | ||
|
|
c715cfc254 | ||
|
|
22687a6901 | ||
|
|
eecdf4b0f3 | ||
|
|
e3e5f30ba1 | ||
|
|
ce174743bb | ||
|
|
a84be1844f | ||
|
|
9ccef4180f | ||
|
|
3bf896f7db | ||
|
|
e4a0e5aad6 | ||
|
|
d6f8ccd20b | ||
|
|
94460867d3 | ||
|
|
5b70325e52 | ||
|
|
3aece189ac | ||
|
|
188f0eb4ad | ||
|
|
d4c8a15407 | ||
|
|
354a534d68 | ||
|
|
c8a40e0b52 | ||
|
|
771cb5f60b | ||
|
|
23836ee8d0 | ||
|
|
8a7f36c34b | ||
|
|
31262e81f9 | ||
|
|
3d006afacc | ||
|
|
74ec50f933 | ||
|
|
21e85f87bc | ||
|
|
0b8daf4ae4 | ||
|
|
6c0c88cfc4 | ||
|
|
f0d010d9c5 | ||
|
|
2989e54eaa | ||
|
|
1a2c9ca813 | ||
|
|
e3f3e3399f | ||
|
|
6b8531f0a6 | ||
|
|
50df902b54 | ||
|
|
3a5248a919 | ||
|
|
1a92502788 | ||
|
|
a38fea1f9e | ||
|
|
d595d4c7ac | ||
|
|
a43fd06f85 | ||
|
|
375a121377 | ||
|
|
fef0502d50 | ||
|
|
c30b9d04a8 | ||
|
|
89cfa0737f | ||
|
|
8b03f2d47b | ||
|
|
f80c167d65 | ||
|
|
db3ce29b36 | ||
|
|
6f96c6763d | ||
|
|
372cdf1fc8 | ||
|
|
54922c036a | ||
|
|
2e999a5441 | ||
|
|
5073f208af | ||
|
|
c9d7486d16 | ||
|
|
27d906a6b3 | ||
|
|
21bf2d62d2 | ||
|
|
fcdd8e5da6 | ||
|
|
ab47fc6656 | ||
|
|
5f52c066e5 | ||
|
|
19cb366e5d | ||
|
|
55d1b87b34 | ||
|
|
eec41fd039 | ||
|
|
69043549d6 | ||
|
|
68e4eeb53e | ||
|
|
0ca90257a5 | ||
|
|
7507c5f56c | ||
|
|
acbbb2594a | ||
|
|
5294140753 | ||
|
|
a36a07c297 | ||
|
|
47b129bf07 | ||
|
|
1a0c8f1573 | ||
|
|
2be6f03848 | ||
|
|
4172c0f29e | ||
|
|
ec01008fe3 | ||
|
|
8ea814e4b4 | ||
|
|
0195fe9dfd | ||
|
|
e430ea13f4 | ||
|
|
719954a24a | ||
|
|
3adb31f53b | ||
|
|
3eaed3b6f5 | ||
|
|
22de598456 | ||
|
|
5c5314b39c | ||
|
|
e76f29e5ba | ||
|
|
5a83209b9b | ||
|
|
4655ee014b | ||
|
|
12f0017d4a | ||
|
|
ca3b5fbe99 | ||
|
|
9de6612cde | ||
|
|
2d7e8b58e4 | ||
|
|
f3a97841bd | ||
|
|
40f0378136 | ||
|
|
17b6ce1379 | ||
|
|
14ac24cacc | ||
|
|
6bf253deda | ||
|
|
aa4346a0e3 | ||
|
|
8c541a6e4d | ||
|
|
1a43afe6f7 | ||
|
|
9882c4c761 | ||
|
|
54ad04b6e9 | ||
|
|
540cd772e4 | ||
|
|
621de301c7 | ||
|
|
8769c1a92b | ||
|
|
8e1c0b0852 | ||
|
|
56d6791205 | ||
|
|
016e630ecf | ||
|
|
69b779b4a8 | ||
|
|
7a537765bc | ||
|
|
21b2e874ce | ||
|
|
55ad950609 | ||
|
|
654ab117f2 | ||
|
|
5ec9bfc47d | ||
|
|
1066f06ec1 | ||
|
|
668dbb25ab | ||
|
|
fced4d6e57 | ||
|
|
c5ba6e22fa | ||
|
|
6012ec8eb7 | ||
|
|
75a44e5aa9 | ||
|
|
a811f2e17d | ||
|
|
b65f2509a2 | ||
|
|
b60117c713 | ||
|
|
d3142736c8 | ||
|
|
1ececf1127 | ||
|
|
a09f7713ce | ||
|
|
f3bace10ae | ||
|
|
39d9bd4d47 | ||
|
|
eb2cfe1d19 | ||
|
|
ca5a7d7656 | ||
|
|
ea2084392f | ||
|
|
5d99534d54 | ||
|
|
f048cff093 | ||
|
|
f571181d36 | ||
|
|
fc9b66b078 | ||
|
|
f039a94744 | ||
|
|
b4baa7ce02 | ||
|
|
bd38c8fe3c | ||
|
|
9a0748d8ed | ||
|
|
feae9ca4aa | ||
|
|
d1ee9827a0 | ||
|
|
1fe591ae20 | ||
|
|
b820e1b587 | ||
|
|
ebfc2a4942 | ||
|
|
7167d4bdc0 | ||
|
|
a022b672a0 | ||
|
|
a7a48221d3 | ||
|
|
e5118661a7 | ||
|
|
58d9a5ebac | ||
|
|
fae7f11222 | ||
|
|
1986e62477 | ||
|
|
0ee2a0e6d7 | ||
|
|
2b28ddd0c6 | ||
|
|
b15ef49c57 | ||
|
|
ed05caec93 | ||
|
|
25ca965938 | ||
|
|
ead27db9f0 | ||
|
|
4650105d90 | ||
|
|
b8417abee5 | ||
|
|
cc982ec7fe | ||
|
|
2dba76a7c2 | ||
|
|
9fd5634778 | ||
|
|
c8063e5732 | ||
|
|
ee3ba7c761 | ||
|
|
2882737bcd | ||
|
|
47588f343b | ||
|
|
1c0af6c7bc | ||
|
|
b07ffb3c78 | ||
|
|
bea82def10 | ||
|
|
671a857560 | ||
|
|
eff2d977c1 | ||
|
|
30a0d62436 | ||
|
|
91d0f25442 | ||
|
|
4a10c9ef6f | ||
|
|
9d7f5bdc26 | ||
|
|
99dbd23f1b | ||
|
|
673f086e87 | ||
|
|
4103925835 | ||
|
|
cad2780219 | ||
|
|
4636a7f14b | ||
|
|
a64bdf50fb | ||
|
|
706534ffe1 | ||
|
|
4286af3599 | ||
|
|
9a0254a118 | ||
|
|
f3ae4b8786 | ||
|
|
6566e853cd | ||
|
|
ab06ace1f6 | ||
|
|
9a65ed4ce2 | ||
|
|
5ba7084815 | ||
|
|
dc10118d3b | ||
|
|
27102ea0fb | ||
|
|
c563175ff0 | ||
|
|
b110c55993 | ||
|
|
dc346b7ffa | ||
|
|
88fcbf5f1d | ||
|
|
eace1d9c67 | ||
|
|
d0d39c13e7 | ||
|
|
2733d43ea7 | ||
|
|
ae6ec411d0 | ||
|
|
8a77af7a6d | ||
|
|
2a57ead7e3 | ||
|
|
839315b271 | ||
|
|
67dfa37c56 | ||
|
|
590188820d | ||
|
|
a764c70b4a | ||
|
|
a27abab65f | ||
|
|
c241ec90ec | ||
|
|
f789d28277 | ||
|
|
c1c8b30a35 | ||
|
|
15046c6c59 | ||
|
|
1da15181da | ||
|
|
3c6b755352 | ||
|
|
3c144ada53 | ||
|
|
7ba6647c4f | ||
|
|
e708670f9a | ||
|
|
de4c6065dc | ||
|
|
d60f180f43 | ||
|
|
30318a6654 | ||
|
|
d8420413b7 | ||
|
|
a5951babfc | ||
|
|
2cba167634 | ||
|
|
89743aae5d | ||
|
|
e6135981a5 | ||
|
|
739521333c | ||
|
|
64af83161a | ||
|
|
98252634fc | ||
|
|
a87fb57656 | ||
|
|
34708bbba1 | ||
|
|
f91259f46d | ||
|
|
cf6e362972 | ||
|
|
95c4ade718 | ||
|
|
84125d7c92 | ||
|
|
17721aff55 | ||
|
|
d1b6224c2b | ||
|
|
1bd31742b9 | ||
|
|
165a2ef1b8 | ||
|
|
774c10396c | ||
|
|
33c5b5feb8 | ||
|
|
b83b9974ee | ||
|
|
bcbe5059a9 | ||
|
|
5bda901146 | ||
|
|
82565690c7 | ||
|
|
978d900e36 | ||
|
|
d330100542 | ||
|
|
4c0edd2efb | ||
|
|
146cdc020d | ||
|
|
52f2b9ef58 | ||
|
|
a09506a0ad | ||
|
|
10d33238b9 | ||
|
|
b78ea06829 | ||
|
|
eae942b91c | ||
|
|
1075b006b5 | ||
|
|
afaa02709c | ||
|
|
332a687aef | ||
|
|
d1c7875406 | ||
|
|
cbc2f9eb32 | ||
|
|
26e3785963 | ||
|
|
f8b7fb72b8 | ||
|
|
7b12f6a1dd | ||
|
|
c7a0613c57 | ||
|
|
83a0085c4d | ||
|
|
05bb7fa821 | ||
|
|
4cc42133b5 | ||
|
|
a773a52559 | ||
|
|
5af271cf3a | ||
|
|
0c2bab1f69 | ||
|
|
b7233d063f | ||
|
|
8720841c48 | ||
|
|
263697e491 | ||
|
|
493f1da266 | ||
|
|
8b44a54bb2 | ||
|
|
b5828a7ce9 | ||
|
|
51a18225ad | ||
|
|
28625451dd | ||
|
|
3914176bc4 | ||
|
|
13989b965d | ||
|
|
770cd24f27 | ||
|
|
431bb1ed16 | ||
|
|
3bb9c7ee92 | ||
|
|
45edcbb03e | ||
|
|
e99fd2892b | ||
|
|
99ea16d7fd | ||
|
|
bc9ff6d1bf | ||
|
|
ad3bcbb1bb | ||
|
|
25dde58297 | ||
|
|
bba3487dc4 | ||
|
|
4fdaa46328 | ||
|
|
4427f03b08 | ||
|
|
4e2c63c8cb | ||
|
|
afecde87d8 | ||
|
|
c14eae6d56 | ||
|
|
684aba0e90 | ||
|
|
46f8a659b3 | ||
|
|
3940a214d0 | ||
|
|
411f563cbe | ||
|
|
b5a6b34968 | ||
|
|
fa8eaf7355 | ||
|
|
7eb09c3445 | ||
|
|
edfd3d7206 | ||
|
|
d699caf255 | ||
|
|
bd4eede6b4 | ||
|
|
1fd8e772b0 | ||
|
|
7ce0bd1181 | ||
|
|
a4b7c39a9a | ||
|
|
a5ee8b39ef | ||
|
|
5b06c60318 | ||
|
|
b306715b4a | ||
|
|
8d99bdac25 | ||
|
|
e114dfda6d | ||
|
|
472ad90d83 | ||
|
|
622f0c047c | ||
|
|
7f38414276 | ||
|
|
1d3d59243c | ||
|
|
e2343c03e0 | ||
|
|
0e0df1fb3b | ||
|
|
800a789f50 | ||
|
|
106664b942 | ||
|
|
1c738c6b83 | ||
|
|
25fa1d7c6a | ||
|
|
45162652de | ||
|
|
537650a2cd | ||
|
|
f849073137 | ||
|
|
a3c154dcd3 | ||
|
|
1b8228b642 | ||
|
|
732d03f4e5 | ||
|
|
33787c6add | ||
|
|
44e7d2ebe6 | ||
|
|
e49ae663a6 | ||
|
|
2385ab8294 | ||
|
|
84ccb23098 | ||
|
|
ad343f8260 | ||
|
|
018d766179 | ||
|
|
a948be184c | ||
|
|
72b4a74245 | ||
|
|
36c824d973 | ||
|
|
229ce1aecf | ||
|
|
be45a9b7d5 | ||
|
|
d2c72a7f21 | ||
|
|
60e9827ffe | ||
|
|
a9256d4758 | ||
|
|
750b5be5d3 | ||
|
|
28bd7e5b19 | ||
|
|
d64c023099 | ||
|
|
429cb1f7f7 | ||
|
|
9f75068059 | ||
|
|
4636e9cffb | ||
|
|
4b2bf556d8 | ||
|
|
a16ea94836 | ||
|
|
b9ea249f81 | ||
|
|
470f480bc1 | ||
|
|
24ff3155ae | ||
|
|
47b3f464a9 | ||
|
|
cd201f8eb8 | ||
|
|
016278a759 | ||
|
|
b68f101e81 | ||
|
|
ab13548018 | ||
|
|
f507ee56b0 | ||
|
|
761adf1cf0 | ||
|
|
cd1fe64e6c | ||
|
|
8f43e74288 | ||
|
|
cef3960a4e | ||
|
|
783b7ecdab | ||
|
|
8bd1c63b32 | ||
|
|
e6fb7e970d | ||
|
|
891cc0f9b6 | ||
|
|
10fbe74cef | ||
|
|
05d04a3959 | ||
|
|
19f7279542 | ||
|
|
aa608472ae | ||
|
|
26ed2a06a0 | ||
|
|
07013da13d | ||
|
|
d840c612d4 | ||
|
|
188cf85b3f | ||
|
|
c52ba28dd0 | ||
|
|
10c1653e72 | ||
|
|
2fbd41e13b | ||
|
|
96857c5f95 | ||
|
|
131eb319e0 | ||
|
|
6e589377f4 | ||
|
|
2c84b37bf7 | ||
|
|
0d67caff77 | ||
|
|
3dde57d539 | ||
|
|
ec2e3ec0e4 | ||
|
|
9fe459c820 | ||
|
|
823e0723fb | ||
|
|
8bd6d7c5b1 | ||
|
|
839a8fa4d9 | ||
|
|
24917a187a | ||
|
|
6c6f03cf7c | ||
|
|
5676443139 | ||
|
|
e77d847671 | ||
|
|
0baee84e96 | ||
|
|
c446cc2596 | ||
|
|
b66c4153b1 | ||
|
|
d72f1b89fc | ||
|
|
b5b278d072 | ||
|
|
cb5466a90b | ||
|
|
4de25369da | ||
|
|
cdd8953085 | ||
|
|
2f2f0164ff | ||
|
|
6e977e1024 | ||
|
|
70b11f91b4 | ||
|
|
014301587f | ||
|
|
139e93d371 | ||
|
|
fb1fc46b06 | ||
|
|
9882ab6c67 | ||
|
|
1a1f919882 | ||
|
|
91227d26bb | ||
|
|
11b5dae88d | ||
|
|
0c7d485417 | ||
|
|
c40e34b134 | ||
|
|
6cdf8da3f7 | ||
|
|
c65265477f | ||
|
|
de77f1ee5c | ||
|
|
c8c980c49d | ||
|
|
ad329612fd | ||
|
|
c324895cbc | ||
|
|
679a4314dc | ||
|
|
36932d31c4 | ||
|
|
ed25aaaad9 | ||
|
|
147aa41ba5 | ||
|
|
5b7e32581b | ||
|
|
2f90fb2bec | ||
|
|
8c480fd39e | ||
|
|
ffbbd438ae | ||
|
|
96ee81fa3f | ||
|
|
3d2399ea0f | ||
|
|
6d5dde8645 | ||
|
|
048c9f3fe2 | ||
|
|
373265752f | ||
|
|
5e6519c1b0 | ||
|
|
ccdb52c1d9 | ||
|
|
b4b74d72f0 | ||
|
|
ca6ab584d0 | ||
|
|
799a502cac | ||
|
|
8d1570db28 | ||
|
|
2a30bbe493 | ||
|
|
cf6566b9bc | ||
|
|
c3e19f2821 | ||
|
|
e24197fd16 | ||
|
|
63db60f646 | ||
|
|
e66b28823d | ||
|
|
77bd565ef6 | ||
|
|
00d63883f8 | ||
|
|
10dd675371 | ||
|
|
2daa32b98b | ||
|
|
e8e7912871 | ||
|
|
90079c2974 | ||
|
|
967a8530dd | ||
|
|
ef4794e36d | ||
|
|
7c7c92d2dd | ||
|
|
95f3dd0535 | ||
|
|
768b78e7d0 | ||
|
|
4370254e73 | ||
|
|
436f72582b | ||
|
|
af3aba7821 | ||
|
|
7479db6ffc | ||
|
|
e9cc2786b7 | ||
|
|
cbdee5a804 | ||
|
|
0f66262fa1 | ||
|
|
6c80457262 | ||
|
|
16008acdf1 | ||
|
|
5447ed2629 | ||
|
|
9eba61018a | ||
|
|
bc97319402 | ||
|
|
709db5c648 | ||
|
|
b752faa107 | ||
|
|
8d512c3187 | ||
|
|
2d9bc73709 | ||
|
|
b0942ed8c7 | ||
|
|
b1c1aa53a9 |
@@ -63,6 +63,8 @@ ForEachMacros:
|
|||||||
SortIncludes: true
|
SortIncludes: true
|
||||||
IncludeBlocks: Regroup
|
IncludeBlocks: Regroup
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
|
- Regex: '"V3Pch.*\.h"'
|
||||||
|
Priority: -2 # Precompiled headers
|
||||||
- Regex: '"(config_build|verilated_config|verilatedos)\.h"'
|
- Regex: '"(config_build|verilated_config|verilatedos)\.h"'
|
||||||
Priority: -1 # Sepecials before main header
|
Priority: -1 # Sepecials before main header
|
||||||
- Regex: '(<|")verilated.*'
|
- Regex: '(<|")verilated.*'
|
||||||
@@ -112,6 +114,9 @@ SpacesBeforeTrailingComments: 2
|
|||||||
SpacesInAngles: false
|
SpacesInAngles: false
|
||||||
SpacesInContainerLiterals: true
|
SpacesInContainerLiterals: true
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInLineCommentPrefix:
|
||||||
|
Minimum: 0
|
||||||
|
Maximum: -1
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
Standard: Cpp11
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "Verilator Build Environment",
|
||||||
|
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "../ci/docker/buildenv/Dockerfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,6 +11,8 @@ Thanks for taking the time to report this.
|
|||||||
|
|
||||||
Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)
|
Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)
|
||||||
|
|
||||||
|
What 'verilator' command line do we use to run your example?
|
||||||
|
|
||||||
What 'verilator --version' are you using? Did you try it with the git master version?
|
What 'verilator --version' are you using? Did you try it with the git master version?
|
||||||
|
|
||||||
What OS and distribution are you using?
|
What OS and distribution are you using?
|
||||||
|
|||||||
+63
-46
@@ -17,12 +17,18 @@ env:
|
|||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
|
INSTALL_DIR: ${{ github.workspace }}/install
|
||||||
|
RELOC_DIR: ${{ github.workspace }}/relloc
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: repo
|
working-directory: repo
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -33,42 +39,29 @@ jobs:
|
|||||||
compiler:
|
compiler:
|
||||||
- { cc: clang, cxx: clang++ }
|
- { cc: clang, cxx: clang++ }
|
||||||
- { cc: gcc, cxx: g++ }
|
- { 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 clang++
|
|
||||||
- {os: ubuntu-18.04, m32: 1}
|
|
||||||
- {os: ubuntu-20.04, m32: 1}
|
|
||||||
- compiler: { cc: gcc, cxx: g++ }
|
|
||||||
m32: 1
|
|
||||||
include:
|
include:
|
||||||
# Build GCC 10 on ubuntu-20.04
|
# Build GCC 10 on ubuntu-20.04
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
compiler: { cc: gcc-10, cxx: g++-10 }
|
compiler: { cc: gcc-10, cxx: g++-10 }
|
||||||
m32: 0
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }} ${{ matrix.m32 && '| -m32' || '' }}
|
name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }}
|
||||||
env:
|
env:
|
||||||
CI_BUILD_STAGE_NAME: build
|
CI_BUILD_STAGE_NAME: build
|
||||||
CI_RUNS_ON: ${{ matrix.os }}
|
CI_RUNS_ON: ${{ matrix.os }}
|
||||||
CI_M32: ${{ matrix.m32 }}
|
|
||||||
CC: ${{ matrix.compiler.cc }}
|
CC: ${{ matrix.compiler.cc }}
|
||||||
CXX: ${{ matrix.compiler.cxx }}
|
CXX: ${{ matrix.compiler.cxx }}
|
||||||
CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}
|
CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}
|
||||||
CCACHE_MAXSIZE: 250M # Per build matrix entry (2000M in total)
|
CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total)
|
||||||
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
|
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: repo
|
path: repo
|
||||||
|
|
||||||
- name: Cache $CCACHE_DIR
|
- name: Cache $CCACHE_DIR
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
env:
|
env:
|
||||||
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
|
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
|
||||||
with:
|
with:
|
||||||
@@ -88,7 +81,7 @@ jobs:
|
|||||||
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
|
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
|
||||||
|
|
||||||
- name: Upload tar archive
|
- name: Upload tar archive
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
|
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
|
||||||
name: ${{ env.VERILATOR_ARCHIVE }}
|
name: ${{ env.VERILATOR_ARCHIVE }}
|
||||||
@@ -103,40 +96,38 @@ jobs:
|
|||||||
compiler:
|
compiler:
|
||||||
- { cc: clang, cxx: clang++ }
|
- { cc: clang, cxx: clang++ }
|
||||||
- { cc: gcc, cxx: g++ }
|
- { cc: gcc, cxx: g++ }
|
||||||
m32: [0, 1]
|
reloc: [0]
|
||||||
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, vltmt-0, vltmt-1]
|
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, 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' }}
|
|
||||||
# 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:
|
include:
|
||||||
# Test with GCC 10 on ubuntu-20.04 without m32
|
# Test with GCC 10 on ubuntu-20.04
|
||||||
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-0}
|
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, suite: dist-vlt-0}
|
||||||
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-1}
|
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, suite: dist-vlt-1}
|
||||||
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-2}
|
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, suite: dist-vlt-2}
|
||||||
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: vltmt-0}
|
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, suite: dist-vlt-3}
|
||||||
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: vltmt-1}
|
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, suite: vltmt-0}
|
||||||
|
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, suite: vltmt-1}
|
||||||
|
# Test relocated installation - on most common platform only
|
||||||
|
- {os: ubuntu-22.04, compiler: { cc: gcc, cxx: g++ }, reloc: 1, suite: dist-vlt-0}
|
||||||
|
- {os: ubuntu-22.04, compiler: { cc: gcc, cxx: g++ }, reloc: 1, suite: dist-vlt-1}
|
||||||
|
- {os: ubuntu-22.04, compiler: { cc: gcc, cxx: g++ }, reloc: 1, suite: dist-vlt-2}
|
||||||
|
- {os: ubuntu-22.04, compiler: { cc: gcc, cxx: g++ }, reloc: 1, suite: dist-vlt-3}
|
||||||
|
- {os: ubuntu-22.04, compiler: { cc: gcc, cxx: g++ }, reloc: 1, suite: vltmt-0}
|
||||||
|
- {os: ubuntu-22.04, compiler: { cc: gcc, cxx: g++ }, reloc: 1, suite: vltmt-1}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.suite }} ${{ matrix.m32 && '| -m32' || '' }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
||||||
env:
|
env:
|
||||||
CI_BUILD_STAGE_NAME: test
|
CI_BUILD_STAGE_NAME: test
|
||||||
CI_RUNS_ON: ${{ matrix.os }}
|
CI_RUNS_ON: ${{ matrix.os }}
|
||||||
CI_M32: ${{ matrix.m32 }}
|
CI_RELOC: ${{ matrix.reloc }}
|
||||||
CC: ${{ matrix.compiler.cc }}
|
CC: ${{ matrix.compiler.cc }}
|
||||||
CXX: ${{ matrix.compiler.cxx }}
|
CXX: ${{ matrix.compiler.cxx }}
|
||||||
CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}-${{ matrix.suite }}
|
CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.reloc }}-${{ matrix.suite }}
|
||||||
CCACHE_MAXSIZE: 64M # Per build matrix entry (2160M in total)
|
CCACHE_MAXSIZE: 100M # Per build per suite (* 5 * 5 = 2500M in total)
|
||||||
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
|
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Download tar archive
|
- name: Download tar archive
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VERILATOR_ARCHIVE }}
|
name: ${{ env.VERILATOR_ARCHIVE }}
|
||||||
path: ${{ github.workspace }}
|
path: ${{ github.workspace }}
|
||||||
@@ -146,9 +137,9 @@ jobs:
|
|||||||
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
|
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
|
||||||
|
|
||||||
- name: Cache $CCACHE_DIR
|
- name: Cache $CCACHE_DIR
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
env:
|
env:
|
||||||
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
|
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache2
|
||||||
with:
|
with:
|
||||||
path: ${{ env.CCACHE_DIR }}
|
path: ${{ env.CCACHE_DIR }}
|
||||||
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
|
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
|
||||||
@@ -162,3 +153,29 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TESTS: ${{ matrix.suite }}
|
TESTS: ${{ matrix.suite }}
|
||||||
run: ./ci/ci-script.bash
|
run: ./ci/ci-script.bash
|
||||||
|
|
||||||
|
lint-py:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
name: Lint Python
|
||||||
|
env:
|
||||||
|
CI_BUILD_STAGE_NAME: build
|
||||||
|
CI_RUNS_ON: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: repo
|
||||||
|
|
||||||
|
- name: Install packages for build
|
||||||
|
run: ./ci/ci-install.bash
|
||||||
|
|
||||||
|
# We use specific version numbers, otherwise a Python package
|
||||||
|
# update may add a warning and break our build
|
||||||
|
- name: Install packages for lint
|
||||||
|
run: sudo pip3 install pylint==3.0.2 ruff==0.1.3 clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: autoconf && ./configure --enable-longtests --enable-ccwarn
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: make -k lint-py
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ jobs:
|
|||||||
name: "'docs/CONTRIBUTORS' was signed"
|
name: "'docs/CONTRIBUTORS' was signed"
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- run: test_regress/t/t_dist_contributors.pl
|
- run: test_regress/t/t_dist_contributors.pl
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ on:
|
|||||||
env:
|
env:
|
||||||
CI_OS_NAME: linux
|
CI_OS_NAME: linux
|
||||||
CI_COMMIT: ${{ github.sha }}
|
CI_COMMIT: ${{ github.sha }}
|
||||||
CI_M32: 0
|
|
||||||
COVERAGE: 1
|
COVERAGE: 1
|
||||||
VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz
|
VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: repo
|
path: repo
|
||||||
|
|
||||||
@@ -46,7 +45,7 @@ jobs:
|
|||||||
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
|
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
|
||||||
|
|
||||||
- name: Upload tar archive
|
- name: Upload tar archive
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
|
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
|
||||||
name: ${{ env.VERILATOR_ARCHIVE }}
|
name: ${{ env.VERILATOR_ARCHIVE }}
|
||||||
@@ -81,7 +80,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Download tar archive
|
- name: Download tar archive
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VERILATOR_ARCHIVE }}
|
name: ${{ env.VERILATOR_ARCHIVE }}
|
||||||
path: ${{ github.workspace }}
|
path: ${{ github.workspace }}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Build and push verilator docker image when tags are pushed to the repository.
|
# Build and push verilator docker image when tags are pushed to the repository.
|
||||||
# The following secrets must be configured in the github repository:
|
# The following variable(s) must be configured in the github repository:
|
||||||
# DOCKER_HUB_NAMESPACE: docker hub namespace.
|
# DOCKER_HUB_NAMESPACE: docker hub namespace.
|
||||||
|
# The following secrets must be configured in the github repository:
|
||||||
# DOCKER_HUB_USER: user name for logging into docker hub
|
# DOCKER_HUB_USER: user name for logging into docker hub
|
||||||
# DOCKER_HUB_ACCESS_TOKEN: docker hub access token.
|
# DOCKER_HUB_ACCESS_TOKEN: docker hub access token.
|
||||||
name: Build Verilator Container
|
name: Build Verilator Container
|
||||||
@@ -34,7 +35,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract context variables
|
- name: Extract context variables
|
||||||
run: |
|
run: |
|
||||||
@@ -52,7 +53,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }}
|
${{ vars.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }}
|
||||||
tags: |
|
tags: |
|
||||||
type=match,pattern=(v.*),group=1,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
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=${{ inputs.manual_tag }},enable=${{ inputs.manual_tag != '' }}
|
||||||
|
|||||||
@@ -16,10 +16,9 @@ jobs:
|
|||||||
CI_OS_NAME: linux
|
CI_OS_NAME: linux
|
||||||
CI_RUNS_ON: ubuntu-22.04
|
CI_RUNS_ON: ubuntu-22.04
|
||||||
CI_COMMIT: ${{ github.sha }}
|
CI_COMMIT: ${{ github.sha }}
|
||||||
CI_M32: 0
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Install packages for build
|
- name: Install packages for build
|
||||||
|
|||||||
@@ -22,17 +22,21 @@ defaults:
|
|||||||
run:
|
run:
|
||||||
working-directory: repo
|
working-directory: repo
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
name: run on windows
|
name: run on windows
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: repo
|
path: repo
|
||||||
- name: Cache $CCACHE_DIR
|
- name: Cache $CCACHE_DIR
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.CCACHE_DIR }}
|
path: ${{ env.CCACHE_DIR }}
|
||||||
key: msbuild-msvc-cmake
|
key: msbuild-msvc-cmake
|
||||||
@@ -45,7 +49,7 @@ jobs:
|
|||||||
- name: Zip up repository
|
- name: Zip up repository
|
||||||
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
|
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
|
||||||
- name: Upload zip archive
|
- name: Upload zip archive
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/repo/verilator.zip
|
path: ${{ github.workspace }}/repo/verilator.zip
|
||||||
name: verilator-win.zip
|
name: verilator-win.zip
|
||||||
|
|||||||
@@ -41,3 +41,8 @@ verilator-config-version.cmake
|
|||||||
**/_build/*
|
**/_build/*
|
||||||
**/obj_dir/*
|
**/obj_dir/*
|
||||||
/.vscode/
|
/.vscode/
|
||||||
|
/.idea/
|
||||||
|
/cmake-build-*/
|
||||||
|
/test_regress/snapshot/
|
||||||
|
xmverilog.*
|
||||||
|
xrun.history
|
||||||
|
|||||||
+24
-3
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
#*****************************************************************************
|
#*****************************************************************************
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
|
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
|
||||||
project(Verilator
|
project(Verilator
|
||||||
VERSION 5.014
|
VERSION 5.024
|
||||||
HOMEPAGE_URL https://verilator.org
|
HOMEPAGE_URL https://verilator.org
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
@@ -35,7 +35,7 @@ if (NOT WIN32)
|
|||||||
message(WARNING "CMake support on Linux/OSX is experimental.")
|
message(WARNING "CMake support on Linux/OSX is experimental.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (WIN32)
|
||||||
if (DEFINED ENV{WIN_FLEX_BISON})
|
if (DEFINED ENV{WIN_FLEX_BISON})
|
||||||
set(WIN_FLEX_BISON "$ENV{WIN_FLEX_BISON}")
|
set(WIN_FLEX_BISON "$ENV{WIN_FLEX_BISON}")
|
||||||
endif()
|
endif()
|
||||||
@@ -48,6 +48,27 @@ if (MSVC)
|
|||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(OBJCACHE "" CACHE STRING "Path for ccache, auto-detected if empty")
|
||||||
|
option(OBJCACHE_ENABLED "Compile Verilator with ccache" ON)
|
||||||
|
|
||||||
|
if (OBJCACHE_ENABLED)
|
||||||
|
if (OBJCACHE STREQUAL "")
|
||||||
|
find_program(OBJCACHE_PATH ccache)
|
||||||
|
if (OBJCACHE_PATH STREQUAL "OBJCACHE_PATH-NOTFOUND")
|
||||||
|
set(OBJCACHE_PATH "")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(OBJCACHE_PATH "${OBJCACHE}")
|
||||||
|
endif()
|
||||||
|
if (NOT OBJCACHE_PATH STREQUAL "")
|
||||||
|
execute_process(COMMAND "${OBJCACHE_PATH}" --version
|
||||||
|
OUTPUT_VARIABLE objcache_version)
|
||||||
|
string(REGEX MATCH "[^\n\r]+" objcache_version "${objcache_version}")
|
||||||
|
message(STATUS "Found ccache: ${OBJCACHE_PATH} (\"${objcache_version}\")")
|
||||||
|
set(CMAKE_CXX_COMPILER_LAUNCHER "${OBJCACHE_PATH}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(BISON)
|
find_package(BISON)
|
||||||
find_package(FLEX)
|
find_package(FLEX)
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,307 @@ The changes in each Verilator version are described below. The
|
|||||||
contributors that suggested a given feature are shown in []. Thanks!
|
contributors that suggested a given feature are shown in []. Thanks!
|
||||||
|
|
||||||
|
|
||||||
|
Verilator 5.024 2024-04-05
|
||||||
|
==========================
|
||||||
|
|
||||||
|
**Major:**
|
||||||
|
|
||||||
|
* Add printing summary reports, use `--quiet` or `+verilator+quiet` to suppress (#4909).
|
||||||
|
* Support 1800-2023 keywords, and parsing with UNDEFINED warnings.
|
||||||
|
* Support 1800-2023 preprocessor ifdef expressions.
|
||||||
|
|
||||||
|
**Minor:**
|
||||||
|
|
||||||
|
* Change 1800-2023 to be default language version.
|
||||||
|
* Add DFG 'regularize' pass, and improve variable removal (#4937). [Geza Lore]
|
||||||
|
* Add error when pass net to function argument (#4132) (#4966). [Fuad Ismail]
|
||||||
|
* Add `UNUSEDLOOP` when unused loop is removed (#4926). [Bartłomiej Chmiel, Antmicro Ltd.]
|
||||||
|
* Add custom version for verilator --version packaging (#4954). [Nolan Poe]
|
||||||
|
* Add error on missing pure virtual functions (#4961).
|
||||||
|
* Add error on calling static function without object (#4962).
|
||||||
|
* Add JSON AST dumps (#5020). [Szymon Gizler]
|
||||||
|
* Support 1800-2023 DPI headers, svGetTime/svgGetTimeUnit/svGetTimePrecision methods.
|
||||||
|
* Support 1800-2023 class and function :initial, :extends, :final virtual overrides (#5025).
|
||||||
|
* Support public packed struct / union (#860) (#4878). [Kefa Chen]
|
||||||
|
* Support stream operation on unpacked array (#4714) (#5006). [Fuad Ismail]
|
||||||
|
* Support implicitly-typed variable definitions in for-loop initializers (#4945) (#4986). [Kevin Nygaard]
|
||||||
|
* Support inside range with implicit type conversion (#5026). [Arkadiusz Kozdra, Antmicro Ltd.]
|
||||||
|
* Improve installation to be relocatable (#4927). [Geza Lore]
|
||||||
|
* Improve internal ordering code (#4957) (#4990) (#4994) et al. [Geza Lore]
|
||||||
|
* Fix generate blocks in vpi_iterate (#3609) (#4913). [Andrew Nolte]
|
||||||
|
* Fix __Vlip undefined error in --freloop (#4824). [Justin Yao Du]
|
||||||
|
* Fix missing VPI scopes (#4918). [Andrew Nolte]
|
||||||
|
* Fix invalid cast on string structure creation (#4921).
|
||||||
|
* Fix try-lock spuriously fails (#4931) (#4938). [Kamil Rakoczy]
|
||||||
|
* Fix V3Unknown unpacked struct x-assign (#4934). [Yan Xu]
|
||||||
|
* Fix DFG removing forceable signals (#4942). [Geza Lore]
|
||||||
|
* Fix null characters in shortened identifiers (#4946). [Abdul Hameed]
|
||||||
|
* Fix assignment of null into struct member (#4952).
|
||||||
|
* Fix VPI missing scopes 2 (#4965). [Andrew Nolte]
|
||||||
|
* Fix object assignment from conditionals (#4968).
|
||||||
|
* Fix GCC14 warnings on template specialization syntax (#4974) (#4975). [Nolan Poe]
|
||||||
|
* Fix unpacked structure upper bit cleaning (#4978).
|
||||||
|
* Fix tests on MacOS (#4984) (#4985). [Kevin Nygaard]
|
||||||
|
* Fix `--prof-exec` predicted time values (#4988). [Geza Lore]
|
||||||
|
* Fix class type as an associative array parameter (#4997).
|
||||||
|
* Fix inout ports of unpacked struct type (#5000). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix `unique {}` constraints missing semicolon (#5001).
|
||||||
|
* Fix preprocessor to respect strings in joins (#5007).
|
||||||
|
* Fix tracing class parameters (#5014).
|
||||||
|
* Fix memory leaks (#5016). [Geza Lore]
|
||||||
|
* Fix $readmem with missing newline (#5019). [Josse Van Delm]
|
||||||
|
* Fix internal error on missing pattern key (#5023).
|
||||||
|
* Fix tracing replicated hierarchical models (#5027).
|
||||||
|
|
||||||
|
|
||||||
|
Verilator 5.022 2024-02-24
|
||||||
|
==========================
|
||||||
|
|
||||||
|
**Minor:**
|
||||||
|
|
||||||
|
* Add predicted stack overflow warning (#4799).
|
||||||
|
* Add `+verilator+coverage+file` runtime option.
|
||||||
|
* Add `--assert-case` option (#4919). [Yutetsu TAKATSUKASA]
|
||||||
|
* Add `--decorations node` for inserting debug comments into emitted code.
|
||||||
|
* Add `--json-only` and related JSON dumping (#4715) (#4831). [Szymon Gizler, Antmicro Ltd.]
|
||||||
|
* Add `--[no]-stop-fail` option for continuing after assertions (#4904). [Yutetsu TAKATSUKASA]
|
||||||
|
* Add `--runtime-debug` for Verilated executable runtime debugging.
|
||||||
|
* Add `--valgrind` switch (#4828). [Szymon Gizler]
|
||||||
|
* Add `unroll_disable` and `unroll_full` loop control metacomments (#3260). [Jiaxun Yang]
|
||||||
|
* Remove deprecated 32-bit pointer mode (`gcc -m32`).
|
||||||
|
* Deprecate --xml-only and XML dumping (#4715) (#4831).
|
||||||
|
* Change zero replication width error to ZEROREPL warning (#4753) (#4762). [Pengcheng Xu]
|
||||||
|
* Improve message for priority case assertion failure (#4905). [Yutetsu TAKATSUKASA]
|
||||||
|
* Support dumping coverage with `--main`.
|
||||||
|
* Support dumping DFG patterns with `--stats` (#4889). [Geza Lore]
|
||||||
|
* Support `vpiConstType` in `vpi_get_str()` (#4797). [Marlon James]
|
||||||
|
* Support SystemC 3.0.0 public review version (#4805) (#4807). [Anthony Donlon]
|
||||||
|
* Support parsing anonymous primitive instantiations (#4809). [Anthony Donlon]
|
||||||
|
* Fix to not emit already waived warnings in waiver output (#4574) (#4818). [Jonathan Schröter]
|
||||||
|
* Fix `this` in member initialization (#4710). [eliasphanna]
|
||||||
|
* Fix localparam elaboration (#3858) (#4794). [Andrew Nolte]
|
||||||
|
* Fix lint_off disables on preprocessor warnings (#4703). [Srinivasan Venkataramanan]
|
||||||
|
* Fix $time not rounding up (#4790) (#4792). [Paul Wright]
|
||||||
|
* Fix `vpi_get()` and `vpi_get64()` to return vpiUndefined on errors (#4795). [Marlon James]
|
||||||
|
* Fix VPI parameter iteration (#4798). [Marlon James]
|
||||||
|
* Fix delays using wrong timeunit when modules inlined (#4806). [Paul Wright]
|
||||||
|
* Fix warnings in verilated_sc_trace.h for Clang. (#4807) (#4827). [Anthony Donlon]
|
||||||
|
* Fix null pointer dereference (#4810) (#4825). [Adrian Sampson]
|
||||||
|
* Fix compilation error on multi-inherited interface class usage (#4819).
|
||||||
|
* Fix maybe-uninitialized compiler warning (#4820) (#4822). [Larry Doolittle]
|
||||||
|
* Fix mis-splitting of dump control functions (#4821). [Fan Shupei]
|
||||||
|
* Fix wrong utimes() parameter (#4829). [Szymon Gizler]
|
||||||
|
* Fix incorrect bit-op-tree NOT optimization (#4832) (#4847). [Yutetsu TAKATSUKASA]
|
||||||
|
* Fix width calculation in replaceShiftOp (#4837) (#4841) (#4849). [Yutetsu TAKATSUKASA]
|
||||||
|
* Fix unsafe write in wide array insertion (#4850) (#4855). [Paul Swirhun]
|
||||||
|
* Fix NOT when checking EQ/NEQ under AND/OR tree (#4857) (#4863). [Yutetsu TAKATSUKASA]
|
||||||
|
* Fix tracing chandles (#4860). [Nathan Graybeal]
|
||||||
|
* Fix $fwrite of null (#4862). [Jose Tejada]
|
||||||
|
* Fix -fno-const-bit-op-tree wrong runtime result (#4864) (#4867). [Yutetsu TAKATSUKASA]
|
||||||
|
* Fix SystemC biguint sign desynchronization (#4870). [Bartłomiej Chmiel]
|
||||||
|
* Fix incorrect temporary insertion in loop conditions with statements (#4873). [Geza Lore]
|
||||||
|
* Fix timing with expr on assign LHS (#4880). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix assertion for unique case (#4892). [Yutetsu TAKATSUKASA]
|
||||||
|
* Fix GCC tautological-compare warnings.
|
||||||
|
* Fix compile error on structs with queues (and ignore toggle coverage on queues).
|
||||||
|
* Fix toggle coverage error on multi-edge driven signals.
|
||||||
|
* Fix whitespace in `pragma protect version` (#4902) (#4914). [Paul Swirhun]
|
||||||
|
* Fix incorrect code generation for change expression on typedefed unpacked array (#4915). [Geza Lore]
|
||||||
|
* Fix inconsistent driver resolution with typedefs (#4917). [Geza Lore]
|
||||||
|
|
||||||
|
|
||||||
|
Verilator 5.020 2024-01-01
|
||||||
|
==========================
|
||||||
|
|
||||||
|
**Major:**
|
||||||
|
|
||||||
|
* Support compilation with precompiled headers with Make, and GCC or CLang.
|
||||||
|
* Change include to systemc instead of systemc.h (#4622) (#4623). [Chih-Mao Chen]
|
||||||
|
This may require that SystemC programs add 'using namespace sc_core', 'using namespace sc_dt'.
|
||||||
|
|
||||||
|
**Minor:**
|
||||||
|
|
||||||
|
* Add devcontainer support (#4748). [Stefan Wallentowitz]
|
||||||
|
* Support `iff` in sensitivity list (#1482) (#4626). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Support parameterized virtual interfaces (#4047) (#4743). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Support --timing triggers for virtual interfaces (#4673). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Support ccache when compiling Verilator with CMake (#4678). [Anthony Donlon]
|
||||||
|
* Support passing constraints to --xml-only output (still otherwise unsupported) (#4683). [Shahid Ikram]
|
||||||
|
* Support node memory usage information in --stats (#4684). [Geza Lore]
|
||||||
|
* Support vpiConstType in vpi_get() (#4761). [Todd Strader]
|
||||||
|
* Support vpi_iterate on packages with vpiInstance (#4726). [Todd Strader]
|
||||||
|
* Support multiple parameters in virtual interfaces (#4745). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Support user C/C++ code in final archive, and make a lib{model}.a (#4749) (#4754). [Fan Shupei]
|
||||||
|
* Support inside operator on unpacked arrays and queues (#4751). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Support VPI parameter iteration (#4765). [Todd Strader]
|
||||||
|
* Support packages in vpi_handle_by_name() (#4768). [Todd Strader]
|
||||||
|
* Support invoking interface methods on virtual interface variables (#4774) (#4775). [Jordan McConnon]
|
||||||
|
* Remove deprecated options (#4663). [Geza Lore]
|
||||||
|
* Remove older compiler support; require C++14 or newer (#4784) (#4786).
|
||||||
|
* Optimize timing-delayed queue (#4584). [qrqiuren]
|
||||||
|
* Optimize substitute optimization memory usage (#4687). [Geza Lore]
|
||||||
|
* Optimize wide primitive operations with -Oz (#4733). [Geza Lore]
|
||||||
|
* Optimize V3Premit performance etc. (#4736). [Geza Lore]
|
||||||
|
* Fix VPI TOP level variable iteration (#3919) (#4618). [Marlon James]
|
||||||
|
* Fix display with no % printing assoc array (#4376). [Alex Solomatnikov]
|
||||||
|
* Fix scheduling of external force signals (#4577) (#4668). [Geza Lore]
|
||||||
|
* Fix a memory leak in V3Fork (#4628). [Krzysztof Boroński]
|
||||||
|
* Fix linking parameterized hierarchical blocks and recursive hierarchical blocks (#4654). [Anthony Donlon]
|
||||||
|
* Fix identifiers that end with '_' on Windows (#4655). [Anthony Donlon]
|
||||||
|
* Fix 'for' loop with outside variable reference (#4660). [David Harris]
|
||||||
|
* Fix tracing FST enums (#4661) (#4756). [Todd Strader]
|
||||||
|
* Fix interface parameters used in loop generate constructs (#4664) (#4665). [Anthony Donlon]
|
||||||
|
* Fix C++20 compilation errors (#4670).
|
||||||
|
* Fix deadlocks in error handler (#4672). [Mariusz Glebocki, Antmicro Ltd.]
|
||||||
|
* Fix MingW compilation (#4675). [David Ledger]
|
||||||
|
* Fix trace when using SystemC with certain configurations (#4676). [Anthony Donlon]
|
||||||
|
* Fix range access to classes depending on parameter resolution (#4681). [Krzysztof Boroński]
|
||||||
|
* Fix select into constant And/Or/Xor pattern (#4689). [Geza Lore]
|
||||||
|
* Fix access type of function arguments (#4692) (#4694). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix dynamic NBAs with automatic vars (#4696). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix # 0 delays for process resumption, etc. (#4697). [Krzysztof Boroński]
|
||||||
|
* Fix conflicted namespace for coroutines (#4701) (#4707). [Jinyan Xu]
|
||||||
|
* Fix compilers seeing empty input due to file system races (#4708). [Flavien Solt]
|
||||||
|
* Fix shift of > 32-bit number (#4719). [Flavien Solt]
|
||||||
|
* Fix Windows include gates in filesystem Flush implementation. (#4720). [William D. Jones]
|
||||||
|
* Fix power operator with wide numbers and constants (#4721) (#4763). [Flavien Solt]
|
||||||
|
* Fix parameter passing to ports (#4723). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix block names of nested do..while loops (#4728). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix class name in error on 'new' on virtual class (#4739). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix typedefs pointing to parameterized classes (#4747). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix $finish twice to no longer exit (#4757). [Tim Hutt]
|
||||||
|
* Fix dynamic NBA conditions (#4773). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix `V3Fork` stage to run only if `--timing` is set (#4778). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix max multiply width and add runtime assertions if too small. (#4781)
|
||||||
|
|
||||||
|
|
||||||
|
Verilator 5.018 2023-10-30
|
||||||
|
==========================
|
||||||
|
|
||||||
|
**Major:**
|
||||||
|
|
||||||
|
* Support compilation with precompiled headers with Make and GCC or CLang.
|
||||||
|
* Change include of systemc instead of systemc.h (#4622) (#4623). [Chih-Mao Chen]
|
||||||
|
This may require that SystemC programs add 'using namespace sc_core', 'using namespace sc_dt'.
|
||||||
|
|
||||||
|
**Minor:**
|
||||||
|
|
||||||
|
* Add SIDEEFFECT warning on mishandled side effect cases.
|
||||||
|
* Add trace() API even when Verilated without --trace (#4462). [phelter]
|
||||||
|
* Add warning on interface instantiation without parens (#4094). [Gökçe Aydos]
|
||||||
|
* Add sv_vpi_user.h from IEEE 1800-2017 Annex M (#4606). [Marlon James]
|
||||||
|
* Support 'disable fork' (#4125) (#4569). [Aleksander Kiryk, Antmicro Ltd.]
|
||||||
|
* Support 'wait fork' (#4586). [Aleksander Kiryk, Antmicro Ltd.]
|
||||||
|
* Support 'randc' (#4349).
|
||||||
|
* Support assigning events (#4403). [Krzysztof Boroński]
|
||||||
|
* Support resizing function call inout arguments (#4467).
|
||||||
|
* Support NBAs in non-inlined functions/tasks (#4496) (#4572). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Support converting parameters inside modules to localparams (#4511). [Anthony Donlon]
|
||||||
|
* Support concatenation of unpacked arrays (#4558). [Yutetsu TAKATSUKASA]
|
||||||
|
* Support Clang 16 (#4592). [Mariusz Glebocki]
|
||||||
|
* Support VPI variables of real and string data types (#4594). [Marlon James]
|
||||||
|
* Support making VL_LOCK_SPINS configurable (#4599). [Geza Lore]
|
||||||
|
* Change code --stats output (#4597). [Geza Lore]
|
||||||
|
* Change --prof-exec infrastructure and report (#4602). [Geza Lore]
|
||||||
|
* Change lint_off to not propagate upwards to files including where the lint_off is.
|
||||||
|
* Optimize empty expression statements (#4544).
|
||||||
|
* Optimize trace internals (#4610) (#4612). [Geza Lore]
|
||||||
|
* Optimize internal performance issues (#4638). [Geza Lore]
|
||||||
|
* Fix conversion of impure logical expressions to bit expressions (#487 partial) (#4437). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix enum functions in localparams (#3999). [Andrew Nolte]
|
||||||
|
* Fix passing arguments by reference (#3385 partial) (#4489). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix multithreading handling to separate by code units that use/never use it (#4228). [Mariusz Glebocki, Antmicro Ltd.]
|
||||||
|
* Fix usage of annotation options (#4486) (#4504). [Michal Czyz]
|
||||||
|
* Fix detecting local vars in nested forks (#4493) (#4506). [Kamil Rakoczy]
|
||||||
|
* Fix handling input file path separator (#4515) (#4516). [Anthony Donlon]
|
||||||
|
* Fix mis-support for parameterized UDPs (#4518). [Anthony Donlon]
|
||||||
|
* Fix constant conversion of $realtobits, $bitstoreal (#4522). [Andrew Nolte]
|
||||||
|
* Fix conversion of integers in $display '%e' (#4528). [muzafferkal]
|
||||||
|
* Fix non-inlined interface tracing (#3984) (#4530). [Todd Strader]
|
||||||
|
* Fix stream operations with operands of struct type (#4531) (#4532). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix 'this' in a constructor (#4533). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix stream shift operator of 32 bits (#4536). [Julien Faucher]
|
||||||
|
* Fix object destruction after a copy constructor (#4540) (#4541). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix inlining of real functions miscasting (#4543). [Andrew Nolte]
|
||||||
|
* Fix broken link error for enum references (#4551). [Anthony Donlon]
|
||||||
|
* Fix logical expressions with class objects - caching in v3Const (#4552). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix using functions/tasks following class definition inside module (#4553). [Anthony Donlon]
|
||||||
|
* Fix large constant buffer overflow (#4556). [Varun Koyyalagunta]
|
||||||
|
* Fix instance arrays connecting to array of structs (#4557). [raphmaster]
|
||||||
|
* Fix error message for invalid parameter overrides (#4559). [Anthony Donlon]
|
||||||
|
* Fix shift to remove operation side effects (#4563).
|
||||||
|
* Fix compile warning on unused member function variable (#4567).
|
||||||
|
* Fix method narrowing conversion compiler error (#4568).
|
||||||
|
* Fix interface comparison (#4570). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix dynamic triggers for named events (#4571). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix dictionaries with keys of class types (#4576). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix to not remap local assign intervals in forks (#4583). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix display optimization ignoring side effects (#4585).
|
||||||
|
* Fix PLI/DPI user defined system task/function grammar (#4587) (#4588). [Quentin Corradi]
|
||||||
|
* Fix fault on empty clocking block (#4593). [Alex Mykyta]
|
||||||
|
* Fix creating implicit nets for inputs of gate primitives (#4603). [Geza Lore]
|
||||||
|
* Fix try_put method of unbounded mailbox (#4608). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix stable name generation in V3Fork (#4615) (#4624). [Krzysztof Boroński]
|
||||||
|
* Fix virtual methods (#4616). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix insertion at queue end (#4619). [Krzysztof Boroński]
|
||||||
|
* Fix rand fields of reference types (#4627). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix dynamic casts of null values (#4631). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix signals read via virtual interfaces being misoptimized (#4645). [Krzysztof Bieganski, Antmicro Ltd.]
|
||||||
|
* Fix handling of static keyword in methods (#4649). [Ryszard Rozak, Antmicro Ltd.]
|
||||||
|
* Fix preprocessor to show `line 2 on resumed file.
|
||||||
|
|
||||||
|
|
||||||
|
Verilator 5.016 2023-09-16
|
||||||
|
==========================
|
||||||
|
|
||||||
|
**Minor:**
|
||||||
|
|
||||||
|
* Add prepareClone and atClone APIs for Verilated models (#3503) (#4444). [Yinan Xu]
|
||||||
|
* Add check for conflicting options e.g. binary and lint-only (#4409). [Ethan Sifferman]
|
||||||
|
* Add --no-trace-top to not trace top signals (#4412) (#4422). [Frans Skarman]
|
||||||
|
* Support recursive function calls (#3267).
|
||||||
|
* Support assignments of packed values to stream expressions on queues (#4401). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Support no-parentheses calls to static methods (#4432). [Krzysztof Boroński]
|
||||||
|
* Support block_item_declaration in forks (#4455). [Krzysztof Boroński]
|
||||||
|
* Support assignments of stream expressions on queues to packed values (#4458). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Support function non-constant default arguments (#4470).
|
||||||
|
* Support 'let'.
|
||||||
|
* Optimize Verilator executable size by refactoring error reporting routines (#4446). [Anthony Donlon]
|
||||||
|
* Optimize Verilation runtime pointers and graphs (#4396) (#4397) (#4398). [Krzysztof Bieganski, Antmicro Ltd]
|
||||||
|
* Optimize preparations towards multithreaded Verilation (#4291) (#4463) (#4476) (#4477) (#4479). [Kamil Rakoczy, Antmicro Ltd]
|
||||||
|
* Fix Windows filename format, etc (#3873) (#4421). [Anthony Donlon].
|
||||||
|
* Fix t_dist_cppstyle Perl performance issue (#4085). [Srinivasan Venkataramanan]
|
||||||
|
* Fix using type in parameterized classes without #() (#4281) (#4440). [Anthony Donlon]
|
||||||
|
* Fix false INFINITELOOP on forever..mailbox.get() (#4323). [Srinivasan Venkataramanan]
|
||||||
|
* Fix data type of condition operation on class objects (#4345) (#4352). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Fix variables mutated under fork..join_none/join_any blocks into anonymous objects (#4356). [Krzysztof Boroński]
|
||||||
|
* Fix V3CUse, do not consider implementations (.cpp) at all (#4386). [Krzysztof Boroński]
|
||||||
|
* Fix ++/-- under statements (#4399). [Aleksander Kiryk, Antmicro Ltd]
|
||||||
|
* Fix detection of mixed blocking and nonblocking assignment in nested assignments (#4404). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Fix jumping over object initialization (#4411). [Krzysztof Boroński]
|
||||||
|
* Fix multiple issues towards short circuit support (#4413) (#4460). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Fix variable lifetimes in extern methods (#4414). [Krzysztof Boroński]
|
||||||
|
* Fix multiple function definitions in V3Sched (#4416). [Hennadii Chernyshchyk]
|
||||||
|
* Fix false UNUSEDPARAM on generate localparam (#4427). [Bill Pringlemeir]
|
||||||
|
* Fix checking for parameter and port connections in the wrong place (#4428). [Anthony Donlon]
|
||||||
|
* Fix coroutine handle movement during queue manipulation (#4431). [Aleksander Kiryk, Antmicro Ltd]
|
||||||
|
* Fix nested assignments on the LHS (#4435). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Fix false MULTITOP on bound interfaces (#4438). [Alex Solomatnikov]
|
||||||
|
* Fix internal error on real conversion (#4447). [vdhotre-ventana]
|
||||||
|
* Fix lifetime unknown error on enum.name (#4448). [jwoutersymatra]
|
||||||
|
* Fix unstable output of VHashSha256 (#4453). [Anthony Donlon]
|
||||||
|
* Fix static cast from a stream type (#4469) (#4485). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Fix error on enum with VARHIDDEN of cell (#4482). [Michail Rontionov]
|
||||||
|
* Fix lint of case statements with enum and wildcard bits (#4464) (#4487). [Anthony Donlon]
|
||||||
|
* Fix reference to extended class in parameterized class (#4466).
|
||||||
|
* Fix recursive display causing segfault (#4480). [Kuoping Hsu]
|
||||||
|
* Fix the error message when the type of ref argument is wrong (#4490). [Ryszard Rozak, Antmicro Ltd]
|
||||||
|
* Fix display %x formatting of real.
|
||||||
|
* Fix mis-warning on #() in classes' own functions.
|
||||||
|
* Fix IGNOREDRETURN to not warn on void-cast static function calls.
|
||||||
|
* Fix ZERODLY to not warn on 'wait(0)'.
|
||||||
|
|
||||||
|
|
||||||
Verilator 5.014 2023-08-06
|
Verilator 5.014 2023-08-06
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
@@ -79,7 +380,7 @@ Verilator 5.012 2023-06-13
|
|||||||
* Optimize VPI callValueCbs (#4155). [Hennadii Chernyshchyk]
|
* Optimize VPI callValueCbs (#4155). [Hennadii Chernyshchyk]
|
||||||
* Configure for faster C++ linking using 'mold', if it is installed.
|
* Configure for faster C++ linking using 'mold', if it is installed.
|
||||||
* Fix crash on duplicate imported modules (#3231). [Robert Balas]
|
* Fix crash on duplicate imported modules (#3231). [Robert Balas]
|
||||||
* Fix false WIDTHEXPAND on array declarations (#3959). [JOTEGO]
|
* Fix false WIDTHEXPAND on array declarations (#3959). [Jose Tejada]
|
||||||
* Fix marking overridden methods as coroutines (#4120) (#4169). [Krzysztof Bieganski, Antmicro Ltd]
|
* Fix marking overridden methods as coroutines (#4120) (#4169). [Krzysztof Bieganski, Antmicro Ltd]
|
||||||
* Fix SystemC signal copy macro use (#4135). [Josep Sans]
|
* Fix SystemC signal copy macro use (#4135). [Josep Sans]
|
||||||
* Fix duplicate static names in blocks in functions (#4144) (#4160). [Stefan Wallentowitz]
|
* Fix duplicate static names in blocks in functions (#4144) (#4160). [Stefan Wallentowitz]
|
||||||
@@ -383,7 +684,7 @@ Verilator 5.002 2022-10-29
|
|||||||
* Fix null access on optimized-out fork statements (#3658). [Krzysztof Bieganski, Antmicro Ltd]
|
* Fix null access on optimized-out fork statements (#3658). [Krzysztof Bieganski, Antmicro Ltd]
|
||||||
* Fix VPI inline module naming mismatch (#3690) (#3694). [Jiuyang Liu]
|
* Fix VPI inline module naming mismatch (#3690) (#3694). [Jiuyang Liu]
|
||||||
* Fix deadlock in timeprecision when using SystemC (#3707). [Kamil Rakoczy, Antmicro Ltd]
|
* Fix deadlock in timeprecision when using SystemC (#3707). [Kamil Rakoczy, Antmicro Ltd]
|
||||||
* Fix width mismatch on inside operator (#3714). [Alex Torregrosa]
|
* Fix width mismatch on inside operator (#3714). [Àlex Torregrosa]
|
||||||
|
|
||||||
|
|
||||||
Verilator 4.228 2022-10-01
|
Verilator 4.228 2022-10-01
|
||||||
@@ -613,7 +914,7 @@ Verilator 4.214 2021-10-17
|
|||||||
* Fix removing if statement with side effect in condition (#3131). [Alexander Grobman]
|
* Fix removing if statement with side effect in condition (#3131). [Alexander Grobman]
|
||||||
* Fix --waiver-output for multiline warnings (#2429) (#3141). [Keith Colbert]
|
* Fix --waiver-output for multiline warnings (#2429) (#3141). [Keith Colbert]
|
||||||
* Fix internal error on bad widths (#3140) (#3145). [Zhanglei Wang]
|
* Fix internal error on bad widths (#3140) (#3145). [Zhanglei Wang]
|
||||||
* Fix crash on clang 12/13 (#3148). [Kouping Hsu]
|
* Fix crash on clang 12/13 (#3148). [Kuoping Hsu]
|
||||||
* Fix cygwin compile error due to missing -std=gnu++14 (#3149). [Sun Kim]
|
* Fix cygwin compile error due to missing -std=gnu++14 (#3149). [Sun Kim]
|
||||||
* Fix $urandom_range when the range is 0 ... UINT_MAX (#3161). [Iru Cai]
|
* Fix $urandom_range when the range is 0 ... UINT_MAX (#3161). [Iru Cai]
|
||||||
* Fix constructor-parameter argument comma-separation in C++ (#3162). [Matthew Ballance]
|
* Fix constructor-parameter argument comma-separation in C++ (#3162). [Matthew Ballance]
|
||||||
@@ -728,12 +1029,12 @@ Verilator 4.202 2021-04-24
|
|||||||
* Mark --no-relative-cfuncs as scheduled for deprecation.
|
* Mark --no-relative-cfuncs as scheduled for deprecation.
|
||||||
* Add --coverage-max-width (#2853). [xuejiazidi]
|
* Add --coverage-max-width (#2853). [xuejiazidi]
|
||||||
* Add VerilatedCovContext::forcePerInstance (#2793). [Kevin Laeufer]
|
* Add VerilatedCovContext::forcePerInstance (#2793). [Kevin Laeufer]
|
||||||
* Add FST SystemC tracing (#2806). [Alex Torregrosa]
|
* Add FST SystemC tracing (#2806). [Àlex Torregrosa]
|
||||||
* Add PINNOTFOUND warning in place of error (#2868). [Udi Finkelstein]
|
* Add PINNOTFOUND warning in place of error (#2868). [Udi Finkelstein]
|
||||||
* Support overlaps in priority case statements (#2864). [Rupert Swarbrick]
|
* Support overlaps in priority case statements (#2864). [Rupert Swarbrick]
|
||||||
* Support for null ports (#2875). [Udi Finkelstein]
|
* Support for null ports (#2875). [Udi Finkelstein]
|
||||||
* Fix class unpacked-array compile error (#2774). [Iru Cai]
|
* Fix class unpacked-array compile error (#2774). [Iru Cai]
|
||||||
* Fix scope types in FST and VCD traces (#2805). [Alex Torregrosa]
|
* Fix scope types in FST and VCD traces (#2805). [Àlex Torregrosa]
|
||||||
* Fix exceeding command-line ar limit (#2834). [Yinan Xu]
|
* Fix exceeding command-line ar limit (#2834). [Yinan Xu]
|
||||||
* Fix false $dumpfile warning on model save (#2834). [Yinan Xu]
|
* Fix false $dumpfile warning on model save (#2834). [Yinan Xu]
|
||||||
* Fix --timescale-override not suppressing TIMESCALEMOD (#2838). [Kaleb Barrett]
|
* Fix --timescale-override not suppressing TIMESCALEMOD (#2838). [Kaleb Barrett]
|
||||||
@@ -790,7 +1091,7 @@ Verilator 4.110 2021-02-25
|
|||||||
**Minor:**
|
**Minor:**
|
||||||
|
|
||||||
* Support concat selection (#2721).
|
* Support concat selection (#2721).
|
||||||
* Support struct scopes when dumping structs to VCD (#2776) [Alex Torregrosa]
|
* Support struct scopes when dumping structs to VCD (#2776) [Àlex Torregrosa]
|
||||||
* Generate SELRANGE for potentially unreachable code (#2625) (#2754) [Pierre-Henri Horrein]
|
* Generate SELRANGE for potentially unreachable code (#2625) (#2754) [Pierre-Henri Horrein]
|
||||||
* For --flatten, override inlining of public and no_inline modules (#2761) [James Hanlon]
|
* For --flatten, override inlining of public and no_inline modules (#2761) [James Hanlon]
|
||||||
* Fix little endian interface pin swizzling (#2475). [Don Owen]
|
* Fix little endian interface pin swizzling (#2475). [Don Owen]
|
||||||
@@ -801,7 +1102,7 @@ Verilator 4.110 2021-02-25
|
|||||||
* Fix class extends with VM_PARALLEL_BUILDS (#2775). [Iru Cai]
|
* Fix class extends with VM_PARALLEL_BUILDS (#2775). [Iru Cai]
|
||||||
* Fix shifts by > 32 bit values (#2785). [qrq992]
|
* Fix shifts by > 32 bit values (#2785). [qrq992]
|
||||||
* Fix examples not flushing vcd (#2787). [Richard E George]
|
* Fix examples not flushing vcd (#2787). [Richard E George]
|
||||||
* Fix little endian packed array pattern assignment (#2795). [Alex Torregrosa]
|
* Fix little endian packed array pattern assignment (#2795). [Àlex Torregrosa]
|
||||||
|
|
||||||
|
|
||||||
Verilator 4.108 2021-01-10
|
Verilator 4.108 2021-01-10
|
||||||
@@ -1277,7 +1578,7 @@ Verilator 4.014 2019-05-08
|
|||||||
**Minor:**
|
**Minor:**
|
||||||
|
|
||||||
* Add --trace-fst-thread.
|
* Add --trace-fst-thread.
|
||||||
* Support '#' comments in $readmem. (#1411) [Frederick Requin]
|
* Support '#' comments in $readmem. (#1411) [Frédéric Requin]
|
||||||
* Support "'dx" constants. (#1423) [Udi Finkelstein]
|
* Support "'dx" constants. (#1423) [Udi Finkelstein]
|
||||||
* For FST tracing use LZ4 compression. [Tony Bybell]
|
* For FST tracing use LZ4 compression. [Tony Bybell]
|
||||||
* Add error when use parameters without value. (#1424) [Peter Gerst]
|
* Add error when use parameters without value. (#1424) [Peter Gerst]
|
||||||
@@ -1547,19 +1848,19 @@ Verilator 3.912 2017-09-23
|
|||||||
|
|
||||||
**Minor:**
|
**Minor:**
|
||||||
|
|
||||||
* Support or/and/xor array intrinsic methods. (#1210) [Mike Popoloski]
|
* Support or/and/xor array intrinsic methods. (#1210) [Michael Popoloski]
|
||||||
* Support package export. (#1217) [Usuario Eda]
|
* Support package export. (#1217) [Usuario Eda]
|
||||||
* Support module port parameters without defaults. (#1213) [Mike Popoloski]
|
* Support module port parameters without defaults. (#1213) [Michael Popoloski]
|
||||||
* Add performance information to --stats file.
|
* Add performance information to --stats file.
|
||||||
* Simplify VL_CONST_W macro generation for faster compiles.
|
* Simplify VL_CONST_W macro generation for faster compiles.
|
||||||
* Optimize improvements for Shift-And, and replication constructs.
|
* Optimize improvements for Shift-And, and replication constructs.
|
||||||
* Fix ordering of arrayed cell wide connections. (#1202 partial) [Mike Popoloski]
|
* Fix ordering of arrayed cell wide connections. (#1202 partial) [Michael Popoloski]
|
||||||
* Fix LITENDIAN warning on arrayed cells. (#1202) [Mike Popoloski]
|
* Fix LITENDIAN warning on arrayed cells. (#1202) [Michael Popoloski]
|
||||||
* Fix enum ranges without colons. (#1204) [Mike Popoloski]
|
* Fix enum ranges without colons. (#1204) [Michael Popoloski]
|
||||||
* Fix GCC noreturn compile error. (#1209) [Mike Popoloski]
|
* Fix GCC noreturn compile error. (#1209) [Michael Popoloski]
|
||||||
* Fix constant function default parameters. (#1211) [Mike Popoloski]
|
* Fix constant function default parameters. (#1211) [Michael Popoloski]
|
||||||
* Fix non-colon array of interface modports. (#1212) [Mike Popoloski]
|
* Fix non-colon array of interface modports. (#1212) [Michael Popoloski]
|
||||||
* Fix .name connections on interfaces. (#1214) [Mike Popoloski]
|
* Fix .name connections on interfaces. (#1214) [Michael Popoloski]
|
||||||
* Fix wide array indices causing compile error.
|
* Fix wide array indices causing compile error.
|
||||||
|
|
||||||
|
|
||||||
@@ -1681,8 +1982,8 @@ Verilator 3.888 2016-10-14
|
|||||||
|
|
||||||
**Minor:**
|
**Minor:**
|
||||||
|
|
||||||
* Add --no-decoration to remove output comments, msg2015. [Frederic Requin]
|
* Add --no-decoration to remove output comments, msg2015. [Frédéric Requin]
|
||||||
* If VM_PARALLEL_BUILDS=1, use OPT_FAST and OPT_SLOW. [Frederic Requin]
|
* If VM_PARALLEL_BUILDS=1, use OPT_FAST and OPT_SLOW. [Frédéric Requin]
|
||||||
Set VM_DEFAULT_RULES=0 for old behavior.
|
Set VM_DEFAULT_RULES=0 for old behavior.
|
||||||
* Add error on DPI functions > 32 bits. (#1898) [Elliot Mednick]
|
* Add error on DPI functions > 32 bits. (#1898) [Elliot Mednick]
|
||||||
* Improve Verilation performance on internal strings. (#1896) [Johan Bjork]
|
* Improve Verilation performance on internal strings. (#1896) [Johan Bjork]
|
||||||
@@ -1718,7 +2019,7 @@ Verilator 3.884 2016-05-18
|
|||||||
* Fix --output-split of constructors. (#1035) [Johan Bjork]
|
* Fix --output-split of constructors. (#1035) [Johan Bjork]
|
||||||
* Fix removal of empty packages, modules and cells. (#1034) [Johan Bjork]
|
* Fix removal of empty packages, modules and cells. (#1034) [Johan Bjork]
|
||||||
* Fix core dump on Arch Linux/GCC 6.1.1. (#1058) [Jannis Harder]
|
* Fix core dump on Arch Linux/GCC 6.1.1. (#1058) [Jannis Harder]
|
||||||
* Fix $value$plusargs to string. (#1880) [Frederic Requin]
|
* Fix $value$plusargs to string. (#1880) [Frédéric Requin]
|
||||||
|
|
||||||
|
|
||||||
Verilator 3.882 2016-03-01
|
Verilator 3.882 2016-03-01
|
||||||
@@ -1797,13 +2098,13 @@ Verilator 3.876 2015-08-12
|
|||||||
|
|
||||||
**Minor:**
|
**Minor:**
|
||||||
|
|
||||||
* Add tracing_on, etc to vlt files. (#932) [Frederic Requin]
|
* Add tracing_on, etc to vlt files. (#932) [Frédéric Requin]
|
||||||
* Support extraction of enum bits. (#951) [Jonathon Donaldson]
|
* Support extraction of enum bits. (#951) [Jonathon Donaldson]
|
||||||
* Fix MinGW compiler error. (#927) (#929) [Hans Tichelaar]
|
* Fix MinGW compiler error. (#927) (#929) [Hans Tichelaar]
|
||||||
* Fix .c files to be treated as .cpp. (#930) [Jonathon Donaldson]
|
* Fix .c files to be treated as .cpp. (#930) [Jonathon Donaldson]
|
||||||
* Fix string-to-int space conversion. (#931) [Fabrizio Ferrandi]
|
* Fix string-to-int space conversion. (#931) [Fabrizio Ferrandi]
|
||||||
* Fix dpi imports inside generates. [Michael Tresidder]
|
* Fix dpi imports inside generates. [Michael Tresidder]
|
||||||
* Fix rounding in trace $timescale. (#946) [Frederic Requin]
|
* Fix rounding in trace $timescale. (#946) [Frédéric Requin]
|
||||||
* Fix $fopen with SV string. (#947) [Sven Stucki]
|
* Fix $fopen with SV string. (#947) [Sven Stucki]
|
||||||
* Fix hashed error with typedef inside block. (#948) [Sven Stucki]
|
* Fix hashed error with typedef inside block. (#948) [Sven Stucki]
|
||||||
* Fix makefile with --coverage. (#953) [Eivind Liland]
|
* Fix makefile with --coverage. (#953) [Eivind Liland]
|
||||||
@@ -2043,7 +2344,7 @@ Verilator 3.852 2013-09-29
|
|||||||
|
|
||||||
* Support named function and task arguments. [Chris Randall]
|
* Support named function and task arguments. [Chris Randall]
|
||||||
* Report SELRANGE warning for non-generate if. (#675) [Roland Kruse]
|
* Report SELRANGE warning for non-generate if. (#675) [Roland Kruse]
|
||||||
* Fix ordering of $fgetc. (#1808) [Frederic Requin]
|
* Fix ordering of $fgetc. (#1808) [Frédéric Requin]
|
||||||
* Fix --output-split-cfunc to count internal functions. [Chris Randall]
|
* Fix --output-split-cfunc to count internal functions. [Chris Randall]
|
||||||
* Fix crash on 32-bit Ubuntu. (#670) [Mark Jackson Pulver]
|
* Fix crash on 32-bit Ubuntu. (#670) [Mark Jackson Pulver]
|
||||||
|
|
||||||
@@ -2111,7 +2412,7 @@ Verilator 3.846 2013-03-09
|
|||||||
* Fix DETECTARRAY on packed structures. (#610) [Jeremy Bennett]
|
* Fix DETECTARRAY on packed structures. (#610) [Jeremy Bennett]
|
||||||
* Fix LITENDIAN on unpacked structures. (#614) [Wai Sum Mong]
|
* Fix LITENDIAN on unpacked structures. (#614) [Wai Sum Mong]
|
||||||
* Fix 32-bit OS VPI scan issue. (#615) [Jeremy Bennett, Rich Porter]
|
* Fix 32-bit OS VPI scan issue. (#615) [Jeremy Bennett, Rich Porter]
|
||||||
* Fix opening a VerilatedVcdC file multiple times. (#1774) [Frederic Requin]
|
* Fix opening a VerilatedVcdC file multiple times. (#1774) [Frédéric Requin]
|
||||||
* Fix UNOPTFLAT circular array bounds crossing. (#630) [Jie Xu]
|
* Fix UNOPTFLAT circular array bounds crossing. (#630) [Jie Xu]
|
||||||
|
|
||||||
|
|
||||||
@@ -3423,7 +3724,7 @@ Verilator 3.460 2005-07-27 Beta
|
|||||||
* Fix false warning when a clock is constant.
|
* Fix false warning when a clock is constant.
|
||||||
* Fix X/Z in decimal numbers. [Wim Michiels]
|
* Fix X/Z in decimal numbers. [Wim Michiels]
|
||||||
* Fix genvar statements in non-named generate blocks.
|
* Fix genvar statements in non-named generate blocks.
|
||||||
* Fix core dump when missing newline in `define. [David van der bokke]
|
* Fix core dump when missing newline in `define. [David van der Bokke]
|
||||||
|
|
||||||
|
|
||||||
Verilator 3.450 2005-07-12
|
Verilator 3.450 2005-07-12
|
||||||
@@ -4319,7 +4620,7 @@ Verilator 0.0 1994-07-08
|
|||||||
Copyright
|
Copyright
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
Copyright 2001-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
|
|||||||
+68
-29
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
#*****************************************************************************
|
#*****************************************************************************
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
@@ -112,7 +112,7 @@ SUBDIRS = docs src test_regress \
|
|||||||
examples/make_tracing_c \
|
examples/make_tracing_c \
|
||||||
examples/make_tracing_sc \
|
examples/make_tracing_sc \
|
||||||
examples/make_protect_lib \
|
examples/make_protect_lib \
|
||||||
examples/xml_py \
|
examples/json_py \
|
||||||
|
|
||||||
INFOS = verilator.html verilator.pdf
|
INFOS = verilator.html verilator.pdf
|
||||||
|
|
||||||
@@ -173,6 +173,10 @@ smoke-test: all_nomsg
|
|||||||
test_regress: all_nomsg
|
test_regress: all_nomsg
|
||||||
$(MAKE) -C test_regress
|
$(MAKE) -C test_regress
|
||||||
|
|
||||||
|
.PHONY: test-snap test-diff
|
||||||
|
test-snap test-diff:
|
||||||
|
$(MAKE) -C test_regress $@
|
||||||
|
|
||||||
examples: all_nomsg
|
examples: all_nomsg
|
||||||
for p in $(EXAMPLES) ; do \
|
for p in $(EXAMPLES) ; do \
|
||||||
$(MAKE) -C $$p VERILATOR_ROOT=`pwd` || exit 10; \
|
$(MAKE) -C $$p VERILATOR_ROOT=`pwd` || exit 10; \
|
||||||
@@ -199,11 +203,21 @@ verilator.html:
|
|||||||
verilator.pdf: Makefile
|
verilator.pdf: Makefile
|
||||||
$(MAKE) -C docs verilator.pdf
|
$(MAKE) -C docs verilator.pdf
|
||||||
|
|
||||||
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
|
# Public executables intended to be invoked directly by the user
|
||||||
VL_INST_BIN_FILES = verilator verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT) \
|
# Don't put wildcards in these variables, it might cause an uninstall of other stuff
|
||||||
verilator_ccache_report verilator_coverage verilator_difftree verilator_gantt verilator_includer verilator_profcfunc
|
VL_INST_PUBLIC_SCRIPT_FILES = verilator \
|
||||||
# Some scripts go into both the search path and pkgdatadir,
|
verilator_coverage \
|
||||||
# so they can be found by the user, and under $VERILATOR_ROOT.
|
verilator_gantt \
|
||||||
|
verilator_profcfunc \
|
||||||
|
|
||||||
|
VL_INST_PUBLIC_BIN_FILES = verilator_bin$(EXEEXT) \
|
||||||
|
verilator_bin_dbg$(EXEEXT) \
|
||||||
|
verilator_coverage_bin_dbg$(EXEEXT) \
|
||||||
|
|
||||||
|
# Private executabels intended to be invoked by internals
|
||||||
|
# Don't put wildcards in these variables, it might cause an uninstall of other stuff
|
||||||
|
VL_INST_PRIVATE_SCRIPT_FILES = verilator_ccache_report \
|
||||||
|
verilator_includer \
|
||||||
|
|
||||||
VL_INST_INC_BLDDIR_FILES = \
|
VL_INST_INC_BLDDIR_FILES = \
|
||||||
include/verilated_config.h \
|
include/verilated_config.h \
|
||||||
@@ -222,19 +236,34 @@ VL_INST_DATA_SRCDIR_FILES = \
|
|||||||
examples/*/Makefile* \
|
examples/*/Makefile* \
|
||||||
examples/*/vl_* \
|
examples/*/vl_* \
|
||||||
|
|
||||||
installbin:
|
mkbindirs:
|
||||||
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
|
|
||||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
|
|
||||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage )
|
|
||||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_gantt $(DESTDIR)$(bindir)/verilator_gantt )
|
|
||||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
|
|
||||||
( cd bin ; $(INSTALL_PROGRAM) verilator_bin$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin$(EXEEXT) )
|
|
||||||
( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin_dbg$(EXEEXT) )
|
|
||||||
( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg$(EXEEXT) )
|
|
||||||
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
|
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
|
||||||
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer )
|
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
|
||||||
( 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 )
|
installbin: | mkbindirs
|
||||||
|
cd $(srcdir)/bin; \
|
||||||
|
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) ; do \
|
||||||
|
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkgdatadir)/bin/$$p; \
|
||||||
|
done
|
||||||
|
cd bin; \
|
||||||
|
for p in $(VL_INST_PUBLIC_BIN_FILES) ; do \
|
||||||
|
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkgdatadir)/bin/$$p; \
|
||||||
|
done
|
||||||
|
cd $(srcdir)/bin; \
|
||||||
|
for p in $(VL_INST_PRIVATE_SCRIPT_FILES) ; do \
|
||||||
|
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkgdatadir)/bin/$$p; \
|
||||||
|
done
|
||||||
|
|
||||||
|
installredirect: installbin | mkbindirs
|
||||||
|
cp ${srcdir}/bin/redirect ${srcdir}/bin/redirect.tmp
|
||||||
|
perl -p -i -e 'use File::Spec;' \
|
||||||
|
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(pkgdatadir)/bin)", "$(realpath $(DESTDIR)$(bindir))");' \
|
||||||
|
-e 's/RELPATH.*/"$$path";/g' -- "${srcdir}/bin/redirect.tmp"
|
||||||
|
cd $(srcdir)/bin; \
|
||||||
|
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) $(VL_INST_PUBLIC_BIN_FILES) ; do \
|
||||||
|
$(INSTALL_PROGRAM) redirect.tmp $(DESTDIR)$(bindir)/$$p; \
|
||||||
|
done
|
||||||
|
rm ${srcdir}/bin/redirect.tmp
|
||||||
|
|
||||||
# Man files can either be part of the original kit, or built in current directory
|
# Man files can either be part of the original kit, or built in current directory
|
||||||
# So important we use $^ so VPATH is searched
|
# So important we use $^ so VPATH is searched
|
||||||
@@ -265,7 +294,7 @@ installdata:
|
|||||||
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
|
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
|
||||||
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
|
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
|
||||||
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
|
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
|
||||||
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/xml_py
|
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/json_py
|
||||||
cd $(srcdir) \
|
cd $(srcdir) \
|
||||||
; for p in $(VL_INST_DATA_SRCDIR_FILES) ; do \
|
; for p in $(VL_INST_DATA_SRCDIR_FILES) ; do \
|
||||||
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
|
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||||
@@ -277,8 +306,11 @@ installdata:
|
|||||||
|
|
||||||
# We don't trust rm -rf, so rmdir instead as it will fail if user put in other files
|
# We don't trust rm -rf, so rmdir instead as it will fail if user put in other files
|
||||||
uninstall:
|
uninstall:
|
||||||
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_BIN_FILES)
|
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES)
|
||||||
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_BIN_FILES)
|
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_PUBLIC_BIN_FILES)
|
||||||
|
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES)
|
||||||
|
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PUBLIC_BIN_FILES)
|
||||||
|
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PRIVATE_SCRIPT_FILES)
|
||||||
-cd $(DESTDIR)$(mandir)/man1 && rm -f $(VL_INST_MAN_FILES)
|
-cd $(DESTDIR)$(mandir)/man1 && rm -f $(VL_INST_MAN_FILES)
|
||||||
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_BLDDIR_FILES)
|
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_BLDDIR_FILES)
|
||||||
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_SRCDIR_FILES)
|
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_SRCDIR_FILES)
|
||||||
@@ -301,13 +333,13 @@ uninstall:
|
|||||||
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
|
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
|
||||||
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
|
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
|
||||||
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
|
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
|
||||||
-rmdir $(DESTDIR)$(pkgdatadir)/examples/xml_py
|
-rmdir $(DESTDIR)$(pkgdatadir)/examples/json_py
|
||||||
-rmdir $(DESTDIR)$(pkgdatadir)/examples
|
-rmdir $(DESTDIR)$(pkgdatadir)/examples
|
||||||
-rmdir $(DESTDIR)$(pkgdatadir)
|
-rmdir $(DESTDIR)$(pkgdatadir)
|
||||||
-rmdir $(DESTDIR)$(pkgconfigdir)
|
-rmdir $(DESTDIR)$(pkgconfigdir)
|
||||||
|
|
||||||
install: all_nomsg install-all
|
install: all_nomsg install-all
|
||||||
install-all: installbin installman installdata install-msg
|
install-all: installbin installredirect installman installdata install-msg
|
||||||
|
|
||||||
install-here: installman info
|
install-here: installman info
|
||||||
|
|
||||||
@@ -336,7 +368,7 @@ CPPCHECK_FLAGS = --enable=all --inline-suppr \
|
|||||||
--suppress=useStlAlgorithm
|
--suppress=useStlAlgorithm
|
||||||
CPPCHECK_FLAGS += --xml
|
CPPCHECK_FLAGS += --xml
|
||||||
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP))
|
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP))
|
||||||
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
|
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/include/gtkwave -I$(srcdir)/include/vltstd -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
|
||||||
|
|
||||||
cppcheck: cppcheck-1 cppcheck-2 cppcheck-3 cppcheck-4 cppcheck-5 cppcheck-6 cppcheck-7 cppcheck-8
|
cppcheck: cppcheck-1 cppcheck-2 cppcheck-3 cppcheck-4 cppcheck-5 cppcheck-6 cppcheck-7 cppcheck-8
|
||||||
cppcheck-1:
|
cppcheck-1:
|
||||||
@@ -395,8 +427,8 @@ PY_PROGRAMS = \
|
|||||||
bin/verilator_gantt \
|
bin/verilator_gantt \
|
||||||
bin/verilator_includer \
|
bin/verilator_includer \
|
||||||
bin/verilator_profcfunc \
|
bin/verilator_profcfunc \
|
||||||
examples/xml_py/vl_file_copy \
|
examples/json_py/vl_file_copy \
|
||||||
examples/xml_py/vl_hier_graph \
|
examples/json_py/vl_hier_graph \
|
||||||
docs/guide/conf.py \
|
docs/guide/conf.py \
|
||||||
docs/bin/vl_sphinx_extract \
|
docs/bin/vl_sphinx_extract \
|
||||||
docs/bin/vl_sphinx_fix \
|
docs/bin/vl_sphinx_fix \
|
||||||
@@ -406,6 +438,7 @@ PY_PROGRAMS = \
|
|||||||
src/cppcheck_filtered \
|
src/cppcheck_filtered \
|
||||||
src/flexfix \
|
src/flexfix \
|
||||||
src/vlcovgen \
|
src/vlcovgen \
|
||||||
|
src/.gdbinit.py \
|
||||||
test_regress/t/*.pf \
|
test_regress/t/*.pf \
|
||||||
nodist/clang_check_attributes \
|
nodist/clang_check_attributes \
|
||||||
nodist/code_coverage \
|
nodist/code_coverage \
|
||||||
@@ -430,9 +463,15 @@ PYLINT_FLAGS = --score=n --disable=R0801
|
|||||||
RUFF = ruff
|
RUFF = ruff
|
||||||
RUFF_FLAGS = check --ignore=E402,E501,E701
|
RUFF_FLAGS = check --ignore=E402,E501,E701
|
||||||
|
|
||||||
|
# "make -k" so can see all tool result errors
|
||||||
lint-py:
|
lint-py:
|
||||||
-$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS)
|
$(MAKE) -k lint-py-pylint lint-py-ruff
|
||||||
-$(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS)
|
|
||||||
|
lint-py-pylint:
|
||||||
|
$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS)
|
||||||
|
|
||||||
|
lint-py-ruff:
|
||||||
|
$(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS)
|
||||||
|
|
||||||
format-pl-exec:
|
format-pl-exec:
|
||||||
-chmod a+x test_regress/t/*.pl
|
-chmod a+x test_regress/t/*.pl
|
||||||
|
|||||||
+6
-6
@@ -66,9 +66,9 @@ executable performs the design simulation. Verilator also supports linking
|
|||||||
Verilated generated libraries, optionally encrypted, into other simulators.
|
Verilated generated libraries, optionally encrypted, into other simulators.
|
||||||
|
|
||||||
Verilator may not be the best choice if you are expecting a full-featured
|
Verilator may not be the best choice if you are expecting a full-featured
|
||||||
replacement for a closed-source Verilog simulator, needs SDF annotation,
|
replacement for a closed-source Verilog simulator, need SDF annotation,
|
||||||
mixed-signal simulation, or are doing a quick class project (we recommend
|
mixed-signal simulation, or are doing a quick class project (we recommend
|
||||||
`Icarus Verilog`_ for classwork.) However, if you are looking for a path
|
`Icarus Verilog`_ for classwork). However, if you are looking for a path
|
||||||
to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of
|
to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of
|
||||||
designs, Verilator is the tool for you.
|
designs, Verilator is the tool for you.
|
||||||
|
|
||||||
@@ -80,12 +80,12 @@ Verilator does not directly translate Verilog HDL to C++ or SystemC. Rather,
|
|||||||
Verilator compiles your code into a much faster optimized and optionally
|
Verilator compiles your code into a much faster optimized and optionally
|
||||||
thread-partitioned model, which is in turn wrapped inside a C++/SystemC
|
thread-partitioned model, which is in turn wrapped inside a C++/SystemC
|
||||||
module. The results are a compiled Verilog model that executes even on a
|
module. The results are a compiled Verilog model that executes even on a
|
||||||
single-thread over 10x faster than standalone SystemC, and on a single
|
single thread over 10x faster than standalone SystemC, and on a single
|
||||||
thread is about 100 times faster than interpreted Verilog simulators such
|
thread is about 100 times faster than interpreted Verilog simulators such
|
||||||
as `Icarus Verilog`_. Another 2-10x speedup might be gained from
|
as `Icarus Verilog`_. Another 2-10x speedup might be gained from
|
||||||
multithreading (yielding 200-1000x total over interpreted simulators).
|
multithreading (yielding 200-1000x total over interpreted simulators).
|
||||||
|
|
||||||
Verilator has typically similar or better performance versus the
|
Verilator has typically similar or better performance versus
|
||||||
closed-source Verilog simulators (e.g., Carbon Design Systems Carbonator,
|
closed-source Verilog simulators (e.g., Carbon Design Systems Carbonator,
|
||||||
Modelsim/Questa, Cadence Incisive/NC-Verilog, Synopsys VCS, VTOC, and
|
Modelsim/Questa, Cadence Incisive/NC-Verilog, Synopsys VCS, VTOC, and
|
||||||
Pragmatic CVer/CVC). But, Verilator is open-sourced, so you can spend on
|
Pragmatic CVer/CVC). But, Verilator is open-sourced, so you can spend on
|
||||||
@@ -142,7 +142,7 @@ Related Projects
|
|||||||
Open License
|
Open License
|
||||||
============
|
============
|
||||||
|
|
||||||
Verilator is Copyright 2003-2023 by Wilson Snyder. (Report bugs to
|
Verilator is Copyright 2003-2024 by Wilson Snyder. (Report bugs to
|
||||||
`Verilator Issues <https://verilator.org/issues>`_.)
|
`Verilator Issues <https://verilator.org/issues>`_.)
|
||||||
|
|
||||||
Verilator is free software; you can redistribute it and/or modify it under
|
Verilator is free software; you can redistribute it and/or modify it under
|
||||||
@@ -150,7 +150,7 @@ the terms of either the GNU Lesser General Public License Version 3 or the
|
|||||||
Perl Artistic License Version 2.0. See the documentation for more details.
|
Perl Artistic License Version 2.0. See the documentation for more details.
|
||||||
|
|
||||||
.. _CHIPS Alliance: https://chipsalliance.org
|
.. _CHIPS Alliance: https://chipsalliance.org
|
||||||
.. _Icarus Verilog: http://iverilog.icarus.com
|
.. _Icarus Verilog: https://steveicarus.github.io/iverilog
|
||||||
.. _Linux Foundation: https://www.linuxfoundation.org
|
.. _Linux Foundation: https://www.linuxfoundation.org
|
||||||
.. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png
|
.. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png
|
||||||
.. |verilator multithreaded performance| image:: https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png
|
.. |verilator multithreaded performance| image:: https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
######################################################################
|
||||||
|
#
|
||||||
|
# Copyright 2003-2024 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.006_001;
|
||||||
|
use warnings;
|
||||||
|
use FindBin qw($RealBin $RealScript);
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $relpath = RELPATH; # Substituted during Verilator 'make install'
|
||||||
|
|
||||||
|
unshift @ARGV, $RealScript;
|
||||||
|
|
||||||
|
exec { "$RealBin/$relpath/$RealScript" } @ARGV;
|
||||||
|
die "%Error: Exec failed,";
|
||||||
+69
-38
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
@@ -15,6 +15,7 @@ use Getopt::Long;
|
|||||||
use FindBin qw($RealBin $RealScript);
|
use FindBin qw($RealBin $RealScript);
|
||||||
use IO::File;
|
use IO::File;
|
||||||
use Pod::Usage;
|
use Pod::Usage;
|
||||||
|
use Cwd qw(realpath);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use vars qw($Debug @Opt_Verilator_Sw);
|
use vars qw($Debug @Opt_Verilator_Sw);
|
||||||
@@ -32,6 +33,7 @@ my $opt_rr;
|
|||||||
my $opt_gdbbt;
|
my $opt_gdbbt;
|
||||||
my $opt_quiet_exit;
|
my $opt_quiet_exit;
|
||||||
my $opt_unlimited_stack = 1;
|
my $opt_unlimited_stack = 1;
|
||||||
|
my $opt_valgrind;
|
||||||
|
|
||||||
# No arguments can't do anything useful. Give help
|
# No arguments can't do anything useful. Give help
|
||||||
if ($#ARGV < 0) {
|
if ($#ARGV < 0) {
|
||||||
@@ -56,15 +58,29 @@ if (! GetOptions(
|
|||||||
# Switches
|
# Switches
|
||||||
"gdb!" => \$opt_gdb,
|
"gdb!" => \$opt_gdb,
|
||||||
"gdbbt!" => \$opt_gdbbt,
|
"gdbbt!" => \$opt_gdbbt,
|
||||||
|
"quiet!" => \$opt_quiet_exit, # As -quiet implies -quiet-exit
|
||||||
"quiet-exit!" => \$opt_quiet_exit,
|
"quiet-exit!" => \$opt_quiet_exit,
|
||||||
"rr!" => \$opt_rr,
|
"rr!" => \$opt_rr,
|
||||||
"unlimited-stack!" => \$opt_unlimited_stack,
|
"unlimited-stack!" => \$opt_unlimited_stack,
|
||||||
|
"valgrind!" => \$opt_valgrind,
|
||||||
# Additional parameters
|
# Additional parameters
|
||||||
"<>" => sub {}, # Ignored
|
"<>" => sub {}, # Ignored
|
||||||
)) {
|
)) {
|
||||||
pod2usage(-exitstatus => 2, -verbose => 0);
|
pod2usage(-exitstatus => 2, -verbose => 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $verilator_root = realpath("$RealBin/..");
|
||||||
|
if (defined $ENV{VERILATOR_ROOT}) {
|
||||||
|
if ((!-d $ENV{VERILATOR_ROOT}) || $verilator_root ne realpath($ENV{VERILATOR_ROOT})) {
|
||||||
|
warn "%Error: verilator: VERILATOR_ROOT is set to inconsistent path. Suggest leaving it unset.\n";
|
||||||
|
warn "%Error: VERILATOR_ROOT=$ENV{VERILATOR_ROOT}\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print "export VERILATOR_ROOT='$verilator_root'\n" if $Debug;
|
||||||
|
$ENV{VERILATOR_ROOT} = $verilator_root;
|
||||||
|
}
|
||||||
|
|
||||||
if ($opt_gdbbt && !gdb_works()) {
|
if ($opt_gdbbt && !gdb_works()) {
|
||||||
warn "-Info: --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug;
|
warn "-Info: --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug;
|
||||||
$opt_gdbbt = 0;
|
$opt_gdbbt = 0;
|
||||||
@@ -109,6 +125,18 @@ if ($opt_gdb) {
|
|||||||
. " -ex \"run " . join(' ', @quoted_sw)."\""
|
. " -ex \"run " . join(' ', @quoted_sw)."\""
|
||||||
. " -ex 'set width 0'"
|
. " -ex 'set width 0'"
|
||||||
. " -ex 'bt' -ex 'quit'");
|
. " -ex 'bt' -ex 'quit'");
|
||||||
|
} elsif ($opt_valgrind) {
|
||||||
|
# Run under valgrind
|
||||||
|
my $valgrind_bin = ($ENV{VERILATOR_VALGRIND} || "valgrind --error-exitcode=1 --max-stackframe=2815880"
|
||||||
|
# Magic number sugested by valgrind, may need to be increased in future
|
||||||
|
# if you get warnings. See: https://valgrind.org/docs/manual/manual-core.html#opt.max-stackframe
|
||||||
|
);
|
||||||
|
|
||||||
|
run (ulimit_stack_unlimited()
|
||||||
|
. aslr_off()
|
||||||
|
. $valgrind_bin
|
||||||
|
. " " . verilator_bin()
|
||||||
|
. " " . join(' ', @quoted_sw));
|
||||||
} elsif ($Debug) {
|
} elsif ($Debug) {
|
||||||
# Debug
|
# Debug
|
||||||
run(ulimit_stack_unlimited()
|
run(ulimit_stack_unlimited()
|
||||||
@@ -137,30 +165,13 @@ sub debug {
|
|||||||
# Builds
|
# Builds
|
||||||
|
|
||||||
sub verilator_bin {
|
sub verilator_bin {
|
||||||
my $bin = "";
|
|
||||||
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
|
|
||||||
my $basename = ($ENV{VERILATOR_BIN}
|
my $basename = ($ENV{VERILATOR_BIN}
|
||||||
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
|
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
|
||||||
if (defined($ENV{VERILATOR_ROOT})) {
|
if (-x "$RealBin/$basename" || -x "$RealBin/$basename.exe") {
|
||||||
my $dir = $ENV{VERILATOR_ROOT};
|
return "$RealBin/$basename";
|
||||||
if (-x "$dir/bin/$basename"
|
|
||||||
|| -x "$dir/bin/$basename.exe") { # From a "make install" into VERILATOR_ROOT
|
|
||||||
$bin = "$dir/bin/$basename";
|
|
||||||
} else {
|
|
||||||
$bin = "$dir/$basename"; # From pointing to kit directory
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (-x "$RealBin/$basename"
|
return $basename; # Find in PATH
|
||||||
|| -x "$RealBin/$basename.exe") {
|
|
||||||
$bin = "$RealBin/$basename"; # From path/to/verilator with verilator_bin installed
|
|
||||||
} else {
|
|
||||||
$bin = $basename; # Find in PATH
|
|
||||||
}
|
|
||||||
# Note we don't look under bin/$basename which would be right if running
|
|
||||||
# in the kit dir. Running that would likely break, since
|
|
||||||
# VERILATOR_ROOT wouldn't be set and Verilator won't find internal files.
|
|
||||||
}
|
}
|
||||||
return $bin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -298,7 +309,9 @@ detailed descriptions of these arguments.
|
|||||||
+1800-2009ext+<ext> Use SystemVerilog 2009 with file extension <ext>
|
+1800-2009ext+<ext> Use SystemVerilog 2009 with file extension <ext>
|
||||||
+1800-2012ext+<ext> Use SystemVerilog 2012 with file extension <ext>
|
+1800-2012ext+<ext> Use SystemVerilog 2012 with file extension <ext>
|
||||||
+1800-2017ext+<ext> Use SystemVerilog 2017 with file extension <ext>
|
+1800-2017ext+<ext> Use SystemVerilog 2017 with file extension <ext>
|
||||||
|
+1800-2023ext+<ext> Use SystemVerilog 2023 with file extension <ext>
|
||||||
--assert Enable all assertions
|
--assert Enable all assertions
|
||||||
|
--assert-case Enable unique/unique0/priority case related checks
|
||||||
--autoflush Flush streams after all $displays
|
--autoflush Flush streams after all $displays
|
||||||
--bbox-sys Blackbox unknown $system calls
|
--bbox-sys Blackbox unknown $system calls
|
||||||
--bbox-unsup Blackbox unsupported language features
|
--bbox-unsup Blackbox unsupported language features
|
||||||
@@ -307,7 +320,6 @@ detailed descriptions of these arguments.
|
|||||||
--build-dep-bin <filename> Override build dependency Verilator binary
|
--build-dep-bin <filename> Override build dependency Verilator binary
|
||||||
--build-jobs <jobs> Parallelism for --build
|
--build-jobs <jobs> Parallelism for --build
|
||||||
--cc Create C++ output
|
--cc Create C++ output
|
||||||
--cdc Clock domain crossing analysis
|
|
||||||
-CFLAGS <flags> C++ compiler arguments for makefile
|
-CFLAGS <flags> C++ compiler arguments for makefile
|
||||||
--clk <signal-name> Mark specified signal as clock
|
--clk <signal-name> Mark specified signal as clock
|
||||||
--no-clk <signal-name> Prevent marking specified signal as clock
|
--no-clk <signal-name> Prevent marking specified signal as clock
|
||||||
@@ -325,7 +337,8 @@ detailed descriptions of these arguments.
|
|||||||
--no-debug-leak Disable leaking memory in --debug mode
|
--no-debug-leak Disable leaking memory in --debug mode
|
||||||
--debugi <level> Enable debugging at a specified level
|
--debugi <level> Enable debugging at a specified level
|
||||||
--debugi-<srcfile> <level> Enable debugging a source file at a level
|
--debugi-<srcfile> <level> Enable debugging a source file at a level
|
||||||
--no-decoration Disable comments and symbol decorations
|
--decorations <level> Set output comment and spacing level
|
||||||
|
--no-decoration Disable comments and lower spacing level
|
||||||
--default-language <lang> Default language to parse
|
--default-language <lang> Default language to parse
|
||||||
+define+<var>=<value> Set preprocessor define
|
+define+<var>=<value> Set preprocessor define
|
||||||
--dpi-hdr-only Only produce the DPI header file
|
--dpi-hdr-only Only produce the DPI header file
|
||||||
@@ -334,10 +347,13 @@ detailed descriptions of these arguments.
|
|||||||
--dump-graph Enable dumping V3Graphs to .dot files
|
--dump-graph Enable dumping V3Graphs to .dot files
|
||||||
--dump-tree Enable dumping Ast .tree files
|
--dump-tree Enable dumping Ast .tree files
|
||||||
--dump-tree-addrids Use short identifiers instead of addresses
|
--dump-tree-addrids Use short identifiers instead of addresses
|
||||||
|
--dump-tree-dot Enable dumping Ast .tree.dot debug files
|
||||||
|
--dump-tree-json Enable dumping Ast .tree.json files and .tree.meta.json file
|
||||||
--dump-<srcfile> Enable dumping everything in source file
|
--dump-<srcfile> Enable dumping everything in source file
|
||||||
--dumpi-dfg <level> Enable dumping DfgGraphs to .dot files at level
|
--dumpi-dfg <level> Enable dumping DfgGraphs to .dot files at level
|
||||||
--dumpi-graph <level> Enable dumping V3Graphs to .dot files at level
|
--dumpi-graph <level> Enable dumping V3Graphs to .dot files at level
|
||||||
--dumpi-tree <level> Enable dumping Ast .tree files at level
|
--dumpi-tree <level> Enable dumping Ast .tree files at level
|
||||||
|
--dumpi-tree-json <level> Enable dumping Ast .tree.json files at level
|
||||||
--dumpi-<srcfile> <level> Enable dumping everything in source file at level
|
--dumpi-<srcfile> <level> Enable dumping everything in source file at level
|
||||||
-E Preprocess, but do not compile
|
-E Preprocess, but do not compile
|
||||||
--error-limit <value> Abort after this number of errors
|
--error-limit <value> Abort after this number of errors
|
||||||
@@ -347,6 +363,8 @@ detailed descriptions of these arguments.
|
|||||||
-f <file> Parse arguments from a file
|
-f <file> Parse arguments from a file
|
||||||
-FI <file> Force include of a file
|
-FI <file> Force include of a file
|
||||||
--flatten Force inlining of all modules, tasks and functions
|
--flatten Force inlining of all modules, tasks and functions
|
||||||
|
--future0 <option> Ignore an option for compatibility
|
||||||
|
--future1 <option> Ignore an option with argument for compatibility
|
||||||
-fno-<optimization> Disable internal optimization stage
|
-fno-<optimization> Disable internal optimization stage
|
||||||
-G<name>=<value> Overwrite top-level parameter
|
-G<name>=<value> Overwrite top-level parameter
|
||||||
--gate-stmts <value> Tune gate optimizer depth
|
--gate-stmts <value> Tune gate optimizer depth
|
||||||
@@ -355,7 +373,7 @@ detailed descriptions of these arguments.
|
|||||||
--generate-key Create random key for --protect-key
|
--generate-key Create random key for --protect-key
|
||||||
--getenv <var> Get environment variable with defaults
|
--getenv <var> Get environment variable with defaults
|
||||||
--get-supported <feature> Get if feature is supported
|
--get-supported <feature> Get if feature is supported
|
||||||
--help Display this help
|
--help Show this help
|
||||||
--hierarchical Enable hierarchical Verilation
|
--hierarchical Enable hierarchical Verilation
|
||||||
-I<dir> Directory to search for includes
|
-I<dir> Directory to search for includes
|
||||||
--if-depth <value> Tune IFDEPTH warning
|
--if-depth <value> Tune IFDEPTH warning
|
||||||
@@ -383,7 +401,6 @@ detailed descriptions of these arguments.
|
|||||||
-O3 High-performance optimizations
|
-O3 High-performance optimizations
|
||||||
-O<optimization-letter> Selectable optimizations
|
-O<optimization-letter> Selectable optimizations
|
||||||
-o <executable> Name of final executable
|
-o <executable> Name of final executable
|
||||||
--no-order-clock-delay Disable ordering clock enable assignments
|
|
||||||
--output-split <statements> Split .cpp files into pieces
|
--output-split <statements> Split .cpp files into pieces
|
||||||
--output-split-cfuncs <statements> Split model functions
|
--output-split-cfuncs <statements> Split model functions
|
||||||
--output-split-ctrace <statements> Split tracing functions
|
--output-split-ctrace <statements> Split tracing functions
|
||||||
@@ -404,24 +421,29 @@ detailed descriptions of these arguments.
|
|||||||
--protect-ids Hash identifier names for obscurity
|
--protect-ids Hash identifier names for obscurity
|
||||||
--protect-key <key> Key for symbol protection
|
--protect-key <key> Key for symbol protection
|
||||||
--protect-lib <name> Create a DPI protected library
|
--protect-lib <name> Create a DPI protected library
|
||||||
--public Debugging; see docs
|
--public Mark signals as public; see docs
|
||||||
|
--public-depth <level> Mark public to specified module depth
|
||||||
--public-params Mark all parameters as public_flat
|
--public-params Mark all parameters as public_flat
|
||||||
--public-flat-rw Mark all variables, etc as public_flat_rw
|
--public-flat-rw Mark all variables, etc as public_flat_rw
|
||||||
-pvalue+<name>=<value> Overwrite toplevel parameter
|
-pvalue+<name>=<value> Overwrite toplevel parameter
|
||||||
|
--quiet Minimize additional printing
|
||||||
--quiet-exit Don't print the command on failure
|
--quiet-exit Don't print the command on failure
|
||||||
|
--quiet-stats Don't print statistics
|
||||||
--relative-includes Resolve includes relative to current file
|
--relative-includes Resolve includes relative to current file
|
||||||
--reloop-limit Minimum iterations for forming loops
|
--reloop-limit Minimum iterations for forming loops
|
||||||
--report-unoptflat Extra diagnostics for UNOPTFLAT
|
--report-unoptflat Extra diagnostics for UNOPTFLAT
|
||||||
--rr Run Verilator and record with rr
|
--rr Run Verilator and record with rr
|
||||||
|
--runtime-debug Enable model runtime debugging
|
||||||
--savable Enable model save-restore
|
--savable Enable model save-restore
|
||||||
--sc Create SystemC output
|
--sc Create SystemC output
|
||||||
--no-skip-identical Disable skipping identical output
|
--no-skip-identical Disable skipping identical output
|
||||||
--stats Create statistics file
|
--stats Create statistics file
|
||||||
--stats-vars Provide statistics on variables
|
--stats-vars Provide statistics on variables
|
||||||
--no-std Prevent parsing standard library
|
--no-std Prevent parsing standard library
|
||||||
|
--no-stop-fail Do not call $stop when assertion fails
|
||||||
--structs-packed Convert all unpacked structures to packed structures
|
--structs-packed Convert all unpacked structures to packed structures
|
||||||
-sv Enable SystemVerilog parsing
|
-sv Enable SystemVerilog parsing
|
||||||
+systemverilogext+<ext> Synonym for +1800-2017ext+<ext>
|
+systemverilogext+<ext> Synonym for +1800-2023ext+<ext>
|
||||||
--threads <threads> Enable multithreading
|
--threads <threads> Enable multithreading
|
||||||
--threads-dpi <mode> Enable multithreaded DPI
|
--threads-dpi <mode> Enable multithreaded DPI
|
||||||
--threads-max-mtasks <mtasks> Tune maximum mtask partitioning
|
--threads-max-mtasks <mtasks> Tune maximum mtask partitioning
|
||||||
@@ -440,6 +462,7 @@ detailed descriptions of these arguments.
|
|||||||
--trace-params Enable tracing of parameters
|
--trace-params Enable tracing of parameters
|
||||||
--trace-structs Enable tracing structure names
|
--trace-structs Enable tracing structure names
|
||||||
--trace-threads <threads> Enable FST waveform creation on separate threads
|
--trace-threads <threads> Enable FST waveform creation on separate threads
|
||||||
|
--no-trace-top Do not emit traces for signals in the top module generated by verilator
|
||||||
--trace-underscore Enable tracing of _signals
|
--trace-underscore Enable tracing of _signals
|
||||||
-U<var> Undefine preprocessor define
|
-U<var> Undefine preprocessor define
|
||||||
--no-unlimited-stack Don't disable stack size limit
|
--no-unlimited-stack Don't disable stack size limit
|
||||||
@@ -448,11 +471,12 @@ detailed descriptions of these arguments.
|
|||||||
--unused-regexp <regexp> Tune UNUSED lint signals
|
--unused-regexp <regexp> Tune UNUSED lint signals
|
||||||
-V Verbose version and config
|
-V Verbose version and config
|
||||||
-v <filename> Verilog library
|
-v <filename> Verilog library
|
||||||
|
--valgrind Run Verilator under valgrind
|
||||||
--verilate-jobs Job threads for Verilation stage
|
--verilate-jobs Job threads for Verilation stage
|
||||||
--no-verilate Skip Verilation and just compile previously Verilated code
|
--no-verilate Skip Verilation and just compile previously Verilated code
|
||||||
+verilog1995ext+<ext> Synonym for +1364-1995ext+<ext>
|
+verilog1995ext+<ext> Synonym for +1364-1995ext+<ext>
|
||||||
+verilog2001ext+<ext> Synonym for +1364-2001ext+<ext>
|
+verilog2001ext+<ext> Synonym for +1364-2001ext+<ext>
|
||||||
--version Displays program version and exits
|
--version Show program version and exits
|
||||||
--vpi Enable VPI compiles
|
--vpi Enable VPI compiles
|
||||||
--waiver-output <filename> Create a waiver file based on the linter warnings
|
--waiver-output <filename> Create a waiver file based on the linter warnings
|
||||||
-Wall Enable all style warnings
|
-Wall Enable all style warnings
|
||||||
@@ -470,6 +494,11 @@ detailed descriptions of these arguments.
|
|||||||
--x-assign <mode> Assign non-initial Xs to this value
|
--x-assign <mode> Assign non-initial Xs to this value
|
||||||
--x-initial <mode> Assign initial Xs to this value
|
--x-initial <mode> Assign initial Xs to this value
|
||||||
--x-initial-edge Enable initial X->0 and X->1 edge triggers
|
--x-initial-edge Enable initial X->0 and X->1 edge triggers
|
||||||
|
--no-json-edit-nums Don't dump editNum in .tree.json files
|
||||||
|
--no-json-ids Don't use short identifiers instead of adresses/paths in .tree.json
|
||||||
|
--json-only Create JSON parser output (.tree.json and .meta.json)
|
||||||
|
--json-only-output .tree.json output filename
|
||||||
|
--json-only-meta-output .tree.meta.json output filename
|
||||||
--xml-only Create XML parser output
|
--xml-only Create XML parser output
|
||||||
--xml-output XML output filename
|
--xml-output XML output filename
|
||||||
-y <dir> Directory to search for modules
|
-y <dir> Directory to search for modules
|
||||||
@@ -481,26 +510,28 @@ description of these arguments.
|
|||||||
|
|
||||||
=for VL_SPHINX_EXTRACT "_build/gen/args_verilated.rst"
|
=for VL_SPHINX_EXTRACT "_build/gen/args_verilated.rst"
|
||||||
|
|
||||||
+verilator+debug Enable debugging
|
+verilator+debug Enable debugging
|
||||||
+verilator+debugi+<value> Enable debugging at a level
|
+verilator+debugi+<value> Enable debugging at a level
|
||||||
+verilator+error+limit+<value> Set error limit
|
+verilator+coverage+file+<filename> Set coverage output filename
|
||||||
+verilator+help Display help
|
+verilator+error+limit+<value> Set error limit
|
||||||
+verilator+noassert Disable assert checking
|
+verilator+help Show help
|
||||||
|
+verilator+noassert Disable assert checking
|
||||||
+verilator+prof+exec+file+<filename> Set execution profile filename
|
+verilator+prof+exec+file+<filename> Set execution profile filename
|
||||||
+verilator+prof+exec+start+<value> Set execution profile starting point
|
+verilator+prof+exec+start+<value> Set execution profile starting point
|
||||||
+verilator+prof+exec+window+<value> Set execution profile duration
|
+verilator+prof+exec+window+<value> Set execution profile duration
|
||||||
+verilator+prof+vlt+file+<filename> Set PGO profile filename
|
+verilator+prof+vlt+file+<filename> Set PGO profile filename
|
||||||
+verilator+rand+reset+<value> Set random reset technique
|
+verilator+quiet Minimize additional printing
|
||||||
+verilator+seed+<value> Set random seed
|
+verilator+rand+reset+<value> Set random reset technique
|
||||||
+verilator+V Verbose version and config
|
+verilator+seed+<value> Set random seed
|
||||||
+verilator+version Show version and exit
|
+verilator+V Show verbose version and config
|
||||||
|
+verilator+version Show version and exit
|
||||||
|
|
||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
The latest version is available from L<https://verilator.org>.
|
The latest version is available from L<https://verilator.org>.
|
||||||
|
|
||||||
Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
Copyright 2003-2024 by Wilson Snyder. This program is free software; you can
|
||||||
redistribute it and/or modify the Verilator internals under the terms of
|
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
|
either the GNU Lesser General Public License Version 3 or the Perl Artistic
|
||||||
License Version 2.0.
|
License Version 2.0.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ parser = argparse.ArgumentParser(
|
|||||||
For documentation see
|
For documentation see
|
||||||
https://verilator.org/guide/latest/exe_verilator_ccache_report.html""",
|
https://verilator.org/guide/latest/exe_verilator_ccache_report.html""",
|
||||||
epilog=
|
epilog=
|
||||||
"""Copyright 2002-2023 by Wilson Snyder. This program is free software; you
|
"""Copyright 2002-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
@@ -177,18 +177,18 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
|
|||||||
--write <filename> Write aggregate coverage results.
|
--write <filename> Write aggregate coverage results.
|
||||||
--write-info <filename.info> Write lcov .info.
|
--write-info <filename.info> Write lcov .info.
|
||||||
|
|
||||||
+libext+I<ext>+I<ext>... Extensions for Verilog files.
|
+libext+<ext>+<ext>... Extensions for Verilog files.
|
||||||
+define+I<var>+I<value> Defines the given variable.
|
+define+<var>+<value> Defines the given variable.
|
||||||
-DI<var>=I<value> Defines the given variable.
|
-D<var>=<value> Defines the given variable.
|
||||||
+incdir+I<dir> Add directory for finding include files.
|
+incdir+<dir> Add directory for finding include files.
|
||||||
-II<dir> Add directory for finding include files.
|
-I<dir> Add directory for finding include files.
|
||||||
-y I<dir> Specifies module search directory.
|
-y <dir> Specifies module search directory.
|
||||||
|
|
||||||
=head1 DISTRIBUTION
|
=head1 DISTRIBUTION
|
||||||
|
|
||||||
The latest version is available from L<https://verilator.org>.
|
The latest version is available from L<https://verilator.org>.
|
||||||
|
|
||||||
Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify the Verilator internals under the terms
|
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
|
of either the GNU Lesser General Public License Version 3 or the Perl
|
||||||
Artistic License Version 2.0.
|
Artistic License Version 2.0.
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ Verilator_difftree is used for debugging Verilator tree output files.
|
|||||||
It performs a diff between two files, or all files common between two
|
It performs a diff between two files, or all files common between two
|
||||||
directories, ignoring irrelevant pointer differences.""",
|
directories, ignoring irrelevant pointer differences.""",
|
||||||
epilog=
|
epilog=
|
||||||
"""Copyright 2005-2023 by Wilson Snyder. This program is free software; you
|
"""Copyright 2005-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
|
|||||||
+340
-277
@@ -1,33 +1,32 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# pylint: disable=C0103,C0114,C0116,C0209,C0301,R0914,R0912,R0915,W0511,eval-used
|
# pylint: disable=C0103,C0114,C0116,C0209,C0301,R0914,R0912,R0915,W0511,W0603,eval-used
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import bisect
|
||||||
import collections
|
import collections
|
||||||
import math
|
import math
|
||||||
import re
|
import re
|
||||||
import statistics
|
import statistics
|
||||||
# from pprint import pprint
|
# from pprint import pprint
|
||||||
|
|
||||||
Threads = collections.defaultdict(lambda: collections.defaultdict(lambda: {}))
|
Sections = []
|
||||||
Mtasks = collections.defaultdict(lambda: {})
|
LongestVcdStrValueLength = 0
|
||||||
Evals = collections.defaultdict(lambda: {})
|
Threads = collections.defaultdict(lambda: []) # List of records per thread id
|
||||||
EvalLoops = collections.defaultdict(lambda: {})
|
Mtasks = collections.defaultdict(lambda: {'elapsed': 0, 'end': 0})
|
||||||
|
Cpus = collections.defaultdict(lambda: {'mtask_time': 0})
|
||||||
Global = {
|
Global = {
|
||||||
'args': {},
|
'args': {},
|
||||||
'cpuinfo': collections.defaultdict(lambda: {}),
|
'cpuinfo': collections.defaultdict(lambda: {}),
|
||||||
'rdtsc_cycle_time': 0,
|
|
||||||
'stats': {}
|
'stats': {}
|
||||||
}
|
}
|
||||||
|
ElapsedTime = None # total elapsed time
|
||||||
|
ExecGraphTime = 0 # total elapsed time excuting an exec graph
|
||||||
|
ExecGraphIntervals = [] # list of (start, end) pairs
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
||||||
def process(filename):
|
|
||||||
read_data(filename)
|
|
||||||
report()
|
|
||||||
|
|
||||||
|
|
||||||
def read_data(filename):
|
def read_data(filename):
|
||||||
with open(filename, "r", encoding="utf8") as fh:
|
with open(filename, "r", encoding="utf8") as fh:
|
||||||
re_thread = re.compile(r'^VLPROFTHREAD (\d+)$')
|
re_thread = re.compile(r'^VLPROFTHREAD (\d+)$')
|
||||||
@@ -39,14 +38,17 @@ def read_data(filename):
|
|||||||
re_arg1 = re.compile(r'VLPROF arg\s+(\S+)\+([0-9.]*)\s*')
|
re_arg1 = re.compile(r'VLPROF arg\s+(\S+)\+([0-9.]*)\s*')
|
||||||
re_arg2 = re.compile(r'VLPROF arg\s+(\S+)\s+([0-9.]*)\s*$')
|
re_arg2 = re.compile(r'VLPROF arg\s+(\S+)\s+([0-9.]*)\s*$')
|
||||||
re_stat = re.compile(r'VLPROF stat\s+(\S+)\s+([0-9.]+)')
|
re_stat = re.compile(r'VLPROF stat\s+(\S+)\s+([0-9.]+)')
|
||||||
re_time = re.compile(r'rdtsc time = (\d+) ticks')
|
|
||||||
re_proc_cpu = re.compile(r'VLPROFPROC processor\s*:\s*(\d+)\s*$')
|
re_proc_cpu = re.compile(r'VLPROFPROC processor\s*:\s*(\d+)\s*$')
|
||||||
re_proc_dat = re.compile(r'VLPROFPROC ([a-z_ ]+)\s*:\s*(.*)$')
|
re_proc_dat = re.compile(r'VLPROFPROC ([a-z_ ]+)\s*:\s*(.*)$')
|
||||||
cpu = None
|
cpu = None
|
||||||
thread = None
|
thread = None
|
||||||
|
execGraphStart = None
|
||||||
|
|
||||||
lastEvalBeginTick = None
|
global LongestVcdStrValueLength
|
||||||
lastEvalLoopBeginTick = None
|
global ExecGraphTime
|
||||||
|
|
||||||
|
SectionStack = []
|
||||||
|
mTaskThread = {}
|
||||||
|
|
||||||
for line in fh:
|
for line in fh:
|
||||||
recordMatch = re_record.match(line)
|
recordMatch = re_record.match(line)
|
||||||
@@ -54,29 +56,31 @@ def read_data(filename):
|
|||||||
kind, tick, payload = recordMatch.groups()
|
kind, tick, payload = recordMatch.groups()
|
||||||
tick = int(tick)
|
tick = int(tick)
|
||||||
payload = payload.strip()
|
payload = payload.strip()
|
||||||
if kind == "EVAL_BEGIN":
|
if kind == "SECTION_PUSH":
|
||||||
Evals[tick]['start'] = tick
|
LongestVcdStrValueLength = max(LongestVcdStrValueLength,
|
||||||
lastEvalBeginTick = tick
|
len(payload))
|
||||||
elif kind == "EVAL_END":
|
SectionStack.append(payload)
|
||||||
Evals[lastEvalBeginTick]['end'] = tick
|
Sections.append((tick, tuple(SectionStack)))
|
||||||
lastEvalBeginTick = None
|
elif kind == "SECTION_POP":
|
||||||
elif kind == "EVAL_LOOP_BEGIN":
|
assert SectionStack, "SECTION_POP without SECTION_PUSH"
|
||||||
EvalLoops[tick]['start'] = tick
|
SectionStack.pop()
|
||||||
lastEvalLoopBeginTick = tick
|
Sections.append((tick, tuple(SectionStack)))
|
||||||
elif kind == "EVAL_LOOP_END":
|
|
||||||
EvalLoops[lastEvalLoopBeginTick]['end'] = tick
|
|
||||||
lastEvalLoopBeginTick = None
|
|
||||||
elif kind == "MTASK_BEGIN":
|
elif kind == "MTASK_BEGIN":
|
||||||
mtask, predict_start, ecpu = re_payload_mtaskBegin.match(
|
mtask, predict_start, ecpu = re_payload_mtaskBegin.match(
|
||||||
payload).groups()
|
payload).groups()
|
||||||
mtask = int(mtask)
|
mtask = int(mtask)
|
||||||
predict_start = int(predict_start)
|
predict_start = int(predict_start)
|
||||||
ecpu = int(ecpu)
|
ecpu = int(ecpu)
|
||||||
Threads[thread][tick]['mtask'] = mtask
|
mTaskThread[mtask] = thread
|
||||||
Threads[thread][tick]['predict_start'] = predict_start
|
records = Threads[thread]
|
||||||
Threads[thread][tick]['cpu'] = ecpu
|
assert not records or records[-1]['start'] <= records[-1][
|
||||||
if 'elapsed' not in Mtasks[mtask]:
|
'end'] <= tick
|
||||||
Mtasks[mtask] = {'end': 0, 'elapsed': 0}
|
records.append({
|
||||||
|
'start': tick,
|
||||||
|
'mtask': mtask,
|
||||||
|
'predict_start': predict_start,
|
||||||
|
'cpu': ecpu
|
||||||
|
})
|
||||||
Mtasks[mtask]['begin'] = tick
|
Mtasks[mtask]['begin'] = tick
|
||||||
Mtasks[mtask]['thread'] = thread
|
Mtasks[mtask]['thread'] = thread
|
||||||
Mtasks[mtask]['predict_start'] = predict_start
|
Mtasks[mtask]['predict_start'] = predict_start
|
||||||
@@ -86,11 +90,18 @@ def read_data(filename):
|
|||||||
mtask = int(mtask)
|
mtask = int(mtask)
|
||||||
predict_cost = int(predict_cost)
|
predict_cost = int(predict_cost)
|
||||||
begin = Mtasks[mtask]['begin']
|
begin = Mtasks[mtask]['begin']
|
||||||
Threads[thread][begin]['end'] = tick
|
record = Threads[mTaskThread[mtask]][-1]
|
||||||
Threads[thread][begin]['predict_cost'] = predict_cost
|
record['end'] = tick
|
||||||
|
record['predict_cost'] = predict_cost
|
||||||
Mtasks[mtask]['elapsed'] += tick - begin
|
Mtasks[mtask]['elapsed'] += tick - begin
|
||||||
Mtasks[mtask]['predict_cost'] = predict_cost
|
Mtasks[mtask]['predict_cost'] = predict_cost
|
||||||
Mtasks[mtask]['end'] = max(Mtasks[mtask]['end'], tick)
|
Mtasks[mtask]['end'] = max(Mtasks[mtask]['end'], tick)
|
||||||
|
elif kind == "EXEC_GRAPH_BEGIN":
|
||||||
|
execGraphStart = tick
|
||||||
|
elif kind == "EXEC_GRAPH_END":
|
||||||
|
ExecGraphTime += tick - execGraphStart
|
||||||
|
ExecGraphIntervals.append((execGraphStart, tick))
|
||||||
|
execGraphStart = None
|
||||||
elif Args.debug:
|
elif Args.debug:
|
||||||
print("-Unknown execution trace record: %s" % line)
|
print("-Unknown execution trace record: %s" % line)
|
||||||
elif re_thread.match(line):
|
elif re_thread.match(line):
|
||||||
@@ -109,7 +120,7 @@ def read_data(filename):
|
|||||||
elif re_proc_cpu.match(line):
|
elif re_proc_cpu.match(line):
|
||||||
match = re_proc_cpu.match(line)
|
match = re_proc_cpu.match(line)
|
||||||
cpu = int(match.group(1))
|
cpu = int(match.group(1))
|
||||||
elif cpu and re_proc_dat.match(line):
|
elif cpu is not None and re_proc_dat.match(line):
|
||||||
match = re_proc_dat.match(line)
|
match = re_proc_dat.match(line)
|
||||||
term = match.group(1)
|
term = match.group(1)
|
||||||
value = match.group(2)
|
value = match.group(2)
|
||||||
@@ -121,11 +132,6 @@ def read_data(filename):
|
|||||||
pass
|
pass
|
||||||
elif Args.debug:
|
elif Args.debug:
|
||||||
print("-Unk: %s" % line)
|
print("-Unk: %s" % line)
|
||||||
# TODO -- this is parsing text printed by a client.
|
|
||||||
# Really, verilator proper should generate this
|
|
||||||
# if it's useful...
|
|
||||||
if re_time.match(line):
|
|
||||||
Global['rdtsc_cycle_time'] = re_time.group(1)
|
|
||||||
|
|
||||||
|
|
||||||
def re_match_result(regexp, line, result_to):
|
def re_match_result(regexp, line, result_to):
|
||||||
@@ -144,125 +150,33 @@ def report():
|
|||||||
plus = "+" if re.match(r'^\+', arg) else " "
|
plus = "+" if re.match(r'^\+', arg) else " "
|
||||||
print(" %s%s%s" % (arg, plus, Global['args'][arg]))
|
print(" %s%s%s" % (arg, plus, Global['args'][arg]))
|
||||||
|
|
||||||
|
for records in Threads.values():
|
||||||
|
for record in records:
|
||||||
|
cpu = record['cpu']
|
||||||
|
elapsed = record['end'] - record['start']
|
||||||
|
Cpus[cpu]['mtask_time'] += elapsed
|
||||||
|
|
||||||
|
global ElapsedTime
|
||||||
|
ElapsedTime = int(Global['stats']['ticks'])
|
||||||
nthreads = int(Global['stats']['threads'])
|
nthreads = int(Global['stats']['threads'])
|
||||||
Global['cpus'] = {}
|
ncpus = max(len(Cpus), 1)
|
||||||
for thread in Threads:
|
|
||||||
# Make potentially multiple characters per column
|
|
||||||
for start in Threads[thread]:
|
|
||||||
if not Threads[thread][start]:
|
|
||||||
continue
|
|
||||||
cpu = Threads[thread][start]['cpu']
|
|
||||||
elapsed = Threads[thread][start]['end'] - start
|
|
||||||
if cpu not in Global['cpus']:
|
|
||||||
Global['cpus'][cpu] = {'cpu_time': 0}
|
|
||||||
Global['cpus'][cpu]['cpu_time'] += elapsed
|
|
||||||
|
|
||||||
measured_mt_mtask_time = 0
|
print("\nSummary:")
|
||||||
predict_mt_mtask_time = 0
|
print(" Total elapsed time = {} rdtsc ticks".format(ElapsedTime))
|
||||||
long_mtask_time = 0
|
print(" Parallelized code = {:.2%} of elapsed time".format(
|
||||||
measured_last_end = 0
|
ExecGraphTime / ElapsedTime))
|
||||||
predict_last_end = 0
|
print(" Total threads = %d" % nthreads)
|
||||||
for mtask in Mtasks:
|
print(" Total CPUs used = %d" % ncpus)
|
||||||
measured_mt_mtask_time += Mtasks[mtask]['elapsed']
|
print(" Total mtasks = %d" % len(Mtasks))
|
||||||
predict_mt_mtask_time += Mtasks[mtask]['predict_cost']
|
print(" Total yields = %d" % int(Global['stats'].get('yields', 0)))
|
||||||
measured_last_end = max(measured_last_end, Mtasks[mtask]['end'])
|
|
||||||
predict_last_end = max(
|
|
||||||
predict_last_end,
|
|
||||||
Mtasks[mtask]['predict_start'] + Mtasks[mtask]['predict_cost'])
|
|
||||||
long_mtask_time = max(long_mtask_time, Mtasks[mtask]['elapsed'])
|
|
||||||
Global['measured_last_end'] = measured_last_end
|
|
||||||
Global['predict_last_end'] = predict_last_end
|
|
||||||
|
|
||||||
# If we know cycle time in the same (rdtsc) units,
|
|
||||||
# this will give us an actual utilization number,
|
|
||||||
# (how effectively we keep the cores busy.)
|
|
||||||
#
|
|
||||||
# It also gives us a number we can compare against
|
|
||||||
# serial mode, to estimate the overhead of data sharing,
|
|
||||||
# which will show up in the total elapsed time. (Overhead
|
|
||||||
# of synchronization and scheduling should not.)
|
|
||||||
print("\nAnalysis:")
|
|
||||||
print(" Total threads = %d" % nthreads)
|
|
||||||
print(" Total mtasks = %d" % len(Mtasks))
|
|
||||||
ncpus = max(len(Global['cpus']), 1)
|
|
||||||
print(" Total cpus used = %d" % ncpus)
|
|
||||||
print(" Total yields = %d" %
|
|
||||||
int(Global['stats'].get('yields', 0)))
|
|
||||||
print(" Total evals = %d" % len(Evals))
|
|
||||||
print(" Total eval loops = %d" % len(EvalLoops))
|
|
||||||
if Mtasks:
|
|
||||||
print(" Total eval time = %d rdtsc ticks" %
|
|
||||||
Global['measured_last_end'])
|
|
||||||
print(" Longest mtask time = %d rdtsc ticks" % long_mtask_time)
|
|
||||||
print(" All-thread mtask time = %d rdtsc ticks" %
|
|
||||||
measured_mt_mtask_time)
|
|
||||||
long_efficiency = long_mtask_time / (Global.get(
|
|
||||||
'measured_last_end', 1) or 1)
|
|
||||||
print(" Longest-thread efficiency = %0.1f%%" %
|
|
||||||
(long_efficiency * 100.0))
|
|
||||||
mt_efficiency = measured_mt_mtask_time / (
|
|
||||||
Global.get('measured_last_end', 1) * nthreads or 1)
|
|
||||||
print(" All-thread efficiency = %0.1f%%" %
|
|
||||||
(mt_efficiency * 100.0))
|
|
||||||
print(" All-thread speedup = %0.1f" %
|
|
||||||
(mt_efficiency * nthreads))
|
|
||||||
if Global['rdtsc_cycle_time'] > 0:
|
|
||||||
ut = measured_mt_mtask_time / Global['rdtsc_cycle_time']
|
|
||||||
print("tot_mtask_cpu=" + measured_mt_mtask_time + " cyc=" +
|
|
||||||
Global['rdtsc_cycle_time'] + " ut=" + ut)
|
|
||||||
|
|
||||||
predict_mt_efficiency = predict_mt_mtask_time / (
|
|
||||||
Global.get('predict_last_end', 1) * nthreads or 1)
|
|
||||||
print("\nPrediction (what Verilator used for scheduling):")
|
|
||||||
print(" All-thread efficiency = %0.1f%%" %
|
|
||||||
(predict_mt_efficiency * 100.0))
|
|
||||||
print(" All-thread speedup = %0.1f" %
|
|
||||||
(predict_mt_efficiency * nthreads))
|
|
||||||
|
|
||||||
p2e_ratios = []
|
|
||||||
min_p2e = 1000000
|
|
||||||
min_mtask = None
|
|
||||||
max_p2e = -1000000
|
|
||||||
max_mtask = None
|
|
||||||
|
|
||||||
for mtask in sorted(Mtasks.keys()):
|
|
||||||
if Mtasks[mtask]['elapsed'] > 0:
|
|
||||||
if Mtasks[mtask]['predict_cost'] == 0:
|
|
||||||
Mtasks[mtask]['predict_cost'] = 1 # don't log(0) below
|
|
||||||
p2e_ratio = math.log(Mtasks[mtask]['predict_cost'] /
|
|
||||||
Mtasks[mtask]['elapsed'])
|
|
||||||
p2e_ratios.append(p2e_ratio)
|
|
||||||
|
|
||||||
if p2e_ratio > max_p2e:
|
|
||||||
max_p2e = p2e_ratio
|
|
||||||
max_mtask = mtask
|
|
||||||
if p2e_ratio < min_p2e:
|
|
||||||
min_p2e = p2e_ratio
|
|
||||||
min_mtask = mtask
|
|
||||||
|
|
||||||
print("\nMTask statistics:")
|
|
||||||
print(" min log(p2e) = %0.3f" % min_p2e, end="")
|
|
||||||
print(" from mtask %d (predict %d," %
|
|
||||||
(min_mtask, Mtasks[min_mtask]['predict_cost']),
|
|
||||||
end="")
|
|
||||||
print(" elapsed %d)" % Mtasks[min_mtask]['elapsed'])
|
|
||||||
print(" max log(p2e) = %0.3f" % max_p2e, end="")
|
|
||||||
print(" from mtask %d (predict %d," %
|
|
||||||
(max_mtask, Mtasks[max_mtask]['predict_cost']),
|
|
||||||
end="")
|
|
||||||
print(" elapsed %d)" % Mtasks[max_mtask]['elapsed'])
|
|
||||||
|
|
||||||
stddev = statistics.pstdev(p2e_ratios)
|
|
||||||
mean = statistics.mean(p2e_ratios)
|
|
||||||
print(" mean = %0.3f" % mean)
|
|
||||||
print(" stddev = %0.3f" % stddev)
|
|
||||||
print(" e ^ stddev = %0.3f" % math.exp(stddev))
|
|
||||||
|
|
||||||
|
report_mtasks()
|
||||||
report_cpus()
|
report_cpus()
|
||||||
|
report_sections()
|
||||||
|
|
||||||
if nthreads > ncpus:
|
if nthreads > ncpus:
|
||||||
print()
|
print()
|
||||||
print("%%Warning: There were fewer CPUs (%d) then threads (%d)." %
|
print("%%Warning: There were fewer CPUs (%d) than threads (%d)." %
|
||||||
(ncpus, nthreads))
|
(ncpus, nthreads))
|
||||||
print(" : See docs on use of numactl.")
|
print(" : See docs on use of numactl.")
|
||||||
else:
|
else:
|
||||||
@@ -279,32 +193,130 @@ def report():
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
def report_mtasks():
|
||||||
|
if not Mtasks:
|
||||||
|
return
|
||||||
|
|
||||||
|
nthreads = int(Global['stats']['threads'])
|
||||||
|
|
||||||
|
# If we know cycle time in the same (rdtsc) units,
|
||||||
|
# this will give us an actual utilization number,
|
||||||
|
# (how effectively we keep the cores busy.)
|
||||||
|
#
|
||||||
|
# It also gives us a number we can compare against
|
||||||
|
# serial mode, to estimate the overhead of data sharing,
|
||||||
|
# which will show up in the total elapsed time. (Overhead
|
||||||
|
# of synchronization and scheduling should not.)
|
||||||
|
total_mtask_time = 0
|
||||||
|
thread_mtask_time = collections.defaultdict(lambda: 0)
|
||||||
|
long_mtask_time = 0
|
||||||
|
long_mtask = None
|
||||||
|
predict_mtask_time = 0
|
||||||
|
predict_elapsed = 0
|
||||||
|
for mtaskId in Mtasks:
|
||||||
|
record = Mtasks[mtaskId]
|
||||||
|
predict_mtask_time += record['predict_cost']
|
||||||
|
total_mtask_time += record['elapsed']
|
||||||
|
thread_mtask_time[record['thread']] += record['elapsed']
|
||||||
|
predict_end = record['predict_start'] + record['predict_cost']
|
||||||
|
predict_elapsed = max(predict_elapsed, predict_end)
|
||||||
|
if record['elapsed'] > long_mtask_time:
|
||||||
|
long_mtask_time = record['elapsed']
|
||||||
|
long_mtask = mtaskId
|
||||||
|
Global['predict_last_end'] = predict_elapsed
|
||||||
|
|
||||||
|
serialTime = ElapsedTime - ExecGraphTime
|
||||||
|
|
||||||
|
def subReport(elapsed, work):
|
||||||
|
print(" Thread utilization = {:7.2%}".format(work /
|
||||||
|
(elapsed * nthreads)))
|
||||||
|
print(" Speedup = {:6.3}x".format(work / elapsed))
|
||||||
|
|
||||||
|
print("\nParallelized code, measured:")
|
||||||
|
subReport(ExecGraphTime, total_mtask_time)
|
||||||
|
|
||||||
|
print("\nParallelized code, predicted during static scheduling:")
|
||||||
|
subReport(predict_elapsed, predict_mtask_time)
|
||||||
|
|
||||||
|
print("\nAll code, measured:")
|
||||||
|
subReport(ElapsedTime, serialTime + total_mtask_time)
|
||||||
|
|
||||||
|
print("\nAll code, measured, scaled by predicted speedup:")
|
||||||
|
expectedParallelSpeedup = predict_mtask_time / predict_elapsed
|
||||||
|
scaledElapsed = serialTime + total_mtask_time / expectedParallelSpeedup
|
||||||
|
subReport(scaledElapsed, serialTime + total_mtask_time)
|
||||||
|
|
||||||
|
p2e_ratios = []
|
||||||
|
min_p2e = 1000000
|
||||||
|
min_mtask = None
|
||||||
|
max_p2e = -1000000
|
||||||
|
max_mtask = None
|
||||||
|
|
||||||
|
for mtask in sorted(Mtasks.keys()):
|
||||||
|
if Mtasks[mtask]['elapsed'] > 0:
|
||||||
|
if Mtasks[mtask]['predict_cost'] == 0:
|
||||||
|
Mtasks[mtask]['predict_cost'] = 1 # don't log(0) below
|
||||||
|
p2e_ratio = math.log(Mtasks[mtask]['predict_cost'] /
|
||||||
|
Mtasks[mtask]['elapsed'])
|
||||||
|
p2e_ratios.append(p2e_ratio)
|
||||||
|
|
||||||
|
if p2e_ratio > max_p2e:
|
||||||
|
max_p2e = p2e_ratio
|
||||||
|
max_mtask = mtask
|
||||||
|
if p2e_ratio < min_p2e:
|
||||||
|
min_p2e = p2e_ratio
|
||||||
|
min_mtask = mtask
|
||||||
|
|
||||||
|
print("\nMTask statistics:")
|
||||||
|
print(" Longest mtask id = {}".format(long_mtask))
|
||||||
|
print(" Longest mtask time = {:.2%} of time elapsed in parallelized code".
|
||||||
|
format(long_mtask_time / ExecGraphTime))
|
||||||
|
print(" min log(p2e) = %0.3f" % min_p2e, end="")
|
||||||
|
|
||||||
|
print(" from mtask %d (predict %d," %
|
||||||
|
(min_mtask, Mtasks[min_mtask]['predict_cost']),
|
||||||
|
end="")
|
||||||
|
print(" elapsed %d)" % Mtasks[min_mtask]['elapsed'])
|
||||||
|
print(" max log(p2e) = %0.3f" % max_p2e, end="")
|
||||||
|
print(" from mtask %d (predict %d," %
|
||||||
|
(max_mtask, Mtasks[max_mtask]['predict_cost']),
|
||||||
|
end="")
|
||||||
|
print(" elapsed %d)" % Mtasks[max_mtask]['elapsed'])
|
||||||
|
|
||||||
|
stddev = statistics.pstdev(p2e_ratios)
|
||||||
|
mean = statistics.mean(p2e_ratios)
|
||||||
|
print(" mean = %0.3f" % mean)
|
||||||
|
print(" stddev = %0.3f" % stddev)
|
||||||
|
print(" e ^ stddev = %0.3f" % math.exp(stddev))
|
||||||
|
|
||||||
|
|
||||||
def report_cpus():
|
def report_cpus():
|
||||||
print("\nCPUs:")
|
print("\nCPU info:")
|
||||||
|
|
||||||
Global['cpu_sockets'] = collections.defaultdict(lambda: 0)
|
Global['cpu_sockets'] = collections.defaultdict(lambda: 0)
|
||||||
Global['cpu_socket_cores'] = collections.defaultdict(lambda: 0)
|
Global['cpu_socket_cores'] = collections.defaultdict(lambda: 0)
|
||||||
|
|
||||||
for cpu in sorted(Global['cpus'].keys()):
|
print(" Id | Time spent executing MTask | Socket | Core | Model")
|
||||||
print(" cpu %d: " % cpu, end='')
|
print(" | % of elapsed ticks / ticks | | |")
|
||||||
print("cpu_time=%d" % Global['cpus'][cpu]['cpu_time'], end='')
|
print(" ====|============================|========|======|======")
|
||||||
|
for cpu in sorted(Cpus):
|
||||||
socket = None
|
socket = ""
|
||||||
|
core = ""
|
||||||
|
model = ""
|
||||||
if cpu in Global['cpuinfo']:
|
if cpu in Global['cpuinfo']:
|
||||||
cpuinfo = Global['cpuinfo'][cpu]
|
cpuinfo = Global['cpuinfo'][cpu]
|
||||||
if 'physical_id' in cpuinfo and 'core_id' in cpuinfo:
|
if 'physical_id' in cpuinfo and 'core_id' in cpuinfo:
|
||||||
socket = int(cpuinfo['physical_id'])
|
socket = cpuinfo['physical_id']
|
||||||
Global['cpu_sockets'][socket] += 1
|
Global['cpu_sockets'][socket] += 1
|
||||||
print(" socket=%d" % socket, end='')
|
core = cpuinfo['core_id']
|
||||||
|
Global['cpu_socket_cores'][socket + "__" + core] += 1
|
||||||
core = int(cpuinfo['core_id'])
|
|
||||||
Global['cpu_socket_cores'][str(socket) + "__" + str(core)] += 1
|
|
||||||
print(" core=%d" % core, end='')
|
|
||||||
|
|
||||||
if 'model_name' in cpuinfo:
|
if 'model_name' in cpuinfo:
|
||||||
model = cpuinfo['model_name']
|
model = cpuinfo['model_name']
|
||||||
print(" %s" % model, end='')
|
|
||||||
print()
|
print(" {:3d} | {:7.2%} / {:16d} | {:>6s} | {:>4s} | {}".format(
|
||||||
|
cpu, Cpus[cpu]['mtask_time'] / ElapsedTime,
|
||||||
|
Cpus[cpu]['mtask_time'], socket, core, model))
|
||||||
|
|
||||||
if len(Global['cpu_sockets']) > 1:
|
if len(Global['cpu_sockets']) > 1:
|
||||||
Global['cpu_sockets_warning'] = True
|
Global['cpu_sockets_warning'] = True
|
||||||
@@ -313,25 +325,68 @@ def report_cpus():
|
|||||||
Global['cpu_socket_cores_warning'] = True
|
Global['cpu_socket_cores_warning'] = True
|
||||||
|
|
||||||
|
|
||||||
|
def report_sections():
|
||||||
|
if not Sections:
|
||||||
|
return
|
||||||
|
print("\nSection profile:")
|
||||||
|
|
||||||
|
totalTime = collections.defaultdict(lambda: 0)
|
||||||
|
selfTime = collections.defaultdict(lambda: 0)
|
||||||
|
|
||||||
|
sectionTree = [0, {}, 1] # [selfTime, childTrees, numberOfTimesEntered]
|
||||||
|
prevTime = 0
|
||||||
|
prevStack = ()
|
||||||
|
for time, stack in Sections:
|
||||||
|
if len(stack) > len(prevStack):
|
||||||
|
scope = sectionTree
|
||||||
|
for item in stack:
|
||||||
|
scope = scope[1].setdefault(item, [0, {}, 0])
|
||||||
|
scope[2] += 1
|
||||||
|
dt = time - prevTime
|
||||||
|
scope = sectionTree
|
||||||
|
for item in prevStack:
|
||||||
|
scope = scope[1].setdefault(item, [0, {}, 0])
|
||||||
|
scope[0] += dt
|
||||||
|
|
||||||
|
if prevStack:
|
||||||
|
for name in prevStack:
|
||||||
|
totalTime[name] += dt
|
||||||
|
selfTime[prevStack[-1]] += dt
|
||||||
|
prevTime = time
|
||||||
|
prevStack = stack
|
||||||
|
|
||||||
|
def treeSum(tree):
|
||||||
|
n = tree[0]
|
||||||
|
for subTree in tree[1].values():
|
||||||
|
n += treeSum(subTree)
|
||||||
|
return n
|
||||||
|
|
||||||
|
# Make sure the tree sums to the elapsed time
|
||||||
|
sectionTree[0] += ElapsedTime - treeSum(sectionTree)
|
||||||
|
|
||||||
|
def printTree(prefix, name, entries, tree):
|
||||||
|
print(" {:7.2%} | {:7.2%} | {:8} | {:10.2f} | {}".format(
|
||||||
|
treeSum(tree) / ElapsedTime, tree[0] / ElapsedTime, tree[2],
|
||||||
|
tree[2] / entries, prefix + name))
|
||||||
|
for k in sorted(tree[1], key=lambda _: -treeSum(tree[1][_])):
|
||||||
|
printTree(prefix + " ", k, tree[2], tree[1][k])
|
||||||
|
|
||||||
|
print(" Total | Self | Total | Relative | Section")
|
||||||
|
print(" time | time | entries | entries | name ")
|
||||||
|
print("==========|=========|==========|============|========")
|
||||||
|
printTree("", "*TOTAL*", 1, sectionTree)
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
||||||
def write_vcd(filename):
|
def write_vcd(filename):
|
||||||
print("Writing %s" % filename)
|
print("Writing %s" % filename)
|
||||||
with open(filename, "w", encoding="utf8") as fh:
|
with open(filename, "w", encoding="utf8") as fh:
|
||||||
vcd = {
|
# dict of dicts of hierarchy elements/signal name -> (code, width)
|
||||||
'values':
|
scopeSigs = {}
|
||||||
collections.defaultdict(lambda: {}), # {<time>}{<code>} = value
|
# map from time -> code -> value
|
||||||
'sigs': {
|
values = collections.defaultdict(lambda: {})
|
||||||
'predicted_threads': {},
|
|
||||||
'measured_threads': {},
|
|
||||||
'cpus': {},
|
|
||||||
'evals': {},
|
|
||||||
'mtasks': {},
|
|
||||||
'Stats': {}
|
|
||||||
} # {<module>}{<sig}} = code
|
|
||||||
}
|
|
||||||
code = 0
|
|
||||||
|
|
||||||
parallelism = {
|
parallelism = {
|
||||||
'measured': collections.defaultdict(lambda: 0),
|
'measured': collections.defaultdict(lambda: 0),
|
||||||
@@ -340,132 +395,139 @@ def write_vcd(filename):
|
|||||||
parallelism['measured'][0] = 0
|
parallelism['measured'][0] = 0
|
||||||
parallelism['predicted'][0] = 0
|
parallelism['predicted'][0] = 0
|
||||||
|
|
||||||
# Measured graph
|
nextFreeCode = 0
|
||||||
for thread in sorted(Threads.keys()):
|
|
||||||
sig = "thread%d_mtask" % thread
|
|
||||||
if sig not in vcd['sigs']['measured_threads']:
|
|
||||||
vcd['sigs']['measured_threads'][sig] = code
|
|
||||||
code += 1
|
|
||||||
mcode = vcd['sigs']['measured_threads'][sig]
|
|
||||||
|
|
||||||
for start in sorted(Threads[thread]):
|
def getCode(width, *names):
|
||||||
mtask = Threads[thread][start]['mtask']
|
nonlocal nextFreeCode
|
||||||
end = Threads[thread][start]['end']
|
scope = scopeSigs
|
||||||
cpu = Threads[thread][start]['cpu']
|
*path, name = names
|
||||||
vcd['values'][start][mcode] = mtask
|
for item in path:
|
||||||
vcd['values'][end][mcode] = None
|
scope = scope.setdefault(item, {})
|
||||||
|
code, oldWidth = scope.setdefault(name, (nextFreeCode, width))
|
||||||
|
assert oldWidth == width
|
||||||
|
if code == nextFreeCode:
|
||||||
|
nextFreeCode += 1
|
||||||
|
return code
|
||||||
|
|
||||||
|
def addValue(code, time, val):
|
||||||
|
if isinstance(val, str):
|
||||||
|
buf = ""
|
||||||
|
for c in val:
|
||||||
|
buf += bin(ord(c))[2:].rjust(8, "0")
|
||||||
|
val = buf.ljust(LongestVcdStrValueLength * 8, "0")
|
||||||
|
values[time][code] = val
|
||||||
|
|
||||||
|
# Measured graph
|
||||||
|
for thread in sorted(Threads):
|
||||||
|
mcode = getCode(32, 'measured', 't%d_mtask' % thread)
|
||||||
|
for record in Threads[thread]:
|
||||||
|
start = record['start']
|
||||||
|
mtask = record['mtask']
|
||||||
|
end = record['end']
|
||||||
|
cpu = record['cpu']
|
||||||
|
addValue(mcode, start, mtask)
|
||||||
|
addValue(mcode, end, None)
|
||||||
parallelism['measured'][start] += 1
|
parallelism['measured'][start] += 1
|
||||||
parallelism['measured'][end] -= 1
|
parallelism['measured'][end] -= 1
|
||||||
|
|
||||||
sig = "cpu%d_thread" % cpu
|
code = getCode(32, 'measured', 'cpu%d_thread' % cpu)
|
||||||
if sig not in vcd['sigs']['cpus']:
|
addValue(code, start, thread)
|
||||||
vcd['sigs']['cpus'][sig] = code
|
addValue(code, end, None)
|
||||||
code += 1
|
|
||||||
ccode = vcd['sigs']['cpus'][sig]
|
|
||||||
vcd['values'][start][ccode] = thread
|
|
||||||
vcd['values'][end][ccode] = None
|
|
||||||
|
|
||||||
sig = "mtask%d_cpu" % mtask
|
code = getCode(32, 'measured', 'cpu%d_mtask' % cpu)
|
||||||
if sig not in vcd['sigs']['mtasks']:
|
addValue(code, start, mtask)
|
||||||
vcd['sigs']['mtasks'][sig] = code
|
addValue(code, end, None)
|
||||||
code += 1
|
|
||||||
ccode = vcd['sigs']['mtasks'][sig]
|
|
||||||
vcd['values'][start][ccode] = cpu
|
|
||||||
vcd['values'][end][ccode] = None
|
|
||||||
|
|
||||||
# Eval graph
|
tStart = sorted(_['start'] for records in Threads.values()
|
||||||
vcd['sigs']['evals']["eval"] = code
|
for _ in records)
|
||||||
elcode = code
|
tEnd = sorted(_['end'] for records in Threads.values()
|
||||||
code += 1
|
for _ in records)
|
||||||
n = 0
|
|
||||||
for eval_start in Evals:
|
|
||||||
eval_end = Evals[eval_start]['end']
|
|
||||||
n += 1
|
|
||||||
vcd['values'][eval_start][elcode] = n
|
|
||||||
vcd['values'][eval_end][elcode] = None
|
|
||||||
|
|
||||||
# Eval_loop graph
|
# Predicted graph
|
||||||
vcd['sigs']['evals']["eval_loop"] = code
|
for start, end in ExecGraphIntervals:
|
||||||
elcode = code
|
# Find the earliest MTask start after the start point, and the
|
||||||
code += 1
|
# latest MTask end before the end point, so we can scale to the
|
||||||
n = 0
|
# same range
|
||||||
for eval_start in EvalLoops:
|
start = tStart[bisect.bisect_left(tStart, start)]
|
||||||
eval_end = EvalLoops[eval_start]['end']
|
end = tEnd[bisect.bisect_right(tEnd, end) - 1]
|
||||||
n += 1
|
# Compute scale so predicted graph is of same width as interval
|
||||||
vcd['values'][eval_start][elcode] = n
|
measured_scaling = (end - start) / Global['predict_last_end']
|
||||||
vcd['values'][eval_end][elcode] = None
|
# Predict mtasks that fill the time the execution occupied
|
||||||
|
for mtask in Mtasks:
|
||||||
|
thread = Mtasks[mtask]['thread']
|
||||||
|
pred_scaled_start = start + int(
|
||||||
|
Mtasks[mtask]['predict_start'] * measured_scaling)
|
||||||
|
pred_scaled_end = start + int(
|
||||||
|
(Mtasks[mtask]['predict_start'] +
|
||||||
|
Mtasks[mtask]['predict_cost']) * measured_scaling)
|
||||||
|
if pred_scaled_start == pred_scaled_end:
|
||||||
|
continue
|
||||||
|
|
||||||
if Mtasks:
|
mcode = getCode(32, 'predicted', 't%d_mtask' % thread)
|
||||||
# Predicted graph
|
addValue(mcode, pred_scaled_start, mtask)
|
||||||
for eval_start in EvalLoops:
|
addValue(mcode, pred_scaled_end, None)
|
||||||
eval_end = EvalLoops[eval_start]['end']
|
|
||||||
# Compute scale so predicted graph is of same width as eval
|
|
||||||
measured_scaling = (eval_end -
|
|
||||||
eval_start) / Global['predict_last_end']
|
|
||||||
# Predict mtasks that fill the time the eval occupied
|
|
||||||
for mtask in Mtasks:
|
|
||||||
thread = Mtasks[mtask]['thread']
|
|
||||||
pred_scaled_start = eval_start + int(
|
|
||||||
Mtasks[mtask]['predict_start'] * measured_scaling)
|
|
||||||
pred_scaled_end = eval_start + int(
|
|
||||||
(Mtasks[mtask]['predict_start'] +
|
|
||||||
Mtasks[mtask]['predict_cost']) * measured_scaling)
|
|
||||||
if pred_scaled_start == pred_scaled_end:
|
|
||||||
continue
|
|
||||||
|
|
||||||
sig = "predicted_thread%d_mtask" % thread
|
parallelism['predicted'][pred_scaled_start] += 1
|
||||||
if sig not in vcd['sigs']['predicted_threads']:
|
parallelism['predicted'][pred_scaled_end] -= 1
|
||||||
vcd['sigs']['predicted_threads'][sig] = code
|
|
||||||
code += 1
|
|
||||||
mcode = vcd['sigs']['predicted_threads'][sig]
|
|
||||||
|
|
||||||
vcd['values'][pred_scaled_start][mcode] = mtask
|
# Parallelism graph
|
||||||
vcd['values'][pred_scaled_end][mcode] = None
|
for measpred in ('measured', 'predicted'):
|
||||||
|
pcode = getCode(32, 'stats', '%s_parallelism' % measpred)
|
||||||
|
value = 0
|
||||||
|
for time in sorted(parallelism[measpred].keys()):
|
||||||
|
value += parallelism[measpred][time]
|
||||||
|
addValue(pcode, time, value)
|
||||||
|
|
||||||
parallelism['predicted'][pred_scaled_start] += 1
|
# Section graph
|
||||||
parallelism['predicted'][pred_scaled_end] -= 1
|
if Sections:
|
||||||
|
scode = getCode(LongestVcdStrValueLength * 8, "section", "trace")
|
||||||
# Parallelism graph
|
dcode = getCode(32, "section", "depth")
|
||||||
for measpred in ('measured', 'predicted'):
|
for time, stack in Sections:
|
||||||
vcd['sigs']['Stats']["%s_parallelism" % measpred] = code
|
addValue(scode, time, stack[-1] if stack else None)
|
||||||
pcode = code
|
addValue(dcode, time, len(stack))
|
||||||
code += 1
|
|
||||||
value = 0
|
|
||||||
for time in sorted(parallelism[measpred].keys()):
|
|
||||||
value += parallelism[measpred][time]
|
|
||||||
vcd['values'][time][pcode] = value
|
|
||||||
|
|
||||||
# Create output file
|
# Create output file
|
||||||
fh.write("$version Generated by verilator_gantt $end\n")
|
fh.write("$version Generated by verilator_gantt $end\n")
|
||||||
fh.write("$timescale 1ns $end\n")
|
fh.write("$timescale 1ns $end\n")
|
||||||
fh.write("\n")
|
fh.write("\n")
|
||||||
|
|
||||||
all_codes = {}
|
all_codes = set()
|
||||||
|
|
||||||
|
def writeScope(scope):
|
||||||
|
assert isinstance(scope, dict)
|
||||||
|
for key in sorted(scope):
|
||||||
|
val = scope[key]
|
||||||
|
if isinstance(val, dict):
|
||||||
|
fh.write(" $scope module %s $end\n" % key)
|
||||||
|
writeScope(val)
|
||||||
|
fh.write(" $upscope $end\n")
|
||||||
|
else:
|
||||||
|
(code, width) = val
|
||||||
|
all_codes.add(code)
|
||||||
|
fh.write(" $var wire %d v%x %s [%d:0] $end\n" %
|
||||||
|
(width, code, key, width - 1))
|
||||||
|
|
||||||
fh.write(" $scope module gantt $end\n")
|
fh.write(" $scope module gantt $end\n")
|
||||||
for module in sorted(vcd['sigs'].keys()):
|
writeScope(scopeSigs)
|
||||||
fh.write(" $scope module %s $end\n" % module)
|
|
||||||
for sig in sorted(vcd['sigs'][module].keys()):
|
|
||||||
code = vcd['sigs'][module][sig]
|
|
||||||
fh.write(" $var wire 32 v%x %s [31:0] $end\n" % (code, sig))
|
|
||||||
all_codes[code] = 1
|
|
||||||
fh.write(" $upscope $end\n")
|
|
||||||
fh.write(" $upscope $end\n")
|
fh.write(" $upscope $end\n")
|
||||||
fh.write("$enddefinitions $end\n")
|
fh.write("$enddefinitions $end\n")
|
||||||
fh.write("\n")
|
fh.write("\n")
|
||||||
|
|
||||||
first = True
|
first = True
|
||||||
for time in sorted(vcd['values']):
|
for time in sorted(values):
|
||||||
if first:
|
if first:
|
||||||
first = False
|
first = False
|
||||||
# Start with Z for any signals without time zero data
|
# Start with Z for any signals without time zero data
|
||||||
for code in sorted(all_codes.keys()):
|
for code in sorted(all_codes):
|
||||||
if code not in vcd['values'][time]:
|
if code not in values[time]:
|
||||||
vcd['values'][time][code] = None
|
addValue(code, time, None)
|
||||||
fh.write("#%d\n" % time)
|
fh.write("#%d\n" % time)
|
||||||
for code in sorted(vcd['values'][time].keys()):
|
for code in sorted(values[time]):
|
||||||
value = vcd['values'][time][code]
|
value = values[time][code]
|
||||||
if value is None:
|
if value is None:
|
||||||
fh.write("bz v%x\n" % code)
|
fh.write("bz v%x\n" % code)
|
||||||
|
elif isinstance(value, str):
|
||||||
|
fh.write("b%s v%x\n" % (value, code))
|
||||||
else:
|
else:
|
||||||
fh.write("b%s v%x\n" % (format(value, 'b'), code))
|
fh.write("b%s v%x\n" % (format(value, 'b'), code))
|
||||||
|
|
||||||
@@ -484,7 +546,7 @@ Verilator_gantt creates a visual representation to help analyze Verilator
|
|||||||
For documentation see
|
For documentation see
|
||||||
https://verilator.org/guide/latest/exe_verilator_gantt.html""",
|
https://verilator.org/guide/latest/exe_verilator_gantt.html""",
|
||||||
epilog=
|
epilog=
|
||||||
"""Copyright 2018-2023 by Wilson Snyder. This program is free software; you
|
"""Copyright 2018-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
@@ -504,7 +566,8 @@ parser.add_argument('filename',
|
|||||||
|
|
||||||
Args = parser.parse_args()
|
Args = parser.parse_args()
|
||||||
|
|
||||||
process(Args.filename)
|
read_data(Args.filename)
|
||||||
|
report()
|
||||||
if not Args.no_vcd:
|
if not Args.no_vcd:
|
||||||
write_vcd(Args.vcd)
|
write_vcd(Args.vcd)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# pylint: disable=C0114,C0209
|
# pylint: disable=C0114,C0209
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify the Verilator internals under the terms
|
# 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
|
# of either the GNU Lesser General Public License Version 3 or the Perl
|
||||||
# Artistic License Version 2.0.
|
# Artistic License Version 2.0.
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ in each Verilog block.
|
|||||||
For documentation see
|
For documentation see
|
||||||
https://verilator.org/guide/latest/exe_verilator_profcfunc.html""",
|
https://verilator.org/guide/latest/exe_verilator_profcfunc.html""",
|
||||||
epilog=
|
epilog=
|
||||||
"""Copyright 2002-2023 by Wilson Snyder. This program is free software; you
|
"""Copyright 2002-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
|
|||||||
@@ -26,4 +26,5 @@ if git log --format=%B -n 1 "$COMMIT" | grep -q -i '\[CI\s\+ccache\s\+clear\]';
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Dump stats, then zero stats
|
# Dump stats, then zero stats
|
||||||
|
# 22.04: ccache -s -v -z
|
||||||
ccache -s -z
|
ccache -s -z
|
||||||
|
|||||||
+10
-23
@@ -27,12 +27,6 @@ fatal() {
|
|||||||
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$CI_M32" = "0" ]; then
|
|
||||||
unset CI_M32
|
|
||||||
elif [ "$CI_M32" != "1" ]; then
|
|
||||||
fatal "\$CI_M32 must be '0' or '1'";
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
if [ "$CI_OS_NAME" = "linux" ]; then
|
||||||
MAKE=make
|
MAKE=make
|
||||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
elif [ "$CI_OS_NAME" = "osx" ]; then
|
||||||
@@ -71,16 +65,12 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
|||||||
sudo apt-get install libsystemc libsystemc-dev
|
sudo apt-get install libsystemc libsystemc-dev
|
||||||
fi
|
fi
|
||||||
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
||||||
sudo apt-get install mold ||
|
sudo apt-get install bear mold ||
|
||||||
sudo apt-get install mold
|
sudo apt-get install bear mold
|
||||||
fi
|
fi
|
||||||
if [ "$COVERAGE" = 1 ]; then
|
if [ "$COVERAGE" = 1 ]; then
|
||||||
yes yes | sudo cpan -fi Parallel::Forker
|
yes yes | sudo cpan -fi Parallel::Forker
|
||||||
fi
|
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
|
elif [ "$CI_OS_NAME" = "osx" ]; then
|
||||||
brew update
|
brew update
|
||||||
brew install ccache perl gperftools
|
brew install ccache perl gperftools
|
||||||
@@ -102,29 +92,24 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|||||||
sudo apt-get update ||
|
sudo apt-get update ||
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
# libfl-dev needed for internal coverage's test runs
|
# 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 jq ||
|
||||||
sudo apt-get install gdb gtkwave lcov libfl-dev ccache
|
sudo apt-get install gdb gtkwave lcov libfl-dev ccache jq
|
||||||
# Required for test_regress/t/t_dist_attributes.pl
|
# Required for test_regress/t/t_dist_attributes.pl
|
||||||
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
||||||
sudo apt-get install libclang-dev mold ||
|
sudo apt-get install python3-clang mold ||
|
||||||
sudo apt-get install libclang-dev mold
|
sudo apt-get install python3-clang mold
|
||||||
pip3 install clang==14.0
|
|
||||||
fi
|
fi
|
||||||
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
|
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 ||
|
||||||
sudo apt-get install libsystemc-dev
|
sudo apt-get install libsystemc-dev
|
||||||
fi
|
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
|
elif [ "$CI_OS_NAME" = "osx" ]; then
|
||||||
brew update
|
brew update
|
||||||
# brew cask install gtkwave # fst2vcd hangs at launch, so don't bother
|
# brew cask install gtkwave # fst2vcd hangs at launch, so don't bother
|
||||||
brew install ccache perl
|
brew install ccache perl jq
|
||||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
||||||
# fst2vcd fails with "Could not open '<input file>', exiting."
|
# fst2vcd fails with "Could not open '<input file>', exiting."
|
||||||
sudo pkg install -y ccache gmake perl5 python3
|
sudo pkg install -y ccache gmake perl5 python3 jq
|
||||||
else
|
else
|
||||||
fatal "Unknown os: '$CI_OS_NAME'"
|
fatal "Unknown os: '$CI_OS_NAME'"
|
||||||
fi
|
fi
|
||||||
@@ -134,6 +119,8 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|||||||
fi
|
fi
|
||||||
yes yes | sudo cpan -M $CI_CPAN_REPO -fi Parallel::Forker
|
yes yes | sudo cpan -M $CI_CPAN_REPO -fi Parallel::Forker
|
||||||
install-vcddiff
|
install-vcddiff
|
||||||
|
# Workaround -fsanitize=address crash
|
||||||
|
sudo sysctl -w vm.mmap_rnd_bits=28
|
||||||
else
|
else
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Unknown build stage
|
# Unknown build stage
|
||||||
|
|||||||
+27
-14
@@ -21,12 +21,6 @@ fatal() {
|
|||||||
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$CI_M32" = "0" ]; then
|
|
||||||
unset CI_M32
|
|
||||||
elif [ "$CI_M32" != "1" ]; then
|
|
||||||
fatal "\$CI_M32 must be '0' or '1'";
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
if [ "$CI_OS_NAME" = "linux" ]; then
|
||||||
export MAKE=make
|
export MAKE=make
|
||||||
NPROC=$(nproc)
|
NPROC=$(nproc)
|
||||||
@@ -46,9 +40,10 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
|||||||
|
|
||||||
if [ "$COVERAGE" != 1 ]; then
|
if [ "$COVERAGE" != 1 ]; then
|
||||||
autoconf
|
autoconf
|
||||||
./configure --enable-longtests --enable-ccwarn ${CI_M32:+--enable-m32}
|
./configure --enable-longtests --enable-ccwarn --prefix="$INSTALL_DIR"
|
||||||
ccache -z
|
ccache -z
|
||||||
"$MAKE" -j "$NPROC" -k
|
"$MAKE" -j "$NPROC" -k
|
||||||
|
# 22.04: ccache -s -v
|
||||||
ccache -s
|
ccache -s
|
||||||
if [ "$CI_OS_NAME" = "osx" ]; then
|
if [ "$CI_OS_NAME" = "osx" ]; then
|
||||||
file bin/verilator_bin
|
file bin/verilator_bin
|
||||||
@@ -89,26 +84,43 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|||||||
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
|
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run sanitize on Ubuntu 20.04 only
|
# Run sanitize on Ubuntu 22.04 only
|
||||||
[ "$CI_RUNS_ON" = 'ubuntu-20.04' ] && [ "$CI_M32" = "" ] && sanitize='--sanitize' || sanitize=''
|
[ "$CI_RUNS_ON" = 'ubuntu-22.04' ] && sanitize='--sanitize' || sanitize=''
|
||||||
|
|
||||||
|
TEST_REGRESS=test_regress
|
||||||
|
if [ "$CI_RELOC" == 1 ]; then
|
||||||
|
# Testing that the installation is relocatable.
|
||||||
|
"$MAKE" install
|
||||||
|
mkdir -p "$RELOC_DIR"
|
||||||
|
mv "$INSTALL_DIR" "$RELOC_DIR/relocated-install"
|
||||||
|
export VERILATOR_ROOT="$RELOC_DIR/relocated-install/share/verilator"
|
||||||
|
TEST_REGRESS="$RELOC_DIR/test_regress"
|
||||||
|
mv test_regress "$TEST_REGRESS"
|
||||||
|
# Feeling brave?
|
||||||
|
find . -delete
|
||||||
|
ls -la .
|
||||||
|
fi
|
||||||
|
|
||||||
# Run the specified test
|
# Run the specified test
|
||||||
ccache -z
|
ccache -z
|
||||||
case $TESTS in
|
case $TESTS in
|
||||||
dist-vlt-0)
|
dist-vlt-0)
|
||||||
"$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=0/3
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=0/4
|
||||||
;;
|
;;
|
||||||
dist-vlt-1)
|
dist-vlt-1)
|
||||||
"$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=1/3
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=1/4
|
||||||
;;
|
;;
|
||||||
dist-vlt-2)
|
dist-vlt-2)
|
||||||
"$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=2/3
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=2/4
|
||||||
|
;;
|
||||||
|
dist-vlt-3)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=3/4
|
||||||
;;
|
;;
|
||||||
vltmt-0)
|
vltmt-0)
|
||||||
"$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=0/2
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=0/2
|
||||||
;;
|
;;
|
||||||
vltmt-1)
|
vltmt-1)
|
||||||
"$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
|
||||||
;;
|
;;
|
||||||
coverage-all)
|
coverage-all)
|
||||||
nodist/code_coverage --stages 1-
|
nodist/code_coverage --stages 1-
|
||||||
@@ -180,6 +192,7 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|||||||
fatal "Unknown test: $TESTS"
|
fatal "Unknown test: $TESTS"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
# 22.04: ccache -s -v
|
||||||
ccache -s
|
ccache -s
|
||||||
|
|
||||||
# Upload coverage data
|
# Upload coverage data
|
||||||
|
|||||||
@@ -8,6 +8,16 @@
|
|||||||
|
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
# Create the user
|
||||||
|
RUN groupadd verilator \
|
||||||
|
&& useradd -g verilator -m verilator -s /bin/bash \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install --no-install-recommends -y sudo \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& echo verilator ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/verilator \
|
||||||
|
&& chmod 0440 /etc/sudoers.d/verilator
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get install --no-install-recommends -y \
|
apt-get install --no-install-recommends -y \
|
||||||
@@ -33,7 +43,6 @@ RUN apt-get update \
|
|||||||
perl \
|
perl \
|
||||||
python3 \
|
python3 \
|
||||||
wget \
|
wget \
|
||||||
zlibc \
|
|
||||||
zlib1g \
|
zlib1g \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@@ -52,6 +61,8 @@ COPY build.sh /tmp/build.sh
|
|||||||
|
|
||||||
ENV VERILATOR_AUTHOR_SITE=1
|
ENV VERILATOR_AUTHOR_SITE=1
|
||||||
|
|
||||||
|
USER verilator
|
||||||
|
|
||||||
WORKDIR /work
|
WORKDIR /work
|
||||||
|
|
||||||
ENTRYPOINT [ "/tmp/build.sh" ]
|
ENTRYPOINT [ "/tmp/build.sh" ]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
Verilator Build Docker Container
|
Verilator Build Docker Container
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
Verilator Executable Docker Container
|
Verilator Executable Docker Container
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# DESCRIPTION: codecov.io config
|
# DESCRIPTION: codecov.io config
|
||||||
#
|
#
|
||||||
# Copyright 2020-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2020-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
|
|||||||
+44
-44
@@ -1,6 +1,6 @@
|
|||||||
# DESCRIPTION: Process this file with autoconf to produce a configure script.
|
# DESCRIPTION: Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. Verilator is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. Verilator is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU Lesser
|
# 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.
|
# General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
# Then 'make maintainer-dist'
|
# Then 'make maintainer-dist'
|
||||||
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
|
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
|
||||||
#AC_INIT([Verilator],[#.### devel])
|
#AC_INIT([Verilator],[#.### devel])
|
||||||
AC_INIT([Verilator],[5.014 2023-08-06],
|
AC_INIT([Verilator],[5.024 2024-04-05],
|
||||||
[https://verilator.org],
|
[https://verilator.org],
|
||||||
[verilator],[https://verilator.org])
|
[verilator],[https://verilator.org])
|
||||||
|
|
||||||
@@ -24,6 +24,10 @@ AC_SUBST(PACKAGE_VERSION_NUMBER)
|
|||||||
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_NUMBER_STRING],["$PACKAGE_VERSION_NUMBER"],[Package version as a number])
|
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_NUMBER_STRING],["$PACKAGE_VERSION_NUMBER"],[Package version as a number])
|
||||||
VERILATOR_VERSION_INTEGER=`AS_ECHO("$PACKAGE_VERSION") | [sed 's/\([0-9]\)\.\([0-9][0-9][0-9]\) .*/\1\2000/g']`
|
VERILATOR_VERSION_INTEGER=`AS_ECHO("$PACKAGE_VERSION") | [sed 's/\([0-9]\)\.\([0-9][0-9][0-9]\) .*/\1\2000/g']`
|
||||||
AC_SUBST(VERILATOR_VERSION_INTEGER)
|
AC_SUBST(VERILATOR_VERSION_INTEGER)
|
||||||
|
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_STRING_CHAR],
|
||||||
|
[static const char* const PACKAGE_STRING_UNUSED = "$PACKAGE_STRING";],
|
||||||
|
[Package version as a number])
|
||||||
|
AC_SUBST(PACKAGE_VERSION_STRING_CHAR)
|
||||||
|
|
||||||
# Ignore automake flags passed by Ubuntu builds
|
# Ignore automake flags passed by Ubuntu builds
|
||||||
AC_ARG_ENABLE([dependency-tracking],
|
AC_ARG_ENABLE([dependency-tracking],
|
||||||
@@ -63,20 +67,6 @@ AC_ARG_ENABLE([tcmalloc],
|
|||||||
[CFG_WITH_TCMALLOC=check;])
|
[CFG_WITH_TCMALLOC=check;])
|
||||||
AC_MSG_RESULT($CFG_WITH_TCMALLOC)
|
AC_MSG_RESULT($CFG_WITH_TCMALLOC)
|
||||||
|
|
||||||
# Flag to enable -m32 build
|
|
||||||
AC_MSG_CHECKING(whether to use -m32)
|
|
||||||
AC_ARG_ENABLE([m32],
|
|
||||||
[AS_HELP_STRING([--enable-m32],
|
|
||||||
[Use -m32 for all compilation and link,
|
|
||||||
including Verilator and generated models.])],
|
|
||||||
[case "${enableval}" in
|
|
||||||
yes) CFG_ENABLE_M32=yes ;;
|
|
||||||
no) CFG_ENABLE_M32=no ;;
|
|
||||||
*) AC_MSG_ERROR([bad value '${enableval}' for --enable-m32]) ;;
|
|
||||||
esac],
|
|
||||||
CFG_ENABLE_M32=no)
|
|
||||||
AC_MSG_RESULT($CFG_ENABLE_M32)
|
|
||||||
|
|
||||||
# Flag to enable coverage build
|
# Flag to enable coverage build
|
||||||
AC_MSG_CHECKING(whether to build for coverage collection)
|
AC_MSG_CHECKING(whether to build for coverage collection)
|
||||||
AC_ARG_ENABLE([coverage],
|
AC_ARG_ENABLE([coverage],
|
||||||
@@ -315,15 +305,7 @@ AC_DEFUN([_MY_LDLIBS_CHECK_OPT],
|
|||||||
_MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2")
|
_MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2")
|
||||||
])
|
])
|
||||||
|
|
||||||
# When using -m32. Check this first as later checks may fail with the -m32 flag.
|
# Add the coverage flags early as they influence later checks.
|
||||||
if test "$CFG_ENABLE_M32" = "yes"; then
|
|
||||||
_MY_CXX_CHECK_IFELSE(
|
|
||||||
-m32,
|
|
||||||
[CXX="$CXX -m32"],
|
|
||||||
[AC_MSG_ERROR([--enable-m32 was given but compiler does not support -m32])])
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Similarly, add the coverage flags early as they influence later checks.
|
|
||||||
if test "$CFG_ENABLE_COVERAGE" = "yes"; then
|
if test "$CFG_ENABLE_COVERAGE" = "yes"; then
|
||||||
_MY_CXX_CHECK_OPT(CXX,--coverage)
|
_MY_CXX_CHECK_OPT(CXX,--coverage)
|
||||||
# Otherwise inline may not show as uncovered
|
# Otherwise inline may not show as uncovered
|
||||||
@@ -350,7 +332,7 @@ AC_SUBST(CFG_CXXFLAGS_PROFILE)
|
|||||||
# Macros work such that first option that passes is the one we take
|
# Macros work such that first option that passes is the one we take
|
||||||
# Currently enable c++17/c++14 due to packaged SystemC dependency
|
# Currently enable c++17/c++14 due to packaged SystemC dependency
|
||||||
# c++17 is the newest that Verilator is regularly tested to support
|
# c++17 is the newest that Verilator is regularly tested to support
|
||||||
# c++11 is the oldest that Verilator supports
|
# c++14 is the oldest that Verilator supports
|
||||||
# gnu is required 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=gnu++20)
|
||||||
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++20)
|
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++20)
|
||||||
@@ -358,8 +340,6 @@ _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++17)
|
|||||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17)
|
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17)
|
||||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14)
|
_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=c++14)
|
||||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++11)
|
|
||||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++11)
|
|
||||||
AC_SUBST(CFG_CXXFLAGS_STD_NEWEST)
|
AC_SUBST(CFG_CXXFLAGS_STD_NEWEST)
|
||||||
|
|
||||||
# Flags for compiling Verilator internals including parser, and Verilated files
|
# Flags for compiling Verilator internals including parser, and Verilated files
|
||||||
@@ -371,10 +351,9 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_WEXTRA,-Wthread-safety)
|
|||||||
AC_SUBST(CFG_CXXFLAGS_WEXTRA)
|
AC_SUBST(CFG_CXXFLAGS_WEXTRA)
|
||||||
|
|
||||||
# Flags for coroutine support for dynamic scheduling
|
# Flags for coroutine support for dynamic scheduling
|
||||||
_MY_CXX_CHECK_IFELSE(
|
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts)
|
||||||
-fcoroutines-ts,
|
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines)
|
||||||
[CFG_CXXFLAGS_COROUTINES="-fcoroutines-ts"],
|
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts -Wno-deprecated-experimental-coroutine)
|
||||||
[CFG_CXXFLAGS_COROUTINES="-fcoroutines"])
|
|
||||||
AC_SUBST(CFG_CXXFLAGS_COROUTINES)
|
AC_SUBST(CFG_CXXFLAGS_COROUTINES)
|
||||||
|
|
||||||
# HAVE_COROUTINES
|
# HAVE_COROUTINES
|
||||||
@@ -442,14 +421,19 @@ m4_foreach([cflag],[
|
|||||||
[-mno-cet],
|
[-mno-cet],
|
||||||
[-Qunused-arguments],
|
[-Qunused-arguments],
|
||||||
[-Wno-bool-operation],
|
[-Wno-bool-operation],
|
||||||
[-Wno-tautological-bitwise-compare],
|
[-Wno-c++11-narrowing],
|
||||||
|
[-Wno-constant-logical-operand],
|
||||||
|
[-Wno-non-pod-varargs],
|
||||||
[-Wno-parentheses-equality],
|
[-Wno-parentheses-equality],
|
||||||
|
[-Wno-shadow],
|
||||||
[-Wno-sign-compare],
|
[-Wno-sign-compare],
|
||||||
|
[-Wno-tautological-bitwise-compare],
|
||||||
|
[-Wno-tautological-compare],
|
||||||
[-Wno-uninitialized],
|
[-Wno-uninitialized],
|
||||||
|
[-Wno-unused-but-set-parameter],
|
||||||
[-Wno-unused-but-set-variable],
|
[-Wno-unused-but-set-variable],
|
||||||
[-Wno-unused-parameter],
|
[-Wno-unused-parameter],
|
||||||
[-Wno-unused-variable],
|
[-Wno-unused-variable]],[
|
||||||
[-Wno-shadow]],[
|
|
||||||
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag)
|
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag)
|
||||||
# CMake will test what flags work itself, so pass all flags through to it
|
# CMake will test what flags work itself, so pass all flags through to it
|
||||||
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag"
|
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag"
|
||||||
@@ -491,6 +475,7 @@ AC_SUBST(CFG_LDFLAGS_VERILATED)
|
|||||||
# pthreads is harmless otherwise.
|
# pthreads is harmless otherwise.
|
||||||
CFG_LIBS="$LIBS $CFG_LIBS"
|
CFG_LIBS="$LIBS $CFG_LIBS"
|
||||||
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread)
|
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread)
|
||||||
|
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -latomic)
|
||||||
|
|
||||||
# Check libraries for MingW
|
# Check libraries for MingW
|
||||||
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt)
|
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt)
|
||||||
@@ -513,14 +498,14 @@ _MY_LDLIBS_CHECK_IFELSE(
|
|||||||
fi])
|
fi])
|
||||||
AC_SUBST(CFG_LIBS)
|
AC_SUBST(CFG_LIBS)
|
||||||
|
|
||||||
# Need C++11 at least
|
# Need C++14 at least
|
||||||
#Alternative: AX_CXX_COMPILE_STDCXX([11])
|
#Alternative: AX_CXX_COMPILE_STDCXX([14])
|
||||||
AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
|
AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
|
||||||
[# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++11
|
[# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++14
|
||||||
# Set $_my_result
|
# Set $_my_result
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
[AC_LANG_PROGRAM([#include <thread>
|
[AC_LANG_PROGRAM([#include <thread>
|
||||||
#if (__cplusplus < 201103L)
|
#if (__cplusplus < 201402L)
|
||||||
# error "Too old"
|
# error "Too old"
|
||||||
#endif
|
#endif
|
||||||
], [[ ]])],
|
], [[ ]])],
|
||||||
@@ -536,13 +521,13 @@ AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
|
|||||||
# Add $CFG_CXXFLAGS_STD only if can't compile correctly otherwise,
|
# 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.
|
# as adding std= when not needed can cause errors with the C++ std library.
|
||||||
CFG_CXXFLAGS_STD=$CFG_CXXFLAGS_STD_NEWEST
|
CFG_CXXFLAGS_STD=$CFG_CXXFLAGS_STD_NEWEST
|
||||||
AC_MSG_CHECKING(whether $CXX supports C++11)
|
AC_MSG_CHECKING(whether $CXX supports C++14)
|
||||||
_MY_CXX_CHECK_CXX_VER()
|
_MY_CXX_CHECK_CXX_VER()
|
||||||
AC_MSG_RESULT($_my_result)
|
AC_MSG_RESULT($_my_result)
|
||||||
if test "$_my_result" = "no" ; then
|
if test "$_my_result" = "no" ; then
|
||||||
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD"
|
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD"
|
||||||
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE $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)
|
AC_MSG_CHECKING(whether $CXX supports C++14 with $CFG_CXXFLAGS_STD)
|
||||||
_MY_CXX_CHECK_CXX_VER()
|
_MY_CXX_CHECK_CXX_VER()
|
||||||
AC_MSG_RESULT($_my_result)
|
AC_MSG_RESULT($_my_result)
|
||||||
else
|
else
|
||||||
@@ -552,13 +537,28 @@ else
|
|||||||
fi
|
fi
|
||||||
if test "$_my_result" = "no" ; then
|
if test "$_my_result" = "no" ; then
|
||||||
AC_MSG_NOTICE([[]])
|
AC_MSG_NOTICE([[]])
|
||||||
AC_MSG_ERROR([[the $CXX compiler appears to not support C++11.
|
AC_MSG_ERROR([[the $CXX compiler appears to not support C++14.
|
||||||
|
|
||||||
Verilator requires a C++11 or newer compiler.]])
|
Verilator requires a C++14 or newer compiler.]])
|
||||||
|
|
||||||
fi
|
fi
|
||||||
AC_SUBST(CFG_CXXFLAGS_STD)
|
AC_SUBST(CFG_CXXFLAGS_STD)
|
||||||
|
|
||||||
|
# Compiler precompiled header options (assumes either gcc or clang++)
|
||||||
|
AC_MSG_CHECKING([for $CXX precompile header include option])
|
||||||
|
if $CXX --help | grep include-pch >/dev/null 2>/dev/null ; then
|
||||||
|
# clang
|
||||||
|
CFG_CXXFLAGS_PCH_I=-include-pch
|
||||||
|
CFG_GCH_IF_CLANG=.gch
|
||||||
|
else
|
||||||
|
# GCC
|
||||||
|
CFG_CXXFLAGS_PCH_I=-include
|
||||||
|
CFG_GCH_IF_CLANG=
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($CFG_CXXFLAGS_PCH_I)
|
||||||
|
AC_SUBST(CFG_CXXFLAGS_PCH_I)
|
||||||
|
AC_SUBST(CFG_GCH_IF_CLANG)
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
|
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
|
||||||
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])],
|
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])],
|
||||||
@@ -573,7 +573,7 @@ ACO_SAVE_LIBS="$LIBS"
|
|||||||
LIBS="$LIBS -lsystemc"
|
LIBS="$LIBS -lsystemc"
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
[AC_LANG_PROGRAM([[#include <systemc.h>
|
[AC_LANG_PROGRAM([[#include <systemc.h>
|
||||||
extern "C" int sc_main(int argc, char* argv[]) {}
|
extern "C" int sc_main(int argc, char* argv[]) { return 0; }
|
||||||
]],[[sc_version()]])],
|
]],[[sc_version()]])],
|
||||||
[_my_result=yes
|
[_my_result=yes
|
||||||
AC_DEFINE([HAVE_SYSTEMC],[1],[Defined if have SystemC library])],
|
AC_DEFINE([HAVE_SYSTEMC],[1],[Defined if have SystemC library])],
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ under the Developer Certificate of Origin (https://developercertificate.org/).
|
|||||||
Please see the Verilator manual for 200+ additional contributors. Thanks to all.
|
Please see the Verilator manual for 200+ additional contributors. Thanks to all.
|
||||||
|
|
||||||
Adam Bagley
|
Adam Bagley
|
||||||
|
Adrian Sampson
|
||||||
Adrien Le Masle
|
Adrien Le Masle
|
||||||
Ahmed El-Mahmoudy
|
Ahmed El-Mahmoudy
|
||||||
Aleksander Kiryk
|
Aleksander Kiryk
|
||||||
@@ -18,13 +19,17 @@ Andrew Nolte
|
|||||||
Anthony Donlon
|
Anthony Donlon
|
||||||
Arkadiusz Kozdra
|
Arkadiusz Kozdra
|
||||||
Aylon Chaim Porat
|
Aylon Chaim Porat
|
||||||
|
Bartłomiej Chmiel
|
||||||
Cameron Kirk
|
Cameron Kirk
|
||||||
|
Chih-Mao Chen
|
||||||
Chris Randall
|
Chris Randall
|
||||||
Chuxuan Wang
|
Chuxuan Wang
|
||||||
|
Chykon
|
||||||
Conor McCullough
|
Conor McCullough
|
||||||
Dan Petrisko
|
Dan Petrisko
|
||||||
Daniel Bates
|
Daniel Bates
|
||||||
David Horton
|
David Horton
|
||||||
|
David Ledger
|
||||||
David Metz
|
David Metz
|
||||||
David Stanford
|
David Stanford
|
||||||
David Turner
|
David Turner
|
||||||
@@ -40,6 +45,8 @@ Fan Shupei
|
|||||||
february cozzocrea
|
february cozzocrea
|
||||||
Felix Neumärker
|
Felix Neumärker
|
||||||
Felix Yan
|
Felix Yan
|
||||||
|
Frans Skarman
|
||||||
|
Fuad Ismail
|
||||||
G-A. Kamendje
|
G-A. Kamendje
|
||||||
Garrett Smith
|
Garrett Smith
|
||||||
Geza Lore
|
Geza Lore
|
||||||
@@ -48,6 +55,7 @@ Glen Gibb
|
|||||||
Gökçe Aydos
|
Gökçe Aydos
|
||||||
Graham Rushton
|
Graham Rushton
|
||||||
Guokai Chen
|
Guokai Chen
|
||||||
|
Gus Smith
|
||||||
Gustav Svensk
|
Gustav Svensk
|
||||||
Harald Heckmann
|
Harald Heckmann
|
||||||
Hennadii Chernyshchyk
|
Hennadii Chernyshchyk
|
||||||
@@ -56,6 +64,7 @@ Huang Rui
|
|||||||
Huanghuang Zhou
|
Huanghuang Zhou
|
||||||
HungMingWu
|
HungMingWu
|
||||||
HyungKi Jeong
|
HyungKi Jeong
|
||||||
|
Ícaro Lima
|
||||||
Ilya Barkov
|
Ilya Barkov
|
||||||
Iru Cai
|
Iru Cai
|
||||||
Ivan Vnučec
|
Ivan Vnučec
|
||||||
@@ -68,18 +77,22 @@ James Shi
|
|||||||
Jamey Hicks
|
Jamey Hicks
|
||||||
Jamie Iles
|
Jamie Iles
|
||||||
Jan Van Winkel
|
Jan Van Winkel
|
||||||
|
Jiangjie Weng
|
||||||
Jean Berniolles
|
Jean Berniolles
|
||||||
Jeremy Bennett
|
Jeremy Bennett
|
||||||
Jesse Taube
|
Jesse Taube
|
||||||
Jevin Sweval
|
Jevin Sweval
|
||||||
Jiacheng Qian
|
Jiacheng Qian
|
||||||
Jiamin Zhu
|
Jiamin Zhu
|
||||||
|
Jinyan Xu
|
||||||
Jiuyang Liu
|
Jiuyang Liu
|
||||||
Joey Liu
|
Joey Liu
|
||||||
John Coiner
|
John Coiner
|
||||||
John Demme
|
John Demme
|
||||||
John Wehle
|
John Wehle
|
||||||
Jonathan Drolet
|
Jonathan Drolet
|
||||||
|
Jonathan Schröter
|
||||||
|
Jordan McConnon
|
||||||
Jose Loyola
|
Jose Loyola
|
||||||
Josep Sans
|
Josep Sans
|
||||||
Joseph Nwabueze
|
Joseph Nwabueze
|
||||||
@@ -87,11 +100,14 @@ Josh Redford
|
|||||||
Julian Daube
|
Julian Daube
|
||||||
Julie Schwartz
|
Julie Schwartz
|
||||||
Julien Margetts
|
Julien Margetts
|
||||||
|
Justin Thiel
|
||||||
Kaleb Barrett
|
Kaleb Barrett
|
||||||
Kamil Rakoczy
|
Kamil Rakoczy
|
||||||
Kanad Kanhere
|
Kanad Kanhere
|
||||||
|
Kefa Chen
|
||||||
Keith Colbert
|
Keith Colbert
|
||||||
Kevin Kiningham
|
Kevin Kiningham
|
||||||
|
Kevin Nygaard
|
||||||
Kritik Bhimani
|
Kritik Bhimani
|
||||||
Krzysztof Bieganski
|
Krzysztof Bieganski
|
||||||
Krzysztof Boronski
|
Krzysztof Boronski
|
||||||
@@ -113,6 +129,7 @@ Martin Stadler
|
|||||||
Matthew Ballance
|
Matthew Ballance
|
||||||
Michael Killough
|
Michael Killough
|
||||||
Michaël Lefebvre
|
Michaël Lefebvre
|
||||||
|
Michal Czyz
|
||||||
Mike Popoloski
|
Mike Popoloski
|
||||||
Miodrag Milanović
|
Miodrag Milanović
|
||||||
Mladen Slijepcevic
|
Mladen Slijepcevic
|
||||||
@@ -121,10 +138,13 @@ Mostafa Gamal
|
|||||||
Nandu Raj
|
Nandu Raj
|
||||||
Nathan Kohagen
|
Nathan Kohagen
|
||||||
Nathan Myers
|
Nathan Myers
|
||||||
|
Nolan Poe
|
||||||
Oleh Maksymenko
|
Oleh Maksymenko
|
||||||
Patrick Stewart
|
Patrick Stewart
|
||||||
|
Paul Swirhun
|
||||||
Paul Wright
|
Paul Wright
|
||||||
Pawel Sagan
|
Pawel Sagan
|
||||||
|
Pengcheng Xu
|
||||||
Peter Debacker
|
Peter Debacker
|
||||||
Peter Horvath
|
Peter Horvath
|
||||||
Peter Monsson
|
Peter Monsson
|
||||||
@@ -133,7 +153,9 @@ Pierre-Henri Horrein
|
|||||||
Pieter Kapsenberg
|
Pieter Kapsenberg
|
||||||
Piotr Binkowski
|
Piotr Binkowski
|
||||||
Qingyao Sun
|
Qingyao Sun
|
||||||
|
Quentin Corradi
|
||||||
Rafal Kapuscik
|
Rafal Kapuscik
|
||||||
|
Rasfunk
|
||||||
Raynard Qiao
|
Raynard Qiao
|
||||||
Richard Myers
|
Richard Myers
|
||||||
Risto Pejašinović
|
Risto Pejašinović
|
||||||
@@ -148,6 +170,7 @@ Srinivasan Venkataramanan
|
|||||||
Stefan Wallentowitz
|
Stefan Wallentowitz
|
||||||
Stephen Henry
|
Stephen Henry
|
||||||
Steven Hugg
|
Steven Hugg
|
||||||
|
Szymon Gizler
|
||||||
Sören Tempel
|
Sören Tempel
|
||||||
Teng Huang
|
Teng Huang
|
||||||
Tim Hutt
|
Tim Hutt
|
||||||
@@ -170,6 +193,7 @@ Vito Gamberini
|
|||||||
William D. Jones
|
William D. Jones
|
||||||
Wilson Snyder
|
Wilson Snyder
|
||||||
Xi Zhang
|
Xi Zhang
|
||||||
|
Yan Xu
|
||||||
Yinan Xu
|
Yinan Xu
|
||||||
Yoda Lee
|
Yoda Lee
|
||||||
Yossi Nivin
|
Yossi Nivin
|
||||||
@@ -178,5 +202,6 @@ Yuri Victorovich
|
|||||||
Yutetsu TAKATSUKASA
|
Yutetsu TAKATSUKASA
|
||||||
Yves Mathieu
|
Yves Mathieu
|
||||||
Zhanglei Wang
|
Zhanglei Wang
|
||||||
|
Zhou Shen
|
||||||
Zixi Li
|
Zixi Li
|
||||||
أحمد المحمودي
|
أحمد المحمودي
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
# Code available from: https://verilator.org
|
# Code available from: https://verilator.org
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
Verilator Documentation
|
||||||
|
=======================
|
||||||
|
|
||||||
|
This folder contains sources for Verilator documentation.
|
||||||
|
|
||||||
|
For formatted documentation see:
|
||||||
|
|
||||||
|
- `Verilator README <https://github.com/verilator/verilator>`_
|
||||||
|
|
||||||
|
- `Verilator installation and package directory structure
|
||||||
|
<https://verilator.org/install>`_
|
||||||
|
|
||||||
|
- `Verilator manual (HTML) <https://verilator.org/verilator_doc.html>`_,
|
||||||
|
or `Verilator manual (PDF) <https://verilator.org/verilator_doc.pdf>`_
|
||||||
|
|
||||||
|
- `Subscribe to Verilator announcements
|
||||||
|
<https://github.com/verilator/verilator-announce>`_
|
||||||
|
|
||||||
|
- `Verilator forum <https://verilator.org/forum>`_
|
||||||
|
|
||||||
|
- `Verilator issues <https://verilator.org/issues>`_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# pylint: disable=C0112,C0114,C0115,C0116,C0209,C0301,R0201,R0903
|
# pylint: disable=C0112,C0114,C0115,C0116,C0209,C0301,R0903
|
||||||
# -*- Python -*- See copyright, etc below
|
# -*- Python -*- See copyright, etc below
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ parser = argparse.ArgumentParser(
|
|||||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
description="""Read a file and extract documentation data.""",
|
description="""Read a file and extract documentation data.""",
|
||||||
epilog=
|
epilog=
|
||||||
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
|
""" Copyright 2021-2024 by Wilson Snyder. This package is free software;
|
||||||
you can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ parser = argparse.ArgumentParser(
|
|||||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
description="""Post-process Sphinx HTML.""",
|
description="""Post-process Sphinx HTML.""",
|
||||||
epilog=
|
epilog=
|
||||||
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
|
""" Copyright 2021-2024 by Wilson Snyder. This package is free software;
|
||||||
you can redistribute it and/or modify it under the terms of either the GNU
|
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
|
Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
Version 2.0.
|
Version 2.0.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
****************
|
****************
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
# pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622
|
# pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622
|
||||||
#
|
#
|
||||||
# Configuration file for Verilator's Sphinx documentation builder.
|
# Configuration file for Verilator's Sphinx documentation builder.
|
||||||
# Copyright 2003-2023 by Wilson Snyder.
|
# Copyright 2003-2024 by Wilson Snyder.
|
||||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
#
|
#
|
||||||
# This file only contains overridden options. For a full list:
|
# This file only contains overridden options. For a full list:
|
||||||
@@ -45,7 +45,7 @@ def setup(app):
|
|||||||
# -- Project information
|
# -- Project information
|
||||||
|
|
||||||
project = 'Verilator'
|
project = 'Verilator'
|
||||||
copyright = '2022 by Wilson Snyder, under LGPL-3.0 or Artistic-2.0'
|
copyright = '2024 by Wilson Snyder, under LGPL-3.0 or Artistic-2.0'
|
||||||
author = 'Wilson Snyder'
|
author = 'Wilson Snyder'
|
||||||
|
|
||||||
# The master toctree document.
|
# The master toctree document.
|
||||||
@@ -230,4 +230,4 @@ spelling_ignore_contributor_names = True
|
|||||||
|
|
||||||
breathe_projects = {"verilated": "_build/doxygen/verilated/xml/"}
|
breathe_projects = {"verilated": "_build/doxygen/verilated/xml/"}
|
||||||
breathe_default_project = "verilated"
|
breathe_default_project = "verilated"
|
||||||
breathe_default_members = ('members')
|
breathe_default_members = 'members'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Connecting:
|
.. _Connecting:
|
||||||
@@ -128,6 +128,43 @@ in the distribution. These headers use Doxygen comments, `///` and `//<`,
|
|||||||
to indicate and document those functions that are part of the Verilated
|
to indicate and document those functions that are part of the Verilated
|
||||||
public API.
|
public API.
|
||||||
|
|
||||||
|
Process-Level Clone APIs
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Modern operating systems support process-level clone (a.k.a copying, forking)
|
||||||
|
with system call interfaces in C/C++, e.g., :code:`fork()` in Linux.
|
||||||
|
|
||||||
|
However, after cloning a parent process, some resources cannot be inherited
|
||||||
|
in the child process. For example, in POSIX systems, when you fork a process,
|
||||||
|
the child process inherits all the memory of the parent process. However,
|
||||||
|
only the thread that called fork is replicated in the child process. Other
|
||||||
|
threads are not.
|
||||||
|
|
||||||
|
Therefore, to support the process-level clone mechanisms, Verilator supports
|
||||||
|
:code:`prepareClone()` and :code:`atClone()` APIs to allow the user to manually
|
||||||
|
re-construct the model in the child process. The two APIs handle all necessary
|
||||||
|
resources required for releasing and re-initializing before and after cloning.
|
||||||
|
|
||||||
|
The two APIs are supported in the verilated models. Here is an example of usage
|
||||||
|
with Linux :code:`fork()` and :code:`pthread_atfork` APIs:
|
||||||
|
|
||||||
|
.. code-block:: C++
|
||||||
|
|
||||||
|
// static function pointers to fit pthread_atfork
|
||||||
|
static auto prepareClone = [](){ topp->prepareClone(); };
|
||||||
|
static auto atClone = [](){ topp->atClone(); };
|
||||||
|
|
||||||
|
// in main function, register the handlers:
|
||||||
|
pthread_atfork(prepareClone, atClone, atClone);
|
||||||
|
|
||||||
|
For better flexibility, you can also manually call the handlers before and
|
||||||
|
after :code:`fork()`.
|
||||||
|
|
||||||
|
With the process-level clone APIs, users can create process-level snapshots
|
||||||
|
for the verilated models. While the Verilator save/restore option provides
|
||||||
|
persistent and circuit-dependent snapshots, the process-level clone APIs
|
||||||
|
enable in-memory, circuit-transparent, and highly efficient snapshots.
|
||||||
|
|
||||||
|
|
||||||
Direct Programming Interface (DPI)
|
Direct Programming Interface (DPI)
|
||||||
==================================
|
==================================
|
||||||
@@ -463,7 +500,7 @@ the user should call:
|
|||||||
any delayed events pending,
|
any delayed events pending,
|
||||||
* :code:`designp->nextTimeSlot()`, which returns the simulation time of the
|
* :code:`designp->nextTimeSlot()`, which returns the simulation time of the
|
||||||
next delayed event. This method can only be called if
|
next delayed event. This method can only be called if
|
||||||
:code:`designp->nextTimeSlot()` returned :code:`true`.
|
:code:`designp->eventsPending()` returned :code:`true`.
|
||||||
|
|
||||||
Call :code:`eventsPending()` to check if you should continue with the
|
Call :code:`eventsPending()` to check if you should continue with the
|
||||||
simulation, and then :code:`nextTimeSlot()` to move simulation time forward.
|
simulation, and then :code:`nextTimeSlot()` to move simulation time forward.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
*******************************
|
*******************************
|
||||||
|
|||||||
+122
-92
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
************************
|
************************
|
||||||
@@ -27,107 +27,137 @@ Alliance <https://chipsalliance.org>`_, `Antmicro Ltd
|
|||||||
<https://antmicro.com>`_ and `Shunyao CAD <https://shunyaocad.com>`_.
|
<https://antmicro.com>`_ and `Shunyao CAD <https://shunyaocad.com>`_.
|
||||||
|
|
||||||
Previous major corporate sponsors of Verilator, by providing significant
|
Previous major corporate sponsors of Verilator, by providing significant
|
||||||
contributions of time or funds include: Atmel Corporation, Cavium
|
contributions of time or funds include: Antmicro Ltd., Atmel Corporation,
|
||||||
Inc., Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd.,
|
Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd., Hicamp
|
||||||
Hicamp Systems, Intel Corporation, Mindspeed Technologies Inc., MicroTune
|
Systems, Intel Corporation, Marvell Inc., Mindspeed Technologies Inc.,
|
||||||
Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus Networks Inc.,
|
MicroTune Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus
|
||||||
SiCortex Inc, and Shunyao CAD.
|
Networks Inc., SiCortex Inc, Shunyao CAD, and Western Digital Inc.
|
||||||
|
|
||||||
The contributors of major functionality are: Krzysztof
|
The contributors of major functionality are: Jeremy Bennett, Krzysztof
|
||||||
Bieganski, Byron Bradley, Jeremy Bennett, Lane Brooks, John Coiner, Duane
|
Bieganski, Byron Bradley, Lane Brooks, John Coiner, Duane Galbi, Geza Lore,
|
||||||
Galbi, Geza Lore, Todd Strader, Stefan Wallentowitz, Paul Wasson, Jie Xu,
|
Todd Strader, Yutetsu Takatsukasa, Stefan Wallentowitz, Paul Wasson, Jie
|
||||||
and Wilson Snyder. Major testers included Jeff Dutton, Jonathon Donaldson,
|
Xu, and Wilson Snyder.
|
||||||
Ralf Karge, David Hewson, Iztok Jeras, Wim Michiels, Alex Solomatnikov,
|
|
||||||
Sebastien Van Cauwenberghe, Gene Weber, and Clifford Wolf.
|
|
||||||
|
|
||||||
Some of the people who have provided ideas, and feedback for Verilator
|
Some of the people who have provided ideas, and feedback for Verilator
|
||||||
include:
|
include:
|
||||||
|
|
||||||
David Addison, Tariq B. Ahmad, Nikana Anastasiadis, Vasu Arasanipalai, Jens
|
David Addison, Tariq B. Ahmad, Nikana Anastasiadis, John David Anglin,
|
||||||
Arm, Sharad Bagri, Matthew Ballance, Andrew Bardsley, Matthew Barr, Geoff
|
Frederic Antonin, Hans Van Antwerpen, Vasu Arasanipalai, Jens Arm, Rohan
|
||||||
Barrett, Kaleb Barrett, Julius Baxter, Jeremy Bennett, Michael Berman, Jean
|
Arshid, Gökçe Aydos, Adam Bagley, Sharad Bagri, Robert Balas, Marco
|
||||||
Berniolles, Victor Besyakov, Moinak Bhattacharyya, Krzysztof Bieganski,
|
Balboni, Matthew Ballance, Andrew Bardsley, Ilya Barkov, Matthew Barr,
|
||||||
David Binderman, Piotr Binkowski, Johan Bjork, David Black, Tymoteusz
|
Geoff Barrett, Kaleb Barrett, Daniel Bates, Julius Baxter, Michael Berman,
|
||||||
Blazejczyk, Daniel Bone, Gregg Bouchard, Christopher Boumenot, Nick Bowler,
|
Jean Berniolles, Victor Besyakov, Narayan Bhagavatula, Moinak
|
||||||
Byron Bradley, Bryan Brady, Maarten De Braekeleer, Charlie Brej, J Briquet,
|
Bhattacharyya, Kritik Bhimani, David Biancolin, David Binderman, Piotr
|
||||||
Lane Brooks, John Brownlee, Jeff Bush, Lawrence Butcher, Tony Bybell, Iru
|
Binkowski, Johan Björk, David Black, Tymoteusz Blazejczyk, Scott Bleiweiss,
|
||||||
Cai, Ted Campbell, Chris Candler, Lauren Carlson, Donal Casey, Alex
|
David van der Bokke, Daniel Bone, Guy Bonneau, Krzysztof Boroński, Gregg
|
||||||
Chadwick, Marcel Chang, Aliaksei Chapyzhenka, Guokai Chen, Terry Chen,
|
Bouchard, Christopher Boumenot, Nick Bowler, Bryan Brady, Maarten De
|
||||||
Yi-Chung Chen, Enzo Chi, Robert A. Clark, Ryan Clarke, Allan Cochrane, John
|
Braekeleer, Charlie Brej, J Briquet, John Brownlee, KC Buckenmaier, Jeff
|
||||||
Coiner, Keith Colbert, Gianfranco Costamagna, Sean Cross, George Cuan, Joe
|
Bush, Lawrence Butcher, Tony Bybell, Iru Cai, Ted Campbell, Anthony Campos,
|
||||||
DErrico, Lukasz Dalek, Gunter Dannoritzer, Ashutosh Das, Bernard Deadman,
|
Chris Candler, Lauren Carlson, Gregory Carver, Donal Casey, Sebastien Van
|
||||||
John Demme, Mike Denio, John Deroo, Philip Derrick, John Dickol, Ruben
|
Cauwenberghe, Alex Chadwick, Greg Chadwick, Marcel Chang, Aliaksei
|
||||||
Diez, Danny Ding, Jacko Dirks, Ivan Djordjevic, Jonathon Donaldson, Larry
|
Chapyzhenka, Chih-Mao Chen, Guokai Chen, Terry Chen, Yi-Chung Chen, Yurii
|
||||||
Doolittle, Sebastian Dressler, Jonathan Drolet, Alex Duller, Jeff Dutton,
|
Cherkasov, Hennadii Chernyshchyk, Enzo Chi, Robert A. Clark, Ryan Clarke,
|
||||||
Tomas Dzetkulic, Usuario Eda, Charles Eddleston, Chandan Egbert, Joe Eiler,
|
Allan Cochrane, Keith Colbert, Quentin Corradi, Nassim Corteggiani,
|
||||||
Ahmed El-Mahmoudy, Trevor Elbourne, Mats Engstrom, Robert Farrell, Eugen
|
Gianfranco Costamagna, February Cozzocrea, Sean Cross, George Cuan, Michal
|
||||||
Fekete, Fabrizio Ferrandi, Udi Finkelstein, Brian Flachs, Bill Flynn,
|
Czyz, Joe DErrico, Jim Dai, Lukasz Dalek, Laurens van Dam, Gunter
|
||||||
Andrea Foletto, Bob Fredieu, Duane Galbi, Mostafa Gamal, Benjamin Gartner,
|
Dannoritzer, Ashutosh Das, Julian Daube, Bernard Deadman, Peter Debacker,
|
||||||
Christian Gelinek, Richard E George, Peter Gerst, Glen Gibb, Michael
|
John Demme, Mike Denio, John Deroo, Philip Derrick, Aadi Desai, John
|
||||||
Gielda, Barbara Gigerl, Shankar Giri, Dan Gisselquist, Petr Gladkikh, Sam
|
Dickol, Ruben Diez, Danny Ding, Jacko Dirks, Ivan Djordjevic, Brad Dobbie,
|
||||||
Gladstone, Mariusz Glebocki, Andrew Goessling, Amir Gonnen, Chitlesh
|
Paul Donahue, Jonathon Donaldson, Anthony Donlon, Caleb Donovick, Larry
|
||||||
Goorah, Tomasz Gorochowik, Kai Gossner, Sergi Granell, Al Grant, Nathan
|
Doolittle, Leendert van Doorn, Sebastian Dressler, Jonathan Drolet, Maciej
|
||||||
Graybeal, Alexander Grobman, Graham Rushton, Xuan Guo, Driss Hafdi, Neil
|
Dudek, Alex Duller, Jeff Dutton, Tomas Dzetkulic, Usuario Eda, Charles
|
||||||
Hamilton, James Hanlon, Oyvind Harboe, Jannis Harder, Junji Hashimoto,
|
Eddleston, Chandan Egbert, Joe Eiler, Ahmed El-Mahmoudy, Trevor Elbourne,
|
||||||
Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert Henry, Stephen
|
Mats Engstrom, Robert Farrell, Julien Faucher, Olivier Faure, Eugen Fekete,
|
||||||
Henry, David Hewson, Jamey Hicks, Joel Holdsworth, Andrew Holme, Hiroki
|
Fabrizio Ferrandi, Udi Finkelstein, Brian Flachs, Bill Flynn, Andrea
|
||||||
Honda, Alex Hornung, Pierre-Henri Horrein, David Horton, Peter Horvath, Jae
|
Foletto, Alex Forencich, Aurelien Francillon, Bob Fredieu, Manuel
|
||||||
Hossell, Kuoping Hsu, Teng Huang, Steven Hugg, Alan Hunter, James
|
Freiberger, Mostafa Gamal, Vito Gamberini, Mostafa Garnal, Benjamin
|
||||||
Hutchinson, Ehab Ibrahim, Edgar E. Iglesias, Jamie Iles, Vighnesh Iyer, Ben
|
Gartner, Christian Gelinek, Richard E George, Peter Gerst, Glen Gibb,
|
||||||
Jackson, Shareef Jalloq, Marlon James, Krzysztof Jankowski, HyungKi Jeong,
|
Michael Gielda, Barbara Gigerl, Nimrod Gileadi, Shankar Giri, Dan
|
||||||
Iztok Jeras, Alexandre Joannou, James Johnson, Christophe Joly, Franck
|
Gisselquist, Petr Gladkikh, Sam Gladstone, Mariusz Glebocki, Embedded Go,
|
||||||
Jullien, James Jung, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand
|
Andrew Goessling, Amir Gonnen, Chitlesh Goorah, Tomasz Gorochowik, Kai
|
||||||
|
Gossner, Tarik Graba, Sergi Granell, Al Grant, Nathan Graybeal, Alexander
|
||||||
|
Grobman, Qian Gu, Xuan Guo, Prabhat Gupta, Driss Hafdi, Neil Hamilton,
|
||||||
|
James Hanlon, Tang Haojin, Øyvind Harboe, Jannis Harder, David Harris,
|
||||||
|
Junji Hashimoto, Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert
|
||||||
|
Henry, Stephen Henry, Sebastian Hesselbarth, David Hewson, Jamey Hicks,
|
||||||
|
Joel Holdsworth, Andrew Holme, Peter Holmes, Hiroki Honda, Alex Hornung,
|
||||||
|
Pierre-Henri Horrein, David Horton, Peter Horvath, Jae Hossell, Kuoping
|
||||||
|
Hsu, Teng Huang, Steven Hugg, Huanghuang Zhou, Alan Hunter, James
|
||||||
|
Hutchinson, Tim Hutt, Ehab Ibrahim, Edgar E. Iglesias, Shahid Ikram, Jamie
|
||||||
|
Iles, Vighnesh Iyer, Ben Jackson, Daniel Jacques, Shareef Jalloq, Marlon
|
||||||
|
James, Krzysztof Jankowski, Eyck Jentzsch, HyungKi Jeong, Iztok Jeras,
|
||||||
|
Alexandre Joannou, James Johnson, Christophe Joly, Justin Jones,
|
||||||
|
William D. Jones, Larry Darryl Lee Jr., Franck Jullien, James Jung,
|
||||||
|
Yoshitomo Kaneda, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand
|
||||||
Kamendje, Vasu Kandadi, Kanad Kanhere, Patricio Kaplan, Pieter Kapsenberg,
|
Kamendje, Vasu Kandadi, Kanad Kanhere, Patricio Kaplan, Pieter Kapsenberg,
|
||||||
Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol Katzman, Ian
|
Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol Katzman, Ian
|
||||||
Kennedy, Michael Killough, Sun Kim, Jonathan Kimmitt, Olof Kindgren, Kevin
|
Kennedy, Ami Keren, Michael Killough, Sun Kim, Jonathan Kimmitt, Olof
|
||||||
Kiningham, Dan Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack
|
Kindgren, Kevin Kiningham, Cameron Kirk, Dan Kirkham, Aleksander Kiryk,
|
||||||
Koenig, Soon Koh, Nathan Kohagen, Steve Kolecki, Brett Koonce, Will
|
Sobhan Klnv, Gernot Koch, Jack Koenig, Soon Koh, Nathan Kohagen, Steve
|
||||||
Korteland, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus
|
Kolecki, Brett Koonce, Will Korteland, Andrei Kostovski, Wojciech Koszek,
|
||||||
Krause, David Kravitz, Roland Kruse, Andreas Kuster, Sergey Kvachonok,
|
Varun Koyyalagunta, Arkadiusz Kozdra, Markus Krause, David Kravitz, Adam
|
||||||
Charles Eric LaForest, Ed Lander, Steve Lang, Stephane Laurent, Walter
|
Krolnik, Roland Kruse, Mahesh Kumashikar, Andreas Kuster, Sergey Kvachonok,
|
||||||
Lavino, Christian Leber, Larry Lee, Yoda Lee, Michaël Lefebvre, Igor Lesik,
|
Charles Eric LaForest, Kevin Laeufer, Ed Lander, Steve Lang, Pierre
|
||||||
John Li, Eivind Liland, Yu Sheng Lin, Charlie Lind, Andrew Ling, Jiuyang
|
Laroche, Stephane Laurent, Walter Lavino, Christian Leber, David Ledger,
|
||||||
Liu, Paul Liu, Derek Lockhart, Jake Longo, Geza Lore, Arthur Low, Stefan
|
Alex Lee, Larry Lee, Yoda Lee, Michaël Lefebvre, Dag Lem, Igor Lesik, John
|
||||||
Ludwig, Dan Lussier, Fred Ma, Duraid Madina, Affe Mao, Julien Margetts,
|
Li, Kay Li, Zixi Li, Davide Libenzi, Nandor Licker, Eivind Liland, Ícaro
|
||||||
|
Lima, Kevin Lin, Yu-Sheng Lin, Charlie Lind, Andrew Ling, Jiuyang Liu, Joey
|
||||||
|
Liu, Paul Liu, Derek Lockhart, Jake Longo, Arthur Low, Jose Loyola, Stefan
|
||||||
|
Ludwig, Dan Lussier, Konstantin Lübeck, Fred Ma, Liwei Ma, Duraid Madina,
|
||||||
|
Oleh Maksymenko, Affe Mao, Julien Margetts, Chick Markley, Alexis Marquet,
|
||||||
Mark Marshall, Alfonso Martinez, Unai Martinez-Corral, Adrien Le Masle,
|
Mark Marshall, Alfonso Martinez, Unai Martinez-Corral, Adrien Le Masle,
|
||||||
Yves Mathieu, Patrick Maupin, Conor McCullough, Jason McMullan, Elliot
|
Yves Mathieu, Vladimir Matveyenko, Patrick Maupin, Stan Mayer, Conor
|
||||||
Mednick, David Metz, Wim Michiels, Miodrag Milanovic, Kevin Millis, Wai Sum
|
McCullough, Jason McMullan, Elliot Mednick, Yuan Mei, Andy Meier,
|
||||||
Mong, Peter Monsson, Sean Moore, Dennis Muhlestein, John Murphy, Matt
|
Rodrigo A. Melo, Benjamin Menküc, Jake Merdich, David Metz, Wim Michiels,
|
||||||
Myers, Nathan Myers, Richard Myers, Dimitris Nalbantis, Peter Nelson, Bob
|
Miodrag Milanović, Darryl Miles, Kevin Millis, Andrew Miloradovsky, Wai Sum
|
||||||
Newgard, Rachit Nigam, Paul Nitza, Yossi Nivin, Pete Nixon, Lisa Noack,
|
Mong, Peter Monsson, Sean Moore, Stuart Morris, Dennis Muhlestein, John
|
||||||
Mark Nodine, Kuba Ober, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman,
|
Murphy, Matt Myers, Nathan Myers, Richard Myers, Alex Mykyta, Dimitris
|
||||||
Don Owen, James Pallister, Vassilis Papaefstathiou, Brad Parker, Morten
|
Nalbantis, Peter Nelson, Felix Neumärker, Bob Newgard, Cong Van Nguyen,
|
||||||
Borup Petersen, Dan Petrisko, Maciej Piechotka, David Pierce, Cody
|
Rachit Nigam, Toru Niina, Paul Nitza, Yossi Nivin, Pete Nixon, Lisa Noack,
|
||||||
Piersall, Michael Platzer, Dominic Plunkett, David Poole, Mike Popoloski,
|
Mark Nodine, Michael Nolan, Andrew Nolte, Joseph Nwabueze, Kuba Ober,
|
||||||
Roman Popov, Rich Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Usha
|
Andreas Olofsson, Baltazar Ortiz, Aleksander Osman, Don Owen, Tim Paine,
|
||||||
Priyadharshini, Mark Jackson Pulver, Prateek Puri, Marshal Qiao, Nandu Raj,
|
Deepa Palaniappan, James Pallister, Vassilis Papaefstathiou, Sanggyu Park,
|
||||||
Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh
|
Brad Parker, Risto Pejašinović, Morten Borup Petersen, Dan Petrisko, Wesley
|
||||||
Redford, Odd Magne Reitan, Frederic Requin, Dustin Richmond, Samuel Riedel,
|
Piard, Maciej Piechotka, David Pierce, Cody Piersall, T. Platz, Michael
|
||||||
Alberto Del Rio, Eric Rippey, Oleg Rodionov, Ludwig Rogiers, Paul Rolfe,
|
Platzer, Dominic Plunkett, David Poole, Michael Popoloski, Roman Popov,
|
||||||
Arjen Roodselaar, Tobias Rosenkranz, Ryszard Rozak, Huang Rui, Graham
|
Aylon Chaim Porat, Oron Port, Rich Porter, Rick Porter, Stefan Post,
|
||||||
Rushton, Jan Egil Ruud, Denis Rystsov, John Sanguinetti, Martin Schmidt,
|
Niranjan Prabhu, Damien Pretet, Harald Pretl, Bill Pringlemeir, Usha
|
||||||
Julie Schwartz, Galen Seitz, Joseph Shaker, Salman Sheikh, Hao Shi, Mike
|
Priyadharshini, Mark Jackson Pulver, Prateek Puri, Jiacheng Qian, Marshal
|
||||||
Shinkarovsky, Rafael Shirakawa, Jeffrey Short, Fan Shupei, Anderson Ignacio
|
Qiao, Raynard Qiao, Yujia Qiao, Jasen Qin, Frank Qiu, Nandu Raj, Kamil
|
||||||
da Silva, Rodney Sinclair, Ameya Vikram Singh, Steven Slatter, Mladen
|
Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh Redford,
|
||||||
Slijepcevic, Brian Small, Garrett Smith, Tim Snyder, Wilson Snyder, Maciej
|
Odd Magne Reitan, Frédéric Requin, Dustin Richmond, Samuel Riedel, Alberto
|
||||||
|
Del Rio, Eric Rippey, Oleg Rodionov, Ludwig Rogiers, Paul Rolfe, Michail
|
||||||
|
Rontionov, Arjen Roodselaar, Tobias Rosenkranz, Yernagula Roshit, Ryszard
|
||||||
|
Rozak, Huang Rui, Graham Rushton, Jan Egil Ruud, Denis Rystsov, Pawel
|
||||||
|
Sagan, Robert Sammelson, John Sanguinetti, Josep Sans, Luca Sasselli,
|
||||||
|
Martin Scharrer, Martin Schmidt, Julie Schwartz, Galen Seitz, Joseph
|
||||||
|
Shaker, Mark Shaw, Salman Sheikh, Zhou Shen, Hao Shi, James Shi, Michael
|
||||||
|
Shinkarovsky, Rafael Shirakawa, Jeffrey Short, S Shuba, Fan Shupei, Ethan
|
||||||
|
Sifferman, Anderson Ignacio da Silva, Rodney Sinclair, Ameya Vikram Singh,
|
||||||
|
Sanjay Singh, Frans Skarman, Nate Slager, Steven Slatter, Mladen
|
||||||
|
Slijepcevic, Brian Small, Garrett Smith, Gus Smith, Tim Snyder, Maciej
|
||||||
Sobkowski, Stan Sokorac, Alex Solomatnikov, Flavien Solt, Wei Song, Trefor
|
Sobkowski, Stan Sokorac, Alex Solomatnikov, Flavien Solt, Wei Song, Trefor
|
||||||
Southwell, Martin Stadler, Art Stamness, David Stanford, John Stevenson,
|
Southwell, Martin Stadler, Art Stamness, David Stanford, John Stevenson,
|
||||||
Pete Stevenson, Patrick Stewart, Rob Stoddard, Todd Strader, John Stroebel,
|
Pete Stevenson, Patrick Stewart, Rob Stoddard, Tood Strader, John Stroebel,
|
||||||
Sven Stucki, Howard Su, Emerson Suguimoto, Gene Sullivan, Qingyao Sun,
|
Ray Strouble, Sven Stucki, Howard Su, Emerson Suguimoto, Gene Sullivan,
|
||||||
Renga Sundararajan, Gustav Svensk, Rupert Swarbrick, Yutetsu Takatsukasa,
|
Qingyao Sun, Renga Sundararajan, Kuba Sunderland-Ober, Gustav Svensk,
|
||||||
Thierry Tambe, Drew Taussig, Jose Tejada, Peter Tengstrand, Wesley
|
Rupert Swarbrick, Jevin Sweval, Shinya T-Y, Thierry Tambe, Jesse Taube,
|
||||||
Terpstra, Rui Terra, Stefan Thiede, Gary Thomas, Ian Thompson, Kevin
|
Drew Taussig, Jose Tejada, Sören Tempel, Peter Tengstrand, Wesley Terpstra,
|
||||||
Thompson, Mike Thyer, Hans Tichelaar, Viktor Tomov, Steve Tong, Topa
|
Rui Terra, Stefan Thiede, Justin Thiel, Gary Thomas, Ian Thompson, Kevin
|
||||||
Topino, Alex Torregrosa, Michael Tresidder, David Turner, Neil Turton, Mike
|
Thompson, Mike Thyer, Hans Tichelaar, Tudor Timi, Viktor Tomov, Steve Tong,
|
||||||
Urbach, Hans Van Antwerpen, Sebastien Van Cauwenberghe, Laurens van Dam,
|
Topa Topino, Àlex Torregrosa, Topa Tota, Michael Tresidder, Lenny Truong,
|
||||||
Leendert van Doorn, Cong Van Nguyen, Jan Van Winkel, Srini Vemuri, Yuri
|
David Turner, Neil Turton, Hideto Ueno, Mike Urbach, Joel Vandergriendt,
|
||||||
Victorovich, Bogdan Vukobratovic, Holger Waechtler, Philipp Wagner, Stefan
|
Srini Vemuri, Srinivasan Venkataramanan, Yuri Victorovich, Ivan Vnučec,
|
||||||
Wallentowitz, Shawn Wang, Zhanglei Wang, Paul Wasson, Greg Waters, Thomas
|
Bogdan Vukobratovic, Holger Waechtler, Philipp Wagner, Johannes Walter, CY
|
||||||
Watts, Eugene Weber, David Welch, Thomas J Whatson, Martin Whitaker, Marco
|
Wang, Chuxuan Wang, Shawn Wang, Zhanglei Wang, Greg Waters, Thomas Watts,
|
||||||
Widmer, Leon Wildman, Daniel Wilkerson, Gerald Williams, Trevor Williams,
|
Eugene Weber, John Wehle, Tianrui Wei, David Welch, Thomas J Whatson,
|
||||||
Jeff Winston, Joshua Wise, Clifford Wolf, Tobias Wolfel, Johan Wouters,
|
Martin Whitaker, Marco Widmer, Leon Wildman, Daniel S. Wilkerson, Daniel
|
||||||
Paul Wright, Junyi Xi, Ding Xiaoliang, Jie Xu, Mandy Xu, Yinan Xu, Luke
|
Wilkerson, Gerald Williams, Trevor Williams, Don Williamson, Jan Van
|
||||||
Yang, Amir Yazdanbakhsh, Keyi Zhang, and Xi Zhang.
|
Winkel, Jeff Winston, Joshua Wise, Clifford Wolf, Johan Wouters, Paul
|
||||||
|
Wright, Tobias Wölfel, Junyi Xi, Ding Xiaoliang, Liu Xiaoyi, Mandy Xu,
|
||||||
|
Shanshan Xu, Yinan Xu, SU YANG, Felix Yan, Luke Yang, Amir Yazdanbakhsh,
|
||||||
|
Chentai (Seven) Yuan, Florian Zaruba, Mat Zeno, Keyi Zhang, Xi Zhang, Yike
|
||||||
|
Zhou, Jiamin Zhu.
|
||||||
|
|
||||||
Thanks to them, and all those we've missed mentioning above, and to those
|
Thanks to them, and all those we've missed mentioning above, and to those
|
||||||
whom have wished to remain anonymous.
|
whom have wished to remain anonymous.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. 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
|
The latest version of Verilator is available from `https://verilator.org
|
||||||
<https://verilator.org>`_.
|
<https://verilator.org>`_.
|
||||||
|
|
||||||
Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
can redistribute it and/or modify the Verilator internals under the terms
|
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
|
of either the GNU Lesser General Public License Version 3 or the Perl
|
||||||
Artistic License Version 2.0.
|
Artistic License Version 2.0.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
Deprecations
|
Deprecations
|
||||||
@@ -6,34 +6,14 @@ Deprecations
|
|||||||
|
|
||||||
The following deprecated items are scheduled for future removal:
|
The following deprecated items are scheduled for future removal:
|
||||||
|
|
||||||
C++11 compiler support
|
C++14 compiler support
|
||||||
Verilator currently requires a C++20 or newer compiler for timing, and a
|
Verilator currently requires a C++20 or newer compiler for timing, and a
|
||||||
C++11 or newer compiler for no-timing.
|
C++14 or newer compiler for both compiling Verilator and compiling
|
||||||
|
Verilated models with --no-timing.
|
||||||
Verilator will require C++14 or newer compilers for both compiling
|
|
||||||
Verilator and compiling Verilated models with --no-timing no sooner than
|
|
||||||
January 2023.
|
|
||||||
|
|
||||||
Verilator will require C++20 or newer compilers for both compiling
|
Verilator will require C++20 or newer compilers for both compiling
|
||||||
Verilator and compiling all Verilated models no sooner than January 2025.
|
Verilator and compiling all Verilated models no sooner than January 2025.
|
||||||
|
|
||||||
32-bit compiler support
|
XML output
|
||||||
Verilator currently regresses both 64-bit and 32-bit pointer modes (GCC's
|
Verilator currently supports XML parser output (enabled with `--xml-only`).
|
||||||
`-m64` and `-m32`). Support for 32-bit `-m32` mode will be deprecated no
|
Support for `--xml-*` options will be deprecated no sooner than January 2025.
|
||||||
sooner than January 2024.
|
|
||||||
|
|
||||||
Option `-O<letter>`
|
|
||||||
The debug `-O<letter>` options have been replaced with
|
|
||||||
`-fno-<optimization>` debug options to match GCC. The old options are
|
|
||||||
planned for removal no sooner than June 2023.
|
|
||||||
|
|
||||||
Option `--prof-threads`
|
|
||||||
The `--prof-threads` option has been superseded by the `--prof-exec` and
|
|
||||||
`--prof-pgo` options and is planned for removal no sooner than April 2023.
|
|
||||||
|
|
||||||
Verilated model options `+verilator+prof+threads+*`
|
|
||||||
The `+verilator+prof+threads+start`, `+verilator+prof+threads+window` and
|
|
||||||
`+verilator+prof+threads+file` options have been superseded by the
|
|
||||||
`+verilator+prof+exec+start`, `+verilator+prof+exec+window` and
|
|
||||||
`+verilator+prof+exec+file` options respectively and are planned for removal
|
|
||||||
no sooner than April 2023.
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
Environment
|
Environment
|
||||||
@@ -29,7 +29,7 @@ associated programs.
|
|||||||
.. option:: OBJCACHE
|
.. option:: OBJCACHE
|
||||||
|
|
||||||
Optionally specifies a caching or distribution program to place in front
|
Optionally specifies a caching or distribution program to place in front
|
||||||
of all runs of the C++ compiler. For example, "ccache". If using
|
of all runs of the C++ compiler. For example, "ccache" or "sccache". If using
|
||||||
:command:`distcc` or :command:`icecc`/:command:`icecream`, they would
|
:command:`distcc` or :command:`icecc`/:command:`icecream`, they would
|
||||||
generally be run under :command:`ccache`; see the documentation for
|
generally be run under :command:`ccache`; see the documentation for
|
||||||
those programs. If OBJCACHE is not set, and at configure time ccache
|
those programs. If OBJCACHE is not set, and at configure time ccache
|
||||||
@@ -117,3 +117,51 @@ associated programs.
|
|||||||
``VERILATOR_ROOT`` to point to the new version.
|
``VERILATOR_ROOT`` to point to the new version.
|
||||||
|
|
||||||
See :ref:`Installation` for more details.
|
See :ref:`Installation` for more details.
|
||||||
|
|
||||||
|
.. option:: VERILATOR_VALGRIND
|
||||||
|
|
||||||
|
If set, the command to run when using the :vlopt:`--valgrind` option, such as
|
||||||
|
"valgrind --tool=callgrind". If not specified, it will use "valgrind".
|
||||||
|
|
||||||
|
|
||||||
|
Make Variables
|
||||||
|
==============
|
||||||
|
|
||||||
|
This section describes the make variables used by Verilator. These may be
|
||||||
|
set by passing them to make e.g. ``make CXX=my-gcc ...``.
|
||||||
|
|
||||||
|
.. option:: AR
|
||||||
|
|
||||||
|
Optionally overrides the default :command:`ar` (archive) binary used by
|
||||||
|
the Verilated makefiles. If AR is not set, the version found at
|
||||||
|
configure time is used.
|
||||||
|
|
||||||
|
.. option:: CXX
|
||||||
|
|
||||||
|
Optionally overrides the default compiler binary used by the Verilated
|
||||||
|
makefiles. If CXX is not set, the version found at configure time is
|
||||||
|
used. Note the default flags passed to the compiler are determined at
|
||||||
|
configuration time, so changing the CXX compiler version using this
|
||||||
|
variable, as opposed to passing it at configuration time, may not give
|
||||||
|
desired results.
|
||||||
|
|
||||||
|
.. option:: LINK
|
||||||
|
|
||||||
|
Optionally overrides the default linker binary used by the Verilated
|
||||||
|
makefiles. If LINK is not set, the version found at configure time is
|
||||||
|
used. Note the default flags passed to the linker are determined at
|
||||||
|
configuration time, so changing the LINK version using this variable, as
|
||||||
|
opposed to passing it at configuration time, may not give desired
|
||||||
|
results.
|
||||||
|
|
||||||
|
.. option:: PERL
|
||||||
|
|
||||||
|
Optionally overrides the default :command:`perl` binary used by the
|
||||||
|
Verilated makefiles. If PERL is not set, the version found at configure
|
||||||
|
time, and compiled into the Verilator binary, is used.
|
||||||
|
|
||||||
|
.. option:: PYTHON3
|
||||||
|
|
||||||
|
Optionally overrides the default :command:`python3` binary used by the
|
||||||
|
Verilated makefiles. If PYTHON3 is not set, the version found at
|
||||||
|
configure time is used.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Example Create-Binary Execution:
|
.. _Example Create-Binary Execution:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Example C++ Execution:
|
.. _Example C++ Execution:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
First you need Verilator installed, see :ref:`Installation`. In brief, if
|
First you need Verilator installed, see :ref:`Installation`. In brief, if
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Examples in the Distribution:
|
.. _Examples in the Distribution:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Example SystemC Execution:
|
.. _Example SystemC Execution:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Examples:
|
.. _Examples:
|
||||||
@@ -9,6 +9,7 @@ Examples
|
|||||||
|
|
||||||
This section covers the following examples:
|
This section covers the following examples:
|
||||||
|
|
||||||
|
* :ref:`Example Create-Binary Execution`
|
||||||
* :ref:`Example C++ Execution`
|
* :ref:`Example C++ Execution`
|
||||||
* :ref:`Example SystemC Execution`
|
* :ref:`Example SystemC Execution`
|
||||||
* :ref:`Examples in the Distribution`
|
* :ref:`Examples in the Distribution`
|
||||||
|
|||||||
+21
-4
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Simulation Runtime Arguments:
|
.. _Simulation Runtime Arguments:
|
||||||
@@ -19,11 +19,20 @@ Summary:
|
|||||||
.. include:: ../_build/gen/args_verilated.rst
|
.. include:: ../_build/gen/args_verilated.rst
|
||||||
|
|
||||||
|
|
||||||
|
.. option:: +verilator+coverage+file+<filename>
|
||||||
|
|
||||||
|
When a model was Verilated using :vlopt:`--coverage`, sets the filename
|
||||||
|
to write coverage data into. Defaults to :file:`coverage.dat`.
|
||||||
|
|
||||||
.. option:: +verilator+debug
|
.. option:: +verilator+debug
|
||||||
|
|
||||||
Enable simulation runtime debugging. Equivalent to
|
Enable simulation runtime debugging. Equivalent to
|
||||||
:vlopt:`+verilator+debugi+4 <+verilator+debugi+\<value\>>`.
|
:vlopt:`+verilator+debugi+4 <+verilator+debugi+\<value\>>`.
|
||||||
|
|
||||||
|
To be useful, the model typically must first be compiled with debug
|
||||||
|
capabilities by Verilating with :vlopt:`--runtime-debug` or `-CFLAGS
|
||||||
|
-DVL_DEBUG=1`.
|
||||||
|
|
||||||
.. option:: +verilator+debugi+<value>
|
.. option:: +verilator+debugi+<value>
|
||||||
|
|
||||||
Enable simulation runtime debugging at the provided level.
|
Enable simulation runtime debugging at the provided level.
|
||||||
@@ -64,15 +73,18 @@ Summary:
|
|||||||
|
|
||||||
.. option:: +verilator+prof+threads+file+<filename>
|
.. option:: +verilator+prof+threads+file+<filename>
|
||||||
|
|
||||||
Deprecated. Alias for :vlopt:`+verilator+prof+exec+file+\<filename\>`
|
Removed in 5.020. Was an alias for
|
||||||
|
:vlopt:`+verilator+prof+exec+file+\<filename\>`
|
||||||
|
|
||||||
.. option:: +verilator+prof+threads+start+<value>
|
.. option:: +verilator+prof+threads+start+<value>
|
||||||
|
|
||||||
Deprecated. Alias for :vlopt:`+verilator+prof+exec+start+\<value\>`
|
Removed in 5.020. Was an alias for
|
||||||
|
:vlopt:`+verilator+prof+exec+start+\<value\>`
|
||||||
|
|
||||||
.. option:: +verilator+prof+threads+window+<value>
|
.. option:: +verilator+prof+threads+window+<value>
|
||||||
|
|
||||||
Deprecated. Alias for :vlopt:`+verilator+prof+exec+window+\<value\>`
|
Removed in 5.020. Was an alias for
|
||||||
|
:vlopt:`+verilator+prof+exec+window+\<value\>`
|
||||||
|
|
||||||
.. option:: +verilator+prof+vlt+file+<filename>
|
.. option:: +verilator+prof+vlt+file+<filename>
|
||||||
|
|
||||||
@@ -80,6 +92,11 @@ Summary:
|
|||||||
profile-guided optimization data runtime filename to dump to. Defaults
|
profile-guided optimization data runtime filename to dump to. Defaults
|
||||||
to :file:`profile.vlt`.
|
to :file:`profile.vlt`.
|
||||||
|
|
||||||
|
.. option:: +verilator+quiet
|
||||||
|
|
||||||
|
Disable printing the simulation summary report, see :ref:`Simulation
|
||||||
|
Summary Report`.
|
||||||
|
|
||||||
.. option:: +verilator+rand+reset+<value>
|
.. option:: +verilator+rand+reset+<value>
|
||||||
|
|
||||||
When a model was Verilated using
|
When a model was Verilated using
|
||||||
|
|||||||
+216
-50
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
verilator Arguments
|
verilator Arguments
|
||||||
@@ -51,6 +51,8 @@ Summary:
|
|||||||
|
|
||||||
.. option:: +1800-2017ext+<ext>
|
.. option:: +1800-2017ext+<ext>
|
||||||
|
|
||||||
|
.. option:: +1800-2023ext+<ext>
|
||||||
|
|
||||||
Specifies the language standard to be used with a specific filename
|
Specifies the language standard to be used with a specific filename
|
||||||
extension, <ext>.
|
extension, <ext>.
|
||||||
|
|
||||||
@@ -85,7 +87,11 @@ Summary:
|
|||||||
|
|
||||||
.. option:: --assert
|
.. option:: --assert
|
||||||
|
|
||||||
Enable all assertions.
|
Enable all assertions. Implies :vlopt:`--assert-case`.
|
||||||
|
|
||||||
|
.. option:: --assert-case
|
||||||
|
|
||||||
|
Enable unique/unique0/priority case related checks.
|
||||||
|
|
||||||
.. option:: --autoflush
|
.. option:: --autoflush
|
||||||
|
|
||||||
@@ -125,9 +131,12 @@ Summary:
|
|||||||
|
|
||||||
After generating the SystemC/C++ code, Verilator will invoke the
|
After generating the SystemC/C++ code, Verilator will invoke the
|
||||||
toolchain to build the model library (and executable when :vlopt:`--exe`
|
toolchain to build the model library (and executable when :vlopt:`--exe`
|
||||||
is also used). Verilator manages the build itself, and for this --build
|
is also used). Verilator manages the build itself, and for this --build
|
||||||
requires GNU Make to be available on the platform.
|
requires GNU Make to be available on the platform.
|
||||||
|
|
||||||
|
:vlopt:`--build` cannot be specified when using :vlopt:`-E`,
|
||||||
|
:vlopt:`--dpi-hdr-only`, :vlopt:`--lint-only`, or :vlopt:`--xml-only`.
|
||||||
|
|
||||||
.. option:: --build-dep-bin <filename>
|
.. option:: --build-dep-bin <filename>
|
||||||
|
|
||||||
Rarely needed. When a dependency (.d) file is created, this filename
|
Rarely needed. When a dependency (.d) file is created, this filename
|
||||||
@@ -192,9 +201,10 @@ Summary:
|
|||||||
|
|
||||||
.. option:: --compiler <compiler-name>
|
.. option:: --compiler <compiler-name>
|
||||||
|
|
||||||
Enables workarounds for the specified C++ compiler (list below).
|
Enables workarounds for the specified C++ compiler (list below). This
|
||||||
This does not change any performance tuning options, but it may
|
does not change any performance tuning options, but it may in the
|
||||||
in the future.
|
future. This also does not change default compiler flags; these are
|
||||||
|
determined when Verilator was configured.
|
||||||
|
|
||||||
clang
|
clang
|
||||||
Tune for clang. This may reduce execution speed as it enables several
|
Tune for clang. This may reduce execution speed as it enables several
|
||||||
@@ -301,19 +311,47 @@ Summary:
|
|||||||
detailed messages. See :vlopt:`--debug` for other implications of
|
detailed messages. See :vlopt:`--debug` for other implications of
|
||||||
enabling debug.
|
enabling debug.
|
||||||
|
|
||||||
|
.. option:: --decorations none
|
||||||
|
|
||||||
|
.. option:: --decorations medium
|
||||||
|
|
||||||
|
.. option:: --decorations node
|
||||||
|
|
||||||
|
When creating output Verilated code, set level of comment and whitespace
|
||||||
|
decoration.
|
||||||
|
|
||||||
|
With "--decorations none",
|
||||||
|
Minimize comments, white space, symbol names, and other decorative
|
||||||
|
items, at the cost of reduced readability. This may assist C++ compile
|
||||||
|
times. This will not typically change the ultimate model's
|
||||||
|
performance, but may in some cases. See also :vlopt:`--no-decoration`
|
||||||
|
option.
|
||||||
|
|
||||||
|
With "--decorations medium",
|
||||||
|
The default, put a small amount of comments and white space, for
|
||||||
|
typical level of readability.
|
||||||
|
|
||||||
|
With "--decorations node",
|
||||||
|
Include comments indicating what caused generation of the following
|
||||||
|
text, including what node pointer (corresponding to
|
||||||
|
:vlopt:`--dump-tree` .tree printed data), and the source Verilog
|
||||||
|
filename and line number. If subsequent following statements etc have
|
||||||
|
the same filename/line number these comments are omitted. This
|
||||||
|
enables easy debug when looking at the C++ code to determine what
|
||||||
|
Verilog source may be related. As node pointers are not stable
|
||||||
|
between different Verilator runs, this may harm compile caching and
|
||||||
|
should only be used for debug.
|
||||||
|
|
||||||
.. option:: --no-decoration
|
.. option:: --no-decoration
|
||||||
|
|
||||||
When creating output Verilated code, minimize comments, white space,
|
Alias for ``--decorations none``.
|
||||||
symbol names, and other decorative items, at the cost of reduced
|
|
||||||
readability. This may assist C++ compile times. This will not typically
|
|
||||||
change the ultimate model's performance, but may in some cases.
|
|
||||||
|
|
||||||
.. option:: --default-language <value>
|
.. option:: --default-language <value>
|
||||||
|
|
||||||
Select the language used by default when first processing each
|
Select the language used by default when first processing each
|
||||||
Verilog file. The language value must be "VAMS", "1364-1995",
|
Verilog file. The language value must be "VAMS", "1364-1995",
|
||||||
"1364-2001", "1364-2001-noconfig", "1364-2005", "1800-2005",
|
"1364-2001", "1364-2001-noconfig", "1364-2005", "1800-2005",
|
||||||
"1800-2009", "1800-2012", "1800-2017", or "1800+VAMS".
|
"1800-2009", "1800-2012", "1800-2017", "1800-2023", or "1800+VAMS".
|
||||||
|
|
||||||
Any language associated with a particular file extension (see the
|
Any language associated with a particular file extension (see the
|
||||||
various +<lang>*\ ext+ options) will be used in preference to the
|
various +<lang>*\ ext+ options) will be used in preference to the
|
||||||
@@ -326,7 +364,7 @@ Summary:
|
|||||||
``+<lang>ext+`` options should be used.
|
``+<lang>ext+`` options should be used.
|
||||||
|
|
||||||
If no language is specified, either by this option or ``+<lang>ext+``
|
If no language is specified, either by this option or ``+<lang>ext+``
|
||||||
options, then the latest SystemVerilog language (IEEE 1800-2017) is
|
options, then the latest SystemVerilog language (IEEE 1800-2023) is
|
||||||
used.
|
used.
|
||||||
|
|
||||||
.. option:: +define+<var>=<value>
|
.. option:: +define+<var>=<value>
|
||||||
@@ -375,6 +413,12 @@ Summary:
|
|||||||
:vlopt:`--debug --no-dump-tree <--dump-tree>` may be useful if the dump
|
:vlopt:`--debug --no-dump-tree <--dump-tree>` may be useful if the dump
|
||||||
files are large and not desired.
|
files are large and not desired.
|
||||||
|
|
||||||
|
.. option:: --dump-tree-json
|
||||||
|
|
||||||
|
Rarely needed. Enable dumping Ast .json.tree debug files with dumping level 3,
|
||||||
|
which dumps the standard critical stages. For details on the format, see
|
||||||
|
the Verilator Internals manual.
|
||||||
|
|
||||||
.. option:: --dump-tree-dot
|
.. option:: --dump-tree-dot
|
||||||
|
|
||||||
Rarely needed. Enable dumping Ast .tree.dot debug files in Graphviz
|
Rarely needed. Enable dumping Ast .tree.dot debug files in Graphviz
|
||||||
@@ -410,6 +454,11 @@ Summary:
|
|||||||
Rarely needed - for developer use. Set internal Ast dumping level
|
Rarely needed - for developer use. Set internal Ast dumping level
|
||||||
globally to the specified value.
|
globally to the specified value.
|
||||||
|
|
||||||
|
.. option:: --dumpi-tree-json <level>
|
||||||
|
|
||||||
|
Rarely needed - for developer use. Set internal Ast JSON dumping level
|
||||||
|
globally to the specified value.
|
||||||
|
|
||||||
.. option:: --dumpi-<srcfile> <level>
|
.. option:: --dumpi-<srcfile> <level>
|
||||||
|
|
||||||
Rarely needed - for developer use. Set the dumping level in the
|
Rarely needed - for developer use. Set the dumping level in the
|
||||||
@@ -1033,7 +1082,7 @@ Summary:
|
|||||||
|
|
||||||
.. option:: --prof-threads
|
.. option:: --prof-threads
|
||||||
|
|
||||||
Deprecated. Same as --prof-exec and --prof-pgo together.
|
Removed in 5.020. Was an alias for --prof-exec and --prof-pgo together.
|
||||||
|
|
||||||
.. option:: --protect-ids
|
.. option:: --protect-ids
|
||||||
|
|
||||||
@@ -1125,11 +1174,20 @@ Summary:
|
|||||||
Overwrites the given parameter(s) of the top-level module. See
|
Overwrites the given parameter(s) of the top-level module. See
|
||||||
:vlopt:`-G <-G<name>>` for a detailed description.
|
:vlopt:`-G <-G<name>>` for a detailed description.
|
||||||
|
|
||||||
|
.. option:: --quiet
|
||||||
|
|
||||||
|
Alias for :vlopt:`--quiet-exit` :vlopt:`--quiet-stats`.
|
||||||
|
|
||||||
.. option:: --quiet-exit
|
.. option:: --quiet-exit
|
||||||
|
|
||||||
When exiting due to an error, do not display the "Exiting due to Errors"
|
When exiting due to an error, do not display the "Exiting due to Errors"
|
||||||
nor "Command Failed" messages.
|
nor "Command Failed" messages.
|
||||||
|
|
||||||
|
.. option:: --quiet-stats
|
||||||
|
|
||||||
|
Disable printing the Verilation statistics report, see :ref:`Verilation
|
||||||
|
Summary Report`.
|
||||||
|
|
||||||
.. option:: --relative-includes
|
.. option:: --relative-includes
|
||||||
|
|
||||||
When a file references an include file, resolve the filename relative to
|
When a file references an include file, resolve the filename relative to
|
||||||
@@ -1180,6 +1238,40 @@ Summary:
|
|||||||
Run Verilator and record with the :command:`rr` command. See
|
Run Verilator and record with the :command:`rr` command. See
|
||||||
`https://rr-project.org <https://rr-project.org>`_.
|
`https://rr-project.org <https://rr-project.org>`_.
|
||||||
|
|
||||||
|
.. option:: --runtime-debug
|
||||||
|
|
||||||
|
Enable including debug assertions in the generated model. This may
|
||||||
|
significantly decrease model performance. This option will only work
|
||||||
|
with gcc/clang.
|
||||||
|
|
||||||
|
This option has the same effect as the following flags:
|
||||||
|
|
||||||
|
:vlopt:`--decorations node <--decorations>`
|
||||||
|
Instructs Verilator to add comments to the Verilated C++ code to
|
||||||
|
assist determining what Verilog code was responsible for each C++
|
||||||
|
statement.
|
||||||
|
|
||||||
|
``-CFLAGS -ggdb -LDFLAGS -ggdb``
|
||||||
|
Instructs the compiler and linker to enable debugger symbols.
|
||||||
|
|
||||||
|
``-CFLAGS -fsanitize=address,undefined -LDFLAGS -fsanitize=address,undefined``
|
||||||
|
Instructs the compiler and linker to enable the address sanitizer, and
|
||||||
|
undefined behavior sanitizer.
|
||||||
|
|
||||||
|
``-CFLAGS -D_GLIBCXX_DEBUG``
|
||||||
|
Instructs the compiler to enable C++ library (glibc) internal
|
||||||
|
assertions to find library-misuse issues.
|
||||||
|
|
||||||
|
``-CFLAGS -DVL_DEBUG=1``
|
||||||
|
Instructs the compiler to enable Verilator's runtime assertions and
|
||||||
|
debug capabilities. To enable debug print messages at runtime, see
|
||||||
|
:vlopt:`+verilator+debug`.
|
||||||
|
|
||||||
|
The :vlopt:`-CFLAGS` and/or :vlopt:`-LDFLAGS` options used here pass the
|
||||||
|
following argument into the generated Makefile for use as compiler or
|
||||||
|
linker options respectively. If you are using your own Makefiles, adapt
|
||||||
|
appropriately to pass the suggested flags to the compiler and linker.
|
||||||
|
|
||||||
.. option:: --savable
|
.. option:: --savable
|
||||||
|
|
||||||
Enable including save and restore functions in the generated model. See
|
Enable including save and restore functions in the generated model. See
|
||||||
@@ -1202,6 +1294,8 @@ Summary:
|
|||||||
|
|
||||||
Creates a dump file with statistics on the design in
|
Creates a dump file with statistics on the design in
|
||||||
:file:`<prefix>__stats.txt`.
|
:file:`<prefix>__stats.txt`.
|
||||||
|
Also dumps DFG patterns to
|
||||||
|
:file:`<prefix>__stats_dfg_patterns__*.txt`.
|
||||||
|
|
||||||
.. option:: --stats-vars
|
.. option:: --stats-vars
|
||||||
|
|
||||||
@@ -1213,6 +1307,10 @@ Summary:
|
|||||||
|
|
||||||
Prevents parsing standard library.
|
Prevents parsing standard library.
|
||||||
|
|
||||||
|
.. option:: --no-stop-fail
|
||||||
|
|
||||||
|
Don't call $stop when assertion fails. Simulation will continue.
|
||||||
|
|
||||||
.. option:: --structs-packed
|
.. option:: --structs-packed
|
||||||
|
|
||||||
Converts all unpacked structures to packed structures, and issues an
|
Converts all unpacked structures to packed structures, and issues an
|
||||||
@@ -1223,12 +1321,12 @@ Summary:
|
|||||||
.. option:: -sv
|
.. option:: -sv
|
||||||
|
|
||||||
Specifies SystemVerilog language features should be enabled; equivalent
|
Specifies SystemVerilog language features should be enabled; equivalent
|
||||||
to :vlopt:`--language 1800-2017 <--language>`. This option is selected
|
to :vlopt:`--language 1800-2023 <--language>`. This option is selected
|
||||||
by default; it exists for compatibility with other simulators.
|
by default; it exists for compatibility with other simulators.
|
||||||
|
|
||||||
.. option:: +systemverilogext+<ext>
|
.. option:: +systemverilogext+<ext>
|
||||||
|
|
||||||
A synonym for :vlopt:`+1800-2017ext+\<ext\>`.
|
A synonym for :vlopt:`+1800-2023ext+\<ext\>`.
|
||||||
|
|
||||||
.. option:: --threads <threads>
|
.. option:: --threads <threads>
|
||||||
|
|
||||||
@@ -1314,6 +1412,7 @@ Summary:
|
|||||||
This is not needed with standard designs with only one top. See also
|
This is not needed with standard designs with only one top. See also
|
||||||
:option:`MULTITOP` warning.
|
:option:`MULTITOP` warning.
|
||||||
|
|
||||||
|
|
||||||
.. option:: --trace
|
.. option:: --trace
|
||||||
|
|
||||||
Adds waveform tracing code to the model using VCD format. This overrides
|
Adds waveform tracing code to the model using VCD format. This overrides
|
||||||
@@ -1359,13 +1458,13 @@ Summary:
|
|||||||
Enable FST waveform tracing in the model. This overrides
|
Enable FST waveform tracing in the model. This overrides
|
||||||
:vlopt:`--trace`. See also :vlopt:`--trace-threads` option.
|
:vlopt:`--trace`. See also :vlopt:`--trace-threads` option.
|
||||||
|
|
||||||
.. option:: --trace-max-array *depth*
|
.. option:: --trace-max-array <depth>
|
||||||
|
|
||||||
Rarely needed. Specify the maximum array depth of a signal that may be
|
Rarely needed. Specify the maximum array depth of a signal that may be
|
||||||
traced. Defaults to 32, as tracing large arrays may greatly slow traced
|
traced. Defaults to 32, as tracing large arrays may greatly slow traced
|
||||||
simulations.
|
simulations.
|
||||||
|
|
||||||
.. option:: --trace-max-width *width*
|
.. option:: --trace-max-width <width>
|
||||||
|
|
||||||
Rarely needed. Specify the maximum bit width of a signal that may be
|
Rarely needed. Specify the maximum bit width of a signal that may be
|
||||||
traced. Defaults to 256, as tracing large vectors may greatly slow
|
traced. Defaults to 256, as tracing large vectors may greatly slow
|
||||||
@@ -1382,7 +1481,7 @@ Summary:
|
|||||||
format constraints, this may result in significantly slower trace times
|
format constraints, this may result in significantly slower trace times
|
||||||
and larger trace files.
|
and larger trace files.
|
||||||
|
|
||||||
.. option:: --trace-threads *threads*
|
.. option:: --trace-threads <threads>
|
||||||
|
|
||||||
Enable waveform tracing using separate threads. This is typically faster
|
Enable waveform tracing using separate threads. This is typically faster
|
||||||
in simulation runtime but uses more total compute. This option only
|
in simulation runtime but uses more total compute. This option only
|
||||||
@@ -1392,6 +1491,17 @@ Summary:
|
|||||||
This option is accepted, but has absolutely no effect with
|
This option is accepted, but has absolutely no effect with
|
||||||
:vlopt:`--trace`, which respects :vlopt:`--threads` instead.
|
:vlopt:`--trace`, which respects :vlopt:`--threads` instead.
|
||||||
|
|
||||||
|
.. option:: --no-trace-top
|
||||||
|
|
||||||
|
Disables tracing for the input and output signals in the top wrapper which
|
||||||
|
Verilator adds to the design. The signals are still traced in the original
|
||||||
|
verilog top modules.
|
||||||
|
|
||||||
|
When combined with :option:`--main-top-name` set to "-" or when the name of
|
||||||
|
the top module is set to "" in its constructor, the generated trace file
|
||||||
|
will have the verilog top module as its root, rather than another module
|
||||||
|
added by Verilator.
|
||||||
|
|
||||||
.. option:: --trace-underscore
|
.. option:: --trace-underscore
|
||||||
|
|
||||||
Enable tracing of signals or modules that start with an
|
Enable tracing of signals or modules that start with an
|
||||||
@@ -1409,15 +1519,19 @@ Summary:
|
|||||||
|
|
||||||
.. option:: --unroll-count <loops>
|
.. option:: --unroll-count <loops>
|
||||||
|
|
||||||
Rarely needed. Specifies the maximum number of loop iterations that may be
|
Rarely needed. Specifies the maximum number of loop iterations that may
|
||||||
unrolled. See also :option:`BLKLOOPINIT` warning.
|
be unrolled. See also :option:`BLKLOOPINIT` warning, and
|
||||||
|
:option:`/*verilator&32;unroll_disable*/` and
|
||||||
|
:option:`/*verilator&32;unroll_full*/` metacomments.
|
||||||
|
|
||||||
.. option:: --unroll-stmts *statements*
|
.. option:: --unroll-stmts <statements>
|
||||||
|
|
||||||
Rarely needed. Specifies the maximum number of statements in a loop for
|
Rarely needed. Specifies the maximum number of statements in a loop for
|
||||||
that loop to be unrolled. See also :option:`BLKLOOPINIT` warning.
|
that loop to be unrolled. See also :option:`BLKLOOPINIT` warning, and
|
||||||
|
:option:`/*verilator&32;unroll_disable*/` and
|
||||||
|
:option:`/*verilator&32;unroll_full*/` metacomments.
|
||||||
|
|
||||||
.. option:: --unused-regexp *regexp*
|
.. option:: --unused-regexp <regexp>
|
||||||
|
|
||||||
Rarely needed. Specifies a simple regexp with \* and ? that, if a signal
|
Rarely needed. Specifies a simple regexp with \* and ? that, if a signal
|
||||||
name matches, will suppress the :option:`UNUSED` warning. Defaults to
|
name matches, will suppress the :option:`UNUSED` warning. Defaults to
|
||||||
@@ -1429,12 +1543,17 @@ Summary:
|
|||||||
into Verilator. (Similar to :command:`perl -V`.) See also
|
into Verilator. (Similar to :command:`perl -V`.) See also
|
||||||
:vlopt:`--getenv` option.
|
:vlopt:`--getenv` option.
|
||||||
|
|
||||||
.. option:: -v *filename*
|
.. option:: -v <filename>
|
||||||
|
|
||||||
Read the filename as a Verilog library. Any modules in the file may be
|
Read the filename as a Verilog library. Any modules in the file may be
|
||||||
used to resolve instances in the top-level module, otherwise, they are
|
used to resolve instances in the top-level module, otherwise, they are
|
||||||
ignored. Note "-v" is relatively standard across Verilog tools.
|
ignored. Note "-v" is relatively standard across Verilog tools.
|
||||||
|
|
||||||
|
.. option:: --valgrind
|
||||||
|
|
||||||
|
Run Verilator under `Valgrind <https://valgrind.org/>`_. The command may be
|
||||||
|
changed with :option:`VERILATOR_VALGRIND`.
|
||||||
|
|
||||||
.. option:: --no-verilate
|
.. option:: --no-verilate
|
||||||
|
|
||||||
When using :vlopt:`--build`, disable the generation of C++/SystemC code, and
|
When using :vlopt:`--build`, disable the generation of C++/SystemC code, and
|
||||||
@@ -1466,7 +1585,7 @@ Summary:
|
|||||||
|
|
||||||
Enable the use of VPI and linking against the :file:`verilated_vpi.cpp` files.
|
Enable the use of VPI and linking against the :file:`verilated_vpi.cpp` files.
|
||||||
|
|
||||||
.. option:: --waiver-output *filename*
|
.. option:: --waiver-output <filename>
|
||||||
|
|
||||||
Generate a waiver file that contains all waiver statements to suppress
|
Generate a waiver file that contains all waiver statements to suppress
|
||||||
the warnings emitted during this Verilator run. This, in particular, is
|
the warnings emitted during this Verilator run. This, in particular, is
|
||||||
@@ -1523,13 +1642,15 @@ Summary:
|
|||||||
|
|
||||||
.. option:: -Wno-lint
|
.. option:: -Wno-lint
|
||||||
|
|
||||||
Disable all lint-related warning messages, and all style warnings. This is
|
Disable all lint-related warning messages, and all style warnings. This
|
||||||
equivalent to ``-Wno-ALWCOMBORDER -Wno-ASCRANGE -Wno-BSSPACE -Wno-CASEINCOMPLETE
|
is equivalent to ``-Wno-ALWCOMBORDER`` ``-Wno-ASCRANGE``
|
||||||
-Wno-CASEOVERLAP -Wno-CASEX -Wno-CASTCONST -Wno-CASEWITHX -Wno-CMPCONST -Wno-COLONPLUS
|
``-Wno-BSSPACE`` ``-Wno-CASEINCOMPLETE`` ``-Wno-CASEOVERLAP``
|
||||||
-Wno-IMPLICIT -Wno-IMPLICITSTATIC -Wno-PINCONNECTEMPTY
|
``-Wno-CASEX`` ``-Wno-CASTCONST`` ``-Wno-CASEWITHX`` ``-Wno-CMPCONST``
|
||||||
-Wno-PINMISSING -Wno-STATICVAR -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNSIGNED
|
``-Wno-COLONPLUS`` ``-Wno-IMPLICIT`` ``-Wno-IMPLICITSTATIC``
|
||||||
-Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL
|
``-Wno-PINCONNECTEMPTY`` ``-Wno-PINMISSING`` ``-Wno-STATICVAR``
|
||||||
-Wno-WIDTH`` plus the list shown for Wno-style.
|
``-Wno-SYNCASYNCNET`` ``-Wno-UNDRIVEN`` ``-Wno-UNSIGNED``
|
||||||
|
``-Wno-UNUSEDGENVAR`` ``-Wno-UNUSEDPARAM`` ``-Wno-UNUSEDSIGNAL``
|
||||||
|
``-Wno-WIDTH``, plus the list shown for :vlopt:`-Wno-style`.
|
||||||
|
|
||||||
It is strongly recommended that you clean up your code rather than using this
|
It is strongly recommended that you clean up your code rather than using this
|
||||||
option; it is only intended to be used when running test-cases of code
|
option; it is only intended to be used when running test-cases of code
|
||||||
@@ -1537,12 +1658,13 @@ Summary:
|
|||||||
|
|
||||||
.. option:: -Wno-style
|
.. option:: -Wno-style
|
||||||
|
|
||||||
Disable all code style related warning messages (note that by default, they are
|
Disable all code style related warning messages (note that by default,
|
||||||
already disabled). This is equivalent to ``-Wno-DECLFILENAME -Wno-DEFPARAM
|
they are already disabled). This is equivalent to ``-Wno-DECLFILENAME``
|
||||||
-Wno-EOFNEWLINE -Wno-GENUNNAMED -Wno-IMPORTSTAR -Wno-INCABSPATH -Wno-PINCONNECTEMPTY
|
``-Wno-DEFPARAM`` ``-Wno-EOFNEWLINE`` ``-Wno-GENUNNAMED``
|
||||||
-Wno-PINNOCONNECT -Wno-SYNCASYNCNET -Wno-UNDRIVEN
|
``-Wno-IMPORTSTAR`` ``-Wno-INCABSPATH`` ``-Wno-PINCONNECTEMPTY``
|
||||||
-Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL
|
``-Wno-PINNOCONNECT`` ``-Wno-SYNCASYNCNET`` ``-Wno-UNDRIVEN``
|
||||||
-Wno-VARHIDDEN``.
|
``-Wno-UNUSEDGENVAR`` ``-Wno-UNUSEDPARAM`` ``-Wno-UNUSEDSIGNAL``
|
||||||
|
``-Wno-VARHIDDEN``.
|
||||||
|
|
||||||
.. option:: -Wpedantic
|
.. option:: -Wpedantic
|
||||||
|
|
||||||
@@ -1560,20 +1682,25 @@ Summary:
|
|||||||
|
|
||||||
.. option:: -Wwarn-lint
|
.. option:: -Wwarn-lint
|
||||||
|
|
||||||
Enable all lint-related warning messages (note that by default, they are already
|
Enable all lint-related warning messages (note that by default, they are
|
||||||
enabled), but do not affect style messages. This is equivalent to
|
already enabled), but do not affect style messages. This is equivalent
|
||||||
``-Wwarn-ALWCOMBORDER -Wwarn-ASCRANGE -Wwarn-BSSPACE -Wwarn-CASEINCOMPLETE
|
to ``-Wwarn-ALWCOMBORDER`` ``-Wwarn-ASCRANGE`` ``-Wwarn-BSSPACE``
|
||||||
-Wwarn-CASEOVERLAP -Wwarn-CASEWITHX -Wwarn-CASEX -Wwarn-CASTCONST -Wwarn-CMPCONST
|
``-Wwarn-CASEINCOMPLETE`` ``-Wwarn-CASEOVERLAP`` ``-Wwarn-CASEWITHX``
|
||||||
-Wwarn-COLONPLUS -Wwarn-IMPLICIT -Wwarn-IMPLICITSTATIC -Wwarn-LATCH -Wwarn-MISINDENT
|
``-Wwarn-CASEX`` ``-Wwarn-CASTCONST`` ``-Wwarn-CMPCONST``
|
||||||
-Wwarn-NEWERSTD -Wwarn-PINMISSING -Wwarn-REALCVT -Wwarn-STATICVAR -Wwarn-UNSIGNED
|
``-Wwarn-COLONPLUS`` ``-Wwarn-IMPLICIT`` ``-Wwarn-IMPLICITSTATIC``
|
||||||
-Wwarn-WIDTHTRUNC -Wwarn-WIDTHEXPAND -Wwarn-WIDTHXZEXPAND``.
|
``-Wwarn-LATCH`` ``-Wwarn-MISINDENT`` ``-Wwarn-NEWERSTD``
|
||||||
|
``-Wwarn-PINMISSING`` ``-Wwarn-REALCVT`` ``-Wwarn-STATICVAR``
|
||||||
|
``-Wwarn-UNSIGNED`` ``-Wwarn-WIDTHTRUNC`` ``-Wwarn-WIDTHEXPAND``
|
||||||
|
``-Wwarn-WIDTHXZEXPAND``.
|
||||||
|
|
||||||
.. option:: -Wwarn-style
|
.. option:: -Wwarn-style
|
||||||
|
|
||||||
Enable all code style-related warning messages. This is equivalent to
|
Enable all code style-related warning messages. This is equivalent to
|
||||||
``-Wwarn ASSIGNDLY -Wwarn-DECLFILENAME -Wwarn-DEFPARAM -Wwarn-EOFNEWLINE
|
``-Wwarn-ASSIGNDLY`` ``-Wwarn-DECLFILENAME`` ``-Wwarn-DEFPARAM``
|
||||||
-Wwarn-GENUNNAMED -Wwarn-INCABSPATH -Wwarn-PINNOCONNECT -Wwarn-SYNCASYNCNET -Wwarn-UNDRIVEN
|
``-Wwarn-EOFNEWLINE`` ``-Wwarn-GENUNNAMED`` ``-Wwarn-INCABSPATH``
|
||||||
-Wwarn-UNUSEDGENVAR -Wwarn-UNUSEDPARAM -Wwarn-UNUSEDSIGNAL -Wwarn-VARHIDDEN``.
|
``-Wwarn-PINNOCONNECT`` ``-Wwarn-SYNCASYNCNET`` ``-Wwarn-UNDRIVEN``
|
||||||
|
``-Wwarn-UNUSEDGENVAR`` ``-Wwarn-UNUSEDPARAM`` ``-Wwarn-UNUSEDSIGNAL``
|
||||||
|
``-Wwarn-VARHIDDEN``.
|
||||||
|
|
||||||
.. option:: --x-assign 0
|
.. option:: --x-assign 0
|
||||||
|
|
||||||
@@ -1672,19 +1799,58 @@ Summary:
|
|||||||
iterations. This may be another indication of problems with the
|
iterations. This may be another indication of problems with the
|
||||||
modeled design that should be addressed.
|
modeled design that should be addressed.
|
||||||
|
|
||||||
|
.. option:: --json-only
|
||||||
|
|
||||||
|
Create JSON output only, do not create any other output.
|
||||||
|
|
||||||
|
The JSON format is intended to be used to leverage Verilator's parser and
|
||||||
|
elaboration to feed to other downstream tools. For details on the format, see
|
||||||
|
the Verilator Internals manual. Be aware that the JSON
|
||||||
|
format is still evolving; there will be some changes in future versions.
|
||||||
|
|
||||||
|
This option disables some more aggressive transformations and dumps only
|
||||||
|
the final state of the AST. For more granular and unaltered dumps, meant
|
||||||
|
mainly for debugging see :vlopt:`--dump-tree-json`.
|
||||||
|
|
||||||
|
.. option:: --json-only-meta-output <filename>
|
||||||
|
|
||||||
|
Specifies the filename for the metadata output file (`.tree.meta.json`) of --json-only.
|
||||||
|
Using this option automatically sets :vlopt:`--json-only`.
|
||||||
|
|
||||||
|
.. option:: --json-only-output <filename>
|
||||||
|
|
||||||
|
Specifies the filename for the main output file (`.tree.json`) of --json-only.
|
||||||
|
Using this option automatically sets :vlopt:`--json-only`.
|
||||||
|
|
||||||
|
.. option:: --no-json-edit-nums
|
||||||
|
|
||||||
|
Don't dump edit number in .tree.json files. This may make the file more
|
||||||
|
run-to-run stable for easier comparison.
|
||||||
|
|
||||||
|
.. option:: --no-json-ids
|
||||||
|
|
||||||
|
Don't use short identifiers instead of addresses/paths in .tree.json.
|
||||||
|
|
||||||
.. option:: --xml-only
|
.. option:: --xml-only
|
||||||
|
|
||||||
Create XML output only, do not create any other output.
|
Create XML output only, do not create any other output.
|
||||||
|
|
||||||
The XML format is intended to be used to leverage Verilator's parser and
|
The XML format is intended to be used to leverage Verilator's parser and
|
||||||
elaboration to feed to other downstream tools. Be aware that the XML
|
elaboration to feed to other downstream tools.
|
||||||
format is still evolving; there will be some changes in future versions.
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This feature is deprecated in favor of :vlopt:`--json-only`.
|
||||||
|
|
||||||
.. option:: --xml-output <filename>
|
.. option:: --xml-output <filename>
|
||||||
|
|
||||||
Specifies the filename for the XML output file. Using this option
|
Specifies the filename for the XML output file. Using this option
|
||||||
automatically sets :vlopt:`--xml-only`.
|
automatically sets :vlopt:`--xml-only`.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This feature is deprecated in favor of :vlopt:`--json-only`.
|
||||||
|
|
||||||
.. option:: -y <dir>
|
.. option:: -y <dir>
|
||||||
|
|
||||||
Add the directory to the list of directories that should be searched to find
|
Add the directory to the list of directories that should be searched to find
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
verilator_coverage
|
verilator_coverage
|
||||||
@@ -64,30 +64,59 @@ 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
|
The minimum coverage across all merged points will be used to report
|
||||||
coverage of the line.
|
coverage of the line.
|
||||||
|
|
||||||
The first character of the line shows a summary of the coverage; this
|
Coverage data is annotated at the beginning of the line and is formatted
|
||||||
allows use of grep to filter the report. `%` indicates at least one point
|
as a special character followed by the number of coverage hits. The special
|
||||||
on the line was below the coverage limit. `+` indicates an
|
characters " ,%,+,-" indicate summary of the coverage, and allow use of grep
|
||||||
:option:`--annotate-points` point was at or above the limit, and `-` that
|
to filter the report.
|
||||||
the point was below the limit.
|
|
||||||
|
* " " (whitespace) indicates that all points on the line are above the coverage limit.
|
||||||
|
* "%" indicates at least one point on the line was below the coverage limit.
|
||||||
|
* "+" coverage point was at or above the limit. Only used with :option:`--annotate-points`.
|
||||||
|
* "-" coverage point was below the limit. Only used with :option:`--annotate-points`.
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
100000 input logic a; // Begins with whitespace, because
|
||||||
|
// number of hits (100000) is above the limit.
|
||||||
|
+100000 point: comment=a // Begins with +, because
|
||||||
|
// number of hits (100000) is above the limit.
|
||||||
|
%000000 input logic b; // Begins with %, because
|
||||||
|
// number of hits (0) is below the limit.
|
||||||
|
-000000 point: comment=b // Begins with -, because
|
||||||
|
// number of hits (0) is below the limit.
|
||||||
|
|
||||||
.. option:: --annotate-all
|
.. option:: --annotate-all
|
||||||
|
|
||||||
Specifies all files should be shown. By default, only those source files
|
Specifies all files should be shown. By default, only those source files
|
||||||
with low coverage are written to the output directory.
|
with low coverage are written to the output directory.
|
||||||
|
|
||||||
|
This option should be used together with :option:`--annotate`.
|
||||||
|
|
||||||
.. option:: --annotate-min <count>
|
.. option:: --annotate-min <count>
|
||||||
|
|
||||||
Specifies if the coverage point does not include the count number of
|
Specifies the threshold (<count>) below which coverage point is considered
|
||||||
coverage hits, then the coverage point will be considered above the
|
sufficient. If the threshold is not exceeded, then the annotation will begin
|
||||||
threshold, and the coverage report will put a "%" to indicate the coverage
|
with a "%" symbol to indicate the coverage is insufficient.
|
||||||
is insufficient. Defaults to 10.
|
|
||||||
|
The <count> threshold defaults to 10.
|
||||||
|
|
||||||
|
This option should be used together with :option:`--annotate`.
|
||||||
|
|
||||||
|
|
||||||
.. option:: --annotate-points
|
.. option:: --annotate-points
|
||||||
|
|
||||||
Specifies all coverage points should be shown after each line of text. By
|
Specifies all coverage points should be shown after each line of text. By
|
||||||
default, only source lines are shown.
|
default, only source lines are shown.
|
||||||
|
|
||||||
with low coverage are written to the output directory.
|
.. code-block::
|
||||||
|
|
||||||
|
100000 input logic a, b, c;
|
||||||
|
+100000 point: comment=a // These lines are only shown
|
||||||
|
+200000 point: comment=b // with option --annotate-points
|
||||||
|
+300000 point: comment=c // enabled.
|
||||||
|
|
||||||
|
|
||||||
|
This option should be used together with :option:`--annotate`.
|
||||||
|
|
||||||
.. option:: --help
|
.. option:: --help
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
verilator_gantt
|
verilator_gantt
|
||||||
@@ -30,15 +30,13 @@ Gantt Chart VCD Signals
|
|||||||
In waveforms, there are the following signals. In GTKWave, use "decimal"
|
In waveforms, there are the following signals. In GTKWave, use "decimal"
|
||||||
data format to remove the leading zeros and make the traces easier to read.
|
data format to remove the leading zeros and make the traces easier to read.
|
||||||
|
|
||||||
evals
|
trace/section
|
||||||
Increments each time when eval_step was measured to be active. This
|
Shows the name of the current top of the execution section stack.
|
||||||
allow visualization of how much time eval_step was active.
|
Set GTKWave data format to "ASCII".
|
||||||
|
|
||||||
eval_loop
|
trace/depth
|
||||||
Increments each time when the evaluation loop within eval_step was
|
Shows the depth of the execution section stack.
|
||||||
measured to be active. For best performance, there is only a single
|
Set GTKWave data format to "Analog".
|
||||||
evaluation loop within each eval_step call; that is, the eval_loop
|
|
||||||
waveform looks identical to the evals waveform.
|
|
||||||
|
|
||||||
measured_parallelism
|
measured_parallelism
|
||||||
The number of mtasks active at this time, for best performance, this will
|
The number of mtasks active at this time, for best performance, this will
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
verilator_profcfunc
|
verilator_profcfunc
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
*********************************
|
*********************************
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
*******************
|
*******************
|
||||||
@@ -17,19 +17,26 @@ or "`ifdef`"'s may break other tools.
|
|||||||
|
|
||||||
.. option:: `__LINE__
|
.. option:: `__LINE__
|
||||||
|
|
||||||
The :option:`\`__LINE__` define expands to the current filename as a
|
The :option:`\`__LINE__` define expands to the current line number like
|
||||||
string, like C++'s __LINE__. This Verilator feature added in 2006 was
|
C++'s __LINE__. This Verilator feature added in 2006 was incorporated
|
||||||
incorporated into IEEE 1800-2009.
|
into IEEE 1800-2009.
|
||||||
|
|
||||||
.. option:: `error [string]
|
.. option:: `error [string]
|
||||||
|
|
||||||
This will report an error when encountered, like C++'s #error.
|
This will report an error when the preprocessor emits it, similar to
|
||||||
|
C++'s #error.
|
||||||
|
|
||||||
|
.. option:: `line
|
||||||
|
|
||||||
|
As a special case `\`line \`__LINE__ "filename"` allows setting the
|
||||||
|
filename, without changing the line number. This is used for some
|
||||||
|
internal tests, so that debugging can leave the line numbers correctly
|
||||||
|
referring to the test file's line numbers.
|
||||||
|
|
||||||
.. option:: """ [string] """
|
.. option:: """ [string] """
|
||||||
|
|
||||||
A triple-quoted block specifies a string that may include newlines and
|
A triple-quoted block specifies a string that may include newlines and
|
||||||
single quotes. This extension is experimental and may be removed
|
single quotes. This extension was standardized in IEEE 1800-2023.
|
||||||
without deprecation.
|
|
||||||
|
|
||||||
.. option:: $c([string], ...);
|
.. option:: $c([string], ...);
|
||||||
|
|
||||||
@@ -569,6 +576,10 @@ or "`ifdef`"'s may break other tools.
|
|||||||
|
|
||||||
.. option:: /*verilator&32;trace_init_task*/
|
.. option:: /*verilator&32;trace_init_task*/
|
||||||
|
|
||||||
|
Removed.
|
||||||
|
|
||||||
|
In versions before 5.024:
|
||||||
|
|
||||||
Attached to a DPI import to indicate that function should be called when
|
Attached to a DPI import to indicate that function should be called when
|
||||||
initializing tracing. This attribute is indented only to be used
|
initializing tracing. This attribute is indented only to be used
|
||||||
internally in code that Verilator generates when :vlopt:`--lib-create`
|
internally in code that Verilator generates when :vlopt:`--lib-create`
|
||||||
@@ -586,6 +597,23 @@ or "`ifdef`"'s may break other tools.
|
|||||||
Re-enable waveform tracing for all future signals or instances that are
|
Re-enable waveform tracing for all future signals or instances that are
|
||||||
declared.
|
declared.
|
||||||
|
|
||||||
|
.. option:: /*verilator&32;unroll_disable*/
|
||||||
|
|
||||||
|
Used in a statement position to indicate the immediately following loop
|
||||||
|
at the same statement level should not be unrolled by Verilator,
|
||||||
|
ignoring :vlopt:`--unroll-count`. This is similar to clang's ``#pragma
|
||||||
|
clang loop unroll(disable)``.
|
||||||
|
|
||||||
|
This option does not currently disable the C++ compiler's unrolling (or
|
||||||
|
not) of any loops that make it through to the Verilated C++ code.
|
||||||
|
|
||||||
|
.. option:: /*verilator&32;unroll_full*/
|
||||||
|
|
||||||
|
Rarely needed. Used in a statement position to indicate the immediately
|
||||||
|
following loop at the same statement level should always be fully
|
||||||
|
unrolled by Verilator, ignoring :vlopt:`--unroll-count`. This is
|
||||||
|
similar to clang's ``#pragma clang loop unroll(full)``.
|
||||||
|
|
||||||
.. option:: $stacktrace
|
.. option:: $stacktrace
|
||||||
|
|
||||||
Called as a task, print a stack trace. Called as a function, return a
|
Called as a task, print a stack trace. Called as a function, return a
|
||||||
@@ -594,4 +622,4 @@ or "`ifdef`"'s may break other tools.
|
|||||||
symbols. Also, the data represents the C++ stack; the SystemVerilog
|
symbols. Also, the data represents the C++ stack; the SystemVerilog
|
||||||
functions/tasks involved may be renamed and/or inlined before becoming
|
functions/tasks involved may be renamed and/or inlined before becoming
|
||||||
the C++ functions that may be visible in the stack trace. This
|
the C++ functions that may be visible in the stack trace. This
|
||||||
extension is experimental and may be removed without deprecation.
|
extension was standardized in IEEE 1800-2023.
|
||||||
|
|||||||
+17
-18
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
******************************
|
******************************
|
||||||
@@ -128,10 +128,13 @@ How do I generate waveforms (traces) in C++?
|
|||||||
|
|
||||||
See also the next question for tracing in SystemC mode.
|
See also the next question for tracing in SystemC mode.
|
||||||
|
|
||||||
A. Pass the :vlopt:`--trace` option to Verilator, and in your top-level C
|
A. Pass the :vlopt:`--trace` option to Verilator. Then you may use ``$dumpfile`` and
|
||||||
code, call ``Verilated::traceEverOn(true)``. Then you may use
|
``$dumpvars`` to enable traces, the same as with any Verilog simulator,
|
||||||
``$dumpfile`` and ``$dumpvars`` to enable traces, the same as with any
|
although Verilator ignores the arguments to ``$dumpvars``. See
|
||||||
Verilog simulator. See ``examples/make_tracing_c`` in the distribution.
|
``examples/make_tracing_c`` in the distribution.
|
||||||
|
|
||||||
|
If writing the top-level C code, call ``Verilated::traceEverOn(true)``;
|
||||||
|
this is done for you if using :vlopt:`--binary`.
|
||||||
|
|
||||||
B. Or, for finer-grained control, or C++ files with multiple Verilated
|
B. Or, for finer-grained control, or C++ files with multiple Verilated
|
||||||
modules, you may also create the trace purely from C++. Create a
|
modules, you may also create the trace purely from C++. Create a
|
||||||
@@ -220,24 +223,20 @@ This is done for you if you are using the Verilator :vlopt:`--binary` or
|
|||||||
You can call :code:`->trace()` on multiple Verilated objects with the same
|
You can call :code:`->trace()` on multiple Verilated objects with the same
|
||||||
trace file if you want all data to land in the same output file.
|
trace file if you want all data to land in the same output file.
|
||||||
|
|
||||||
When using SystemC 2.3, the SystemC library must have been built with the
|
|
||||||
experimental simulation phase callback-based tracing disabled. This is
|
|
||||||
disabled by default when building SystemC with its configure based build
|
|
||||||
system, but when building SystemC with CMake, you must pass
|
|
||||||
``-DENABLE_PHASE_CALLBACKS_TRACING=OFF`` to disable this feature.
|
|
||||||
|
|
||||||
|
|
||||||
How do I generate FST waveforms (traces) in C++ or SystemC?
|
How do I generate FST waveforms (traces) in C++ or SystemC?
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
FST is a trace file format developed by GTKWave. Verilator provides basic
|
FST is a trace file format developed by GTKWave. Verilator provides basic
|
||||||
FST support. To dump traces in FST format, add the :vlopt:`--trace-fst`
|
FST support. To dump traces in FST format, add the :vlopt:`--trace-fst`
|
||||||
option to Verilator and either A. use :code:`$dumpfile & $dumpvars` in
|
option to Verilator and either:
|
||||||
Verilog as described in the VCD example above,
|
|
||||||
|
Use :code:`$dumpfile & $dumpvars` in Verilog as described in the VCD
|
||||||
|
example above,
|
||||||
|
|
||||||
Or, in C++ change the include described in the VCD example above:
|
Or, in C++ change the include described in the VCD example above:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: C++
|
||||||
|
|
||||||
#include "verilated_fst_c.h"
|
#include "verilated_fst_c.h"
|
||||||
VerilatedFstC* tfp = new VerilatedFstC;
|
VerilatedFstC* tfp = new VerilatedFstC;
|
||||||
@@ -245,14 +244,14 @@ Or, in C++ change the include described in the VCD example above:
|
|||||||
|
|
||||||
Or, in SystemC, change the include described in the VCD example above:
|
Or, in SystemC, change the include described in the VCD example above:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: C++
|
||||||
|
|
||||||
#include "verilated_fst_sc.h"
|
#include "verilated_fst_sc.h"
|
||||||
VerilatedFstC* tfp = new VerilatedFstSc;
|
VerilatedFstC* tfp = new VerilatedFstSc;
|
||||||
|
|
||||||
|
|
||||||
Currently, supporting FST and VCD in a single simulation is impossible, but
|
Currently, supporting FST and VCD in a single simulation is not supported,
|
||||||
such requirement should be rare. You can however ifdef around the trace
|
but such usage should be unlikely. You can however ifdef around the trace
|
||||||
format in your C++ main loop, and select VCD or FST at compile time.
|
format in your C++ main loop, and select VCD or FST at compile time.
|
||||||
|
|
||||||
|
|
||||||
@@ -401,7 +400,7 @@ How do I get faster build times?
|
|||||||
* Use a recent compiler. Newer compilers tend to be faster.
|
* Use a recent compiler. Newer compilers tend to be faster.
|
||||||
|
|
||||||
* Compile in parallel on many machines and use caching; see the web for the
|
* Compile in parallel on many machines and use caching; see the web for the
|
||||||
ccache, distcc, and icecream packages. ccache will skip GCC runs between
|
ccache, sccache, distcc, or icecream packages. ccache will skip GCC runs between
|
||||||
identical source builds, even across different users. If ccache was
|
identical source builds, even across different users. If ccache was
|
||||||
installed when Verilator was built, it is used, or see OBJCACHE
|
installed when Verilator was built, it is used, or see OBJCACHE
|
||||||
environment variable to override this. Also see the
|
environment variable to override this. Also see the
|
||||||
|
|||||||
+11
-3
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
*****
|
*****
|
||||||
@@ -50,9 +50,9 @@ For --cc/--sc, it creates:
|
|||||||
- Make include file with class names (from --make gmake)
|
- Make include file with class names (from --make gmake)
|
||||||
* - *{prefix}*\ _hier.mk
|
* - *{prefix}*\ _hier.mk
|
||||||
- Make file for hierarchy blocks (from --make gmake)
|
- Make file for hierarchy blocks (from --make gmake)
|
||||||
* - *{prefix}*\ _hierMkArgs.f
|
* - *{prefix}*\ __hierMkArgs.f
|
||||||
- Arguments for hierarchical Verilation (from --make gmake)
|
- Arguments for hierarchical Verilation (from --make gmake)
|
||||||
* - *{prefix}*\ _hierCMakeArgs.f
|
* - *{prefix}*\ __hierCMakeArgs.f
|
||||||
- Arguments for hierarchical Verilation (from --make cmake)
|
- Arguments for hierarchical Verilation (from --make cmake)
|
||||||
* - *{prefix}*\ .h
|
* - *{prefix}*\ .h
|
||||||
- Model header
|
- Model header
|
||||||
@@ -112,6 +112,10 @@ In specific debug and other modes, it also creates:
|
|||||||
|
|
||||||
* - *{prefix}*\ .xml
|
* - *{prefix}*\ .xml
|
||||||
- XML tree information (from --xml)
|
- XML tree information (from --xml)
|
||||||
|
* - *{prefix}*\ .tree.json
|
||||||
|
- JSON tree information (from --json-only)
|
||||||
|
* - *{prefix}*\ .tree.meta.json
|
||||||
|
- JSON tree metadata (from --json-only)
|
||||||
* - *{prefix}*\ __cdc.txt
|
* - *{prefix}*\ __cdc.txt
|
||||||
- Clock Domain Crossing checks (from --cdc)
|
- Clock Domain Crossing checks (from --cdc)
|
||||||
* - *{prefix}*\ __stats.txt
|
* - *{prefix}*\ __stats.txt
|
||||||
@@ -145,6 +149,10 @@ After running Make, the C++ compiler may produce the following:
|
|||||||
- Intermediate objects
|
- Intermediate objects
|
||||||
* - *{prefix}*\
|
* - *{prefix}*\
|
||||||
- Final executable (from --exe)
|
- Final executable (from --exe)
|
||||||
|
* - lib\ *{prefix}*\ .a
|
||||||
|
- Final archive (default lib mode)
|
||||||
|
* - libverilated.a
|
||||||
|
- Runtime for verilated model (default lib mode)
|
||||||
* - *{prefix}*\ __ALL.a
|
* - *{prefix}*\ __ALL.a
|
||||||
- Library of all Verilated objects
|
- Library of all Verilated objects
|
||||||
* - *{prefix}*\ __ALL.cpp
|
* - *{prefix}*\ __ALL.cpp
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
######################
|
######################
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _CMakeInstallation:
|
.. _CMakeInstallation:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Installation:
|
.. _Installation:
|
||||||
@@ -126,8 +126,9 @@ Those developing Verilator itself may also want these (see internals.rst):
|
|||||||
::
|
::
|
||||||
|
|
||||||
sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov
|
sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov
|
||||||
sudo apt-get install libclang-dev yapf3
|
sudo apt-get install python3-clang yapf3 bear jq
|
||||||
sudo pip3 install clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
|
sudo pip3 install sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
|
||||||
|
sudo pip3 install git+https://github.com/antmicro/astsee.git
|
||||||
cpan install Pod::Perldoc
|
cpan install Pod::Perldoc
|
||||||
cpan install Parallel::Forker
|
cpan install Parallel::Forker
|
||||||
|
|
||||||
|
|||||||
+31
-39
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
***************
|
***************
|
||||||
@@ -62,12 +62,23 @@ Verilator supports the 2017 "for" loop constructs and several cleanups IEEE
|
|||||||
made in 1800-2017.
|
made in 1800-2017.
|
||||||
|
|
||||||
|
|
||||||
|
SystemVerilog 2023 (IEEE 1800-2023) Support
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
Verilator supports some of the 2023 improvements, including triple-quoted
|
||||||
|
string blocks that may include newlines and single quotes.
|
||||||
|
|
||||||
|
Verilator implements a full IEEE 1800-2023 compliant preprocessor,
|
||||||
|
including triple-quoted strings, and \`ifdef expressions.
|
||||||
|
|
||||||
|
|
||||||
Verilog AMS Support
|
Verilog AMS Support
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Verilator implements a very small subset of Verilog AMS (Verilog Analog and
|
Verilator implements a very small subset of Verilog AMS (Verilog Analog and
|
||||||
Mixed-Signal Extensions) with the subset corresponding to those VMS
|
Mixed-Signal Extensions) with the subset corresponding to those VMS
|
||||||
keywords with near-equivalents in Verilog 2005 or SystemVerilog 2017.
|
keywords with near-equivalents in Verilog IEEE 1364 or SystemVerilog
|
||||||
|
IEEE 1800.
|
||||||
|
|
||||||
AMS parsing is enabled with :vlopt:`--language VAMS <--language>` or
|
AMS parsing is enabled with :vlopt:`--language VAMS <--language>` or
|
||||||
:vlopt:`--language 1800+VAMS <--language>`.
|
:vlopt:`--language 1800+VAMS <--language>`.
|
||||||
@@ -237,11 +248,9 @@ optimizations will be disabled around the latch.
|
|||||||
Structures and Unions
|
Structures and Unions
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
Presently Verilator only supports packed structs and packed unions. Rand
|
All structures and unions are scheduled together, which means that
|
||||||
and randc tags on members are ignored. All structures and unions are
|
generating one member of a structure from blocking, and another from
|
||||||
represented as a single vector, which means that generating one member of a
|
non-blocking assignments is unsupported.
|
||||||
structure from blocking, and another from non-blocking assignments is
|
|
||||||
unsupported.
|
|
||||||
|
|
||||||
|
|
||||||
.. _Unknown States:
|
.. _Unknown States:
|
||||||
@@ -320,20 +329,6 @@ there will be considered a two-state variable that is read and written
|
|||||||
instead of a four-state variable.
|
instead of a four-state variable.
|
||||||
|
|
||||||
|
|
||||||
Functions & Tasks
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
All functions and tasks will be inlined (will not become functions in C.)
|
|
||||||
The only support provided is simple statements in tasks (which may
|
|
||||||
affect global variables).
|
|
||||||
|
|
||||||
Recursive functions and tasks are not supported. All inputs and outputs
|
|
||||||
are automatic as if they had the Verilog 2001 "automatic" keyword
|
|
||||||
prepended. (If you don't know what this means, Verilator will do what you
|
|
||||||
probably expect, what C does. The default behavior of Verilog is
|
|
||||||
different.)
|
|
||||||
|
|
||||||
|
|
||||||
Gate Primitives
|
Gate Primitives
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
@@ -383,24 +378,6 @@ Verilator does not support SEREs yet. All assertion and coverage
|
|||||||
statements must be simple expressions that complete in one cycle.
|
statements must be simple expressions that complete in one cycle.
|
||||||
|
|
||||||
|
|
||||||
Force statement
|
|
||||||
---------------
|
|
||||||
|
|
||||||
Verilator supports the procedural `force` (and corresponding `release`)
|
|
||||||
statement. However, the behavior of the `force` statement does not entirely
|
|
||||||
comply with IEEE 1800. According to the standard,
|
|
||||||
when a procedural statement of the form `force a = b;` is executed, the
|
|
||||||
simulation should behave as if, from that point forwards, a continuous
|
|
||||||
assignment `assign a = b;` has been added to override the drivers of `a`.
|
|
||||||
More specifically: the value of `a` should be updated whenever the value of
|
|
||||||
`b` changes, until a `release a;` statement is executed.
|
|
||||||
Verilator instead evaluates the current value of `b` when the `force`
|
|
||||||
statement is executed, and forces `a` to that value, without updating it
|
|
||||||
until a new `force` or `release` statement is encountered that applies to
|
|
||||||
`a`. This non-standard behavior is nevertheless consistent with some other
|
|
||||||
simulators.
|
|
||||||
|
|
||||||
|
|
||||||
Encrypted Verilog
|
Encrypted Verilog
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
@@ -471,6 +448,21 @@ disable
|
|||||||
provide loop break and continue functionality before SystemVerilog added
|
provide loop break and continue functionality before SystemVerilog added
|
||||||
the break and continue keywords.
|
the break and continue keywords.
|
||||||
|
|
||||||
|
force, release
|
||||||
|
Verilator supports the procedural `force` (and corresponding `release`)
|
||||||
|
statement. However, the behavior of the `force` statement does not
|
||||||
|
entirely comply with IEEE 1800. According to the standard, when a
|
||||||
|
procedural statement of the form `force a = b;` is executed, the
|
||||||
|
simulation should behave as if, from that point forwards, a continuous
|
||||||
|
assignment `assign a = b;` has been added to override the drivers of `a`.
|
||||||
|
More specifically: the value of `a` should be updated whenever the value
|
||||||
|
of `b` changes, until a `release a;` statement is executed. Verilator
|
||||||
|
instead evaluates the current value of `b` when the `force` statement is
|
||||||
|
executed, and forces `a` to that value, without updating it until a new
|
||||||
|
`force` or `release` statement is encountered that applies to `a`. This
|
||||||
|
non-standard behavior is nevertheless consistent with some other
|
||||||
|
simulators.
|
||||||
|
|
||||||
inside
|
inside
|
||||||
Inside expressions may not include unpacked array traversal or $ as an
|
Inside expressions may not include unpacked array traversal or $ as an
|
||||||
upper bound. Case inside and case matches are also unsupported.
|
upper bound. Case inside and case matches are also unsupported.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
********
|
********
|
||||||
@@ -23,12 +23,12 @@ resulting model's C++ or SystemC code is output as .cpp and .h files. This
|
|||||||
is referred to as "Verilating", and the process is "to Verilate"; the
|
is referred to as "Verilating", and the process is "to Verilate"; the
|
||||||
output is a "Verilated" model.
|
output is a "Verilated" model.
|
||||||
|
|
||||||
2. For simulation, a small-user written C++ wrapper file is required, the
|
2. For simulation, a small user-written C++ wrapper file is required, the
|
||||||
"wrapper". This wrapper defines the C++ standard function "main()", which
|
"wrapper". This wrapper defines the C++ standard function "main()", which
|
||||||
instantiates the Verilated model as a C++/SystemC object.
|
instantiates the Verilated model as a C++/SystemC object.
|
||||||
|
|
||||||
3. The user C++ wrapper, the files created by Verilator, a "runtime
|
3. The user C++ wrapper, the files created by Verilator, a "runtime
|
||||||
library" provided by Verilator, and, if applicable SystemC libraries are
|
library" provided by Verilator, and, if applicable, SystemC libraries are
|
||||||
then compiled using a C++ compiler to create a simulation executable.
|
then compiled using a C++ compiler to create a simulation executable.
|
||||||
|
|
||||||
4. The resulting executable will perform the actual simulation during
|
4. The resulting executable will perform the actual simulation during
|
||||||
@@ -44,12 +44,12 @@ The best place to get started is to try the :ref:`Examples`.
|
|||||||
.. [#] Verilog is defined by the `Institute of Electrical and Electronics
|
.. [#] Verilog is defined by the `Institute of Electrical and Electronics
|
||||||
Engineers (IEEE) Standard for Verilog Hardware Description
|
Engineers (IEEE) Standard for Verilog Hardware Description
|
||||||
Language`, Std. 1364, released in 1995, 2001, and 2005. The
|
Language`, Std. 1364, released in 1995, 2001, and 2005. The
|
||||||
Verilator documentation uses the shorthand, e.g., "IEEE 1394-2005",
|
Verilator documentation uses the shorthand, e.g., "IEEE 1364-2005",
|
||||||
to refer to the, e.g., 2005 version of this standard.
|
to refer to the, e.g., 2005 version of this standard.
|
||||||
|
|
||||||
.. [#] SystemVerilog is defined by the `Institute of Electrical and
|
.. [#] SystemVerilog is defined by the `Institute of Electrical and
|
||||||
Electronics Engineers (IEEE) Standard for SystemVerilog - Unified
|
Electronics Engineers (IEEE) Standard for SystemVerilog - Unified
|
||||||
Hardware Design, Specification, and Verification Language`, Standard
|
Hardware Design, Specification, and Verification Language`, Standard
|
||||||
1800, released in 2005, 2009, 2012, and 2017. The Verilator
|
1800, released in 2005, 2009, 2012, 2017, and 2023. The Verilator
|
||||||
documentation uses the shorthand e.g., "IEEE 1800-2017", to refer to
|
documentation uses the shorthand e.g., "IEEE 1800-2023", to refer to
|
||||||
the, e.g., 2017 version of this standard.
|
the, e.g., 2023 version of this standard.
|
||||||
|
|||||||
+102
-21
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
.. _Simulating:
|
.. _Simulating:
|
||||||
@@ -12,6 +12,60 @@ Verilated model's executable. For the runtime arguments to a simulated
|
|||||||
model, see :ref:`Simulation Runtime Arguments`.
|
model, see :ref:`Simulation Runtime Arguments`.
|
||||||
|
|
||||||
|
|
||||||
|
.. _Simulation Summary Report:
|
||||||
|
|
||||||
|
Simulation Summary Report
|
||||||
|
=========================
|
||||||
|
|
||||||
|
When simulation finishes, it will print a report to stdout summarizing the
|
||||||
|
simulation. This requires the model being Verilated with :vlopt:`--main`.
|
||||||
|
The report may be disabled with :vlopt:`+verilator+quiet`.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
- S i m u l a t i o n R e p o r t: Verilator ...
|
||||||
|
- Verilator: End at simtime 123 ns; walltime 1234.001 s; speed 123 ns/s
|
||||||
|
- Verilator: cpu 22.001 s on 4 threads; alloced 123 MB
|
||||||
|
|
||||||
|
The information in this report is:
|
||||||
|
|
||||||
|
.. describe:: "Verilator ..."
|
||||||
|
|
||||||
|
Program version.
|
||||||
|
|
||||||
|
.. describe:: "End at simtime 123 ns"
|
||||||
|
|
||||||
|
Verilog $time at which the model finished or stopped.
|
||||||
|
|
||||||
|
.. describe:: "walltime 1234.001 s"
|
||||||
|
|
||||||
|
Real elapsed wall time in seconds.
|
||||||
|
|
||||||
|
.. describe:: "speed 123.1 ns/s"
|
||||||
|
|
||||||
|
Simulated time (if non-zero) divided by wall time. e.g. `123 ns/s` means
|
||||||
|
123 simulated nanoseconds took 1 second of wall time; for a model with
|
||||||
|
only a 1 GHz clock that would be equivalent to 123.1 cycles per
|
||||||
|
second. The units are automatically selected to give a number between 1
|
||||||
|
and 1000. The wall time includes initialization, initial and final
|
||||||
|
process blocks, so indicates a slower speed than if the model had a
|
||||||
|
longer runtime.
|
||||||
|
|
||||||
|
.. describe:: "cpu 22 s"
|
||||||
|
|
||||||
|
CPU time used total across all CPU threads in seconds.
|
||||||
|
|
||||||
|
.. describe:: "4 threads"
|
||||||
|
|
||||||
|
Number of simultaneous threads used.
|
||||||
|
|
||||||
|
.. describe:: "alloced 123 MB"
|
||||||
|
|
||||||
|
Total memory used during simulation in megabytes.
|
||||||
|
|
||||||
|
|
||||||
.. _Benchmarking & Optimization:
|
.. _Benchmarking & Optimization:
|
||||||
|
|
||||||
Benchmarking & Optimization
|
Benchmarking & Optimization
|
||||||
@@ -230,14 +284,20 @@ Coverage Collection
|
|||||||
When any coverage flag is used to Verilate, Verilator will add appropriate
|
When any coverage flag is used to Verilate, Verilator will add appropriate
|
||||||
coverage point insertions into the model and collect the coverage data.
|
coverage point insertions into the model and collect the coverage data.
|
||||||
|
|
||||||
To get the coverage data from the model, in the user wrapper code,
|
To get the coverage data from the model, write the coverage with either:
|
||||||
typically at the end once a test passes, call
|
|
||||||
:code:`Verilated::threadContextp()->coveragep()->write` with an argument of the filename for
|
1. Using :vlopt:`--binary` or :vlopt:`--main`, and Verilator will dump
|
||||||
the coverage data file to write coverage data to (typically
|
coverage when the test completes to the filename specified with
|
||||||
"logs/coverage.dat").
|
:vlopt:`+verilator+coverage+file+\<filename\>`.
|
||||||
|
|
||||||
|
2. In the user wrapper code, typically at the end once a test passes, call
|
||||||
|
:code:`Verilated::threadContextp()->coveragep()->write` with an argument
|
||||||
|
of the filename for the coverage data file to write coverage data to
|
||||||
|
(typically "logs/coverage.dat").
|
||||||
|
|
||||||
Run each of your tests in different directories, potentially in parallel.
|
Run each of your tests in different directories, potentially in parallel.
|
||||||
Each test will create a :file:`logs/coverage.dat` file.
|
Each test will create the file specified above,
|
||||||
|
e.g. :file:`logs/coverage.dat`.
|
||||||
|
|
||||||
After running all of the tests, execute the :command:`verilator_coverage`
|
After running all of the tests, execute the :command:`verilator_coverage`
|
||||||
command, passing arguments pointing to the filenames of all the
|
command, passing arguments pointing to the filenames of all the
|
||||||
@@ -273,13 +333,17 @@ profiled C++ code functions.
|
|||||||
|
|
||||||
To use profiling:
|
To use profiling:
|
||||||
|
|
||||||
#. Use Verilator's :vlopt:`--prof-cfuncs`.
|
#. Make sure the Verilog code will call `$finish` at the end of simulation
|
||||||
|
(otherwise the C library may not correctly create the `gmon.out` file in
|
||||||
|
the later steps below).
|
||||||
|
#. Run Verilator, adding the :vlopt:`--prof-cfuncs` option.
|
||||||
#. Build and run the simulation model.
|
#. Build and run the simulation model.
|
||||||
#. The model will create gmon.out.
|
#. The model will create `gmon.out`.
|
||||||
#. Run :command:`gprof` to see where in the C++ code the time is spent.
|
#. Run :command:`gprof gmon.out > gprof.log` to see where in the C++ code
|
||||||
#. Run the gprof output through the :command:`verilator_profcfunc` program,
|
the time is spent.
|
||||||
and it will tell you what Verilog line numbers on which most of the time
|
#. Run :command:`verilator_profcfunc gprof.log > profcfunc.log` to take the
|
||||||
is being spent.
|
gprof output and translate into output showing the Verilog line numbers
|
||||||
|
on which most of the time is being spent.
|
||||||
|
|
||||||
|
|
||||||
.. _Execution Profiling:
|
.. _Execution Profiling:
|
||||||
@@ -505,13 +569,30 @@ documentation.
|
|||||||
Runtime Debugging
|
Runtime Debugging
|
||||||
=================
|
=================
|
||||||
|
|
||||||
To debug a Verilated executable, use the standard GNU debugger ``gdb`` or a
|
To debug a Verilated executable, Verilate with :vlopt:`--runtime-debug`.
|
||||||
similar tool. Typically you will want to have debugger symbols inserted by
|
This will instruct the compiler to insert debugger, and enable various
|
||||||
the compiler, assertions enabled in the C library, and assertions enabled
|
library assertions. These options slow down the executable, so do this
|
||||||
in the Verilated library. (These options slow down the executable, so do
|
only when debugging.
|
||||||
this only when debugging.) To enable this, Verilate with:
|
|
||||||
|
|
||||||
-CFLAGS -ggdb -LDFLAGS -ggdb -CFLAGS -DVL_DEBUG=1 -CFLAGS -D_GLIBCXX_DEBUG
|
If you are using your own Makefiles, adapt appropriately to pass the
|
||||||
|
options documented under :vlopt:`--runtime-debug` to the compiler and
|
||||||
|
linker.
|
||||||
|
|
||||||
The :vlopt:`-CFLAGS` and/or :vlopt:`-LDFLAGS` options pass arguments
|
Once you have a debugging-enabled executable, run it using the the standard
|
||||||
directly to the compiler or linker.
|
GNU debugger ``gdb`` or a similar tool, and create a backtrace; e.g.:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
gdb obj_dir/Vtop
|
||||||
|
run {Vtop_command_arguments}
|
||||||
|
{Vtop prints output, perhaps a segmentation faults}
|
||||||
|
bt
|
||||||
|
|
||||||
|
Rarely the bug may disappear with :vlopt:`--runtime-debug`; if so, try
|
||||||
|
instead using the sub-options that :vlopt:`--runtime-debug` documents, to
|
||||||
|
find the maximum subset that still shows the issue. E.g. it is likely that
|
||||||
|
using `-CFLAGS -D_GLIBCXX_DEBUG` will not hide any bug, so may be used.
|
||||||
|
|
||||||
|
Using :vlopt:`--runtime-debug` or `-CFLAGS -DVL_DEBUG=1` will only print a
|
||||||
|
message if something goes wrong. To enable debug print messages at
|
||||||
|
runtime, additionally use the :vlopt:`+verilator+debug` runtime option.
|
||||||
|
|||||||
+99
-13
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
**********
|
**********
|
||||||
@@ -7,9 +7,13 @@ Verilating
|
|||||||
|
|
||||||
Verilator may be used in five major ways:
|
Verilator may be used in five major ways:
|
||||||
|
|
||||||
|
* With the :vlopt:`--binary` option, Verilator will translate the design
|
||||||
|
into an executable, via generating C++ and compiling it. See
|
||||||
|
:ref:`Binary, C++ and SystemC Generation`.
|
||||||
|
|
||||||
* With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate
|
* With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate
|
||||||
the design into C++ or SystemC code, respectively. See :ref:`C++ and
|
the design into C++ or SystemC code, respectively. See :ref:`Binary, C++
|
||||||
SystemC Generation`.
|
and SystemC Generation`.
|
||||||
|
|
||||||
* With the :vlopt:`--lint-only` option, Verilator will lint the design to
|
* With the :vlopt:`--lint-only` option, Verilator will lint the design to
|
||||||
check for warnings but will not typically create any output files.
|
check for warnings but will not typically create any output files.
|
||||||
@@ -24,13 +28,15 @@ Verilator may be used in five major ways:
|
|||||||
expanded.
|
expanded.
|
||||||
|
|
||||||
|
|
||||||
.. _C++ and SystemC Generation:
|
.. _Binary, C++ and SystemC Generation:
|
||||||
|
|
||||||
C++ and SystemC Generation
|
Binary, C++ and SystemC Generation
|
||||||
==========================
|
==================================
|
||||||
|
|
||||||
Verilator will translate a SystemVerilog design into C++ with the
|
Verilator will translate a SystemVerilog design into C++ with the
|
||||||
:vlopt:`--cc` option, or into SystemC with the :vlopt:`--sc` option.
|
:vlopt:`--cc` option, or into SystemC with the :vlopt:`--sc` option. It
|
||||||
|
will translate into C++ and compile it into an executable binary with the
|
||||||
|
:vlopt:`--binary` option.
|
||||||
|
|
||||||
When using these options:
|
When using these options:
|
||||||
|
|
||||||
@@ -45,14 +51,19 @@ When using these options:
|
|||||||
The prefix is set with :vlopt:`--prefix`, or defaults to the name of the
|
The prefix is set with :vlopt:`--prefix`, or defaults to the name of the
|
||||||
top module.
|
top module.
|
||||||
|
|
||||||
#. If :vlopt:`--exe` is used, Verilator creates makefiles to generate a
|
#. If :vlopt:`--binary` or :vlopt:`--main` is used, Verilator creates a C++
|
||||||
simulation executable, otherwise, it creates makefiles to generate an
|
top wrapper to read command line arguments, create the model, and
|
||||||
archive (.a) containing the objects.
|
execute the model.
|
||||||
|
|
||||||
#. If :vlopt:`--build` option was used, it calls :ref:`GNU Make` or
|
#. If :vlopt:`--binary` or :vlopt:`--exe` is used, Verilator creates
|
||||||
:ref:`CMake` to build the model.
|
makefiles to generate a simulation executable, otherwise, it creates
|
||||||
|
makefiles to generate an archive (.a) containing the objects.
|
||||||
|
|
||||||
Once a model is built, it is then typically run, see :ref:`Simulating`.
|
#. If :vlopt:`--binary` or :vlopt:`--build` is used, it calls :ref:`GNU
|
||||||
|
Make` or :ref:`CMake` to build the model.
|
||||||
|
|
||||||
|
Once a model is built, the next step is typically for the user to run it,
|
||||||
|
see :ref:`Simulating`.
|
||||||
|
|
||||||
|
|
||||||
.. _Hierarchical Verilation:
|
.. _Hierarchical Verilation:
|
||||||
@@ -487,3 +498,78 @@ The search paths can be configured by setting some variables:
|
|||||||
|
|
||||||
Sets the installation prefix of an installed SystemC library. (Same as
|
Sets the installation prefix of an installed SystemC library. (Same as
|
||||||
SYSTEMC_ROOT).
|
SYSTEMC_ROOT).
|
||||||
|
|
||||||
|
|
||||||
|
.. _Verilation Summary Report:
|
||||||
|
|
||||||
|
Verilation Summary Report
|
||||||
|
=========================
|
||||||
|
|
||||||
|
When Verilator generates code, unless :vlopt:`--quiet-stats` is used, it
|
||||||
|
will print a report to stdout summarizing the build. For example:
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
- V e r i l a t i o n R e p o r t: Verilator ....
|
||||||
|
- Verilator: Built from 354 MB sources in 247 modules,
|
||||||
|
into 74 MB in 89 C++ files needing 0.192 MB
|
||||||
|
- Verilator: Walltime 26.580 s (elab=2.096, cvt=18.268,
|
||||||
|
bld=2.100); cpu 26.548 s on 1 threads; alloced 2894.672 MB
|
||||||
|
|
||||||
|
The information in this report is:
|
||||||
|
|
||||||
|
.. describe:: "Verilator ..."
|
||||||
|
|
||||||
|
Program version.
|
||||||
|
|
||||||
|
.. describe:: "234 MB sources"
|
||||||
|
|
||||||
|
Characters of post-preprocessed text in all input
|
||||||
|
Verilog and Verilator Control files in megabytes.
|
||||||
|
|
||||||
|
.. describe:: "247 modules"
|
||||||
|
|
||||||
|
Number of interfaces/modules/classes/packages in design before
|
||||||
|
elaboration.
|
||||||
|
|
||||||
|
.. describe:: "into 74 MB"
|
||||||
|
|
||||||
|
Characters of output C++ code, including comments in megabytes.
|
||||||
|
|
||||||
|
.. describe:: "89 C++ files"
|
||||||
|
|
||||||
|
Number of .cpp files created.
|
||||||
|
|
||||||
|
.. describe:: "needing 192MB"
|
||||||
|
|
||||||
|
Verilation-time minimum-bound estimate of memory needed to run model in
|
||||||
|
megabytes. (Expect to need significantly more.)
|
||||||
|
|
||||||
|
.. describe:: "Walltime 26.580 s"
|
||||||
|
|
||||||
|
Real elapsed wall time for Verilation and build.
|
||||||
|
|
||||||
|
.. describe:: "elab=2.096"
|
||||||
|
|
||||||
|
Wall time to read in files and complete elaboration.
|
||||||
|
|
||||||
|
.. describe:: "cvt=18.268"
|
||||||
|
|
||||||
|
Wall time for Verilator to process and write output.
|
||||||
|
|
||||||
|
.. describe:: "bld=2.1"
|
||||||
|
|
||||||
|
Wall time to compile gcc/clang (if using :vlopt:`--build`).
|
||||||
|
|
||||||
|
.. describe:: "cpu 22.548 s"
|
||||||
|
|
||||||
|
CPU time used, total across all CPU threads.
|
||||||
|
|
||||||
|
.. describe:: "4 threads"
|
||||||
|
|
||||||
|
Number of simultaneous threads used.
|
||||||
|
|
||||||
|
.. describe:: "alloced 123 MB"
|
||||||
|
|
||||||
|
Total memory used during build by Verilator executable (excludes
|
||||||
|
:vlopt:`--build` compiler's usage) in megabytes.
|
||||||
|
|||||||
+146
-29
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2003-2023 by Wilson Snyder.
|
.. Copyright 2003-2024 by Wilson Snyder.
|
||||||
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
*******************
|
*******************
|
||||||
@@ -12,10 +12,18 @@ Disabling Warnings
|
|||||||
|
|
||||||
Warnings may be disabled in multiple ways:
|
Warnings may be disabled in multiple ways:
|
||||||
|
|
||||||
#. Disable the warning in the source code. When the warning is printed, it
|
#. Disable the warning globally by invoking Verilator with the
|
||||||
will include a warning code. Surround the offending line with a
|
:code:`-Wno-{warning-code}` option.
|
||||||
:code:`/*verilator&32;lint_off*/` and :code:`/*verilator&32;lint_on*/`
|
|
||||||
metacomment pair:
|
Global disables should be avoided, as they removes all checking across
|
||||||
|
the source files, and prevents other users from compiling the sources
|
||||||
|
without knowing the magic set of disables needed to compile those
|
||||||
|
sources successfully.
|
||||||
|
|
||||||
|
#. Disable the warning in the design source code. When the warning is
|
||||||
|
printed, it will include a warning code. Surround the offending line
|
||||||
|
with a :code:`/*verilator&32;lint_off*/` and
|
||||||
|
:code:`/*verilator&32;lint_on*/` metacomment pair:
|
||||||
|
|
||||||
.. code-block:: sv
|
.. code-block:: sv
|
||||||
|
|
||||||
@@ -23,6 +31,12 @@ Warnings may be disabled in multiple ways:
|
|||||||
if (`DEF_THAT_IS_EQ_ZERO <= 3) $stop;
|
if (`DEF_THAT_IS_EQ_ZERO <= 3) $stop;
|
||||||
// verilator lint_on UNSIGNED
|
// verilator lint_on UNSIGNED
|
||||||
|
|
||||||
|
|
||||||
|
A lint_off in the design source code will propagate down to any child
|
||||||
|
files (files later included by the file with the lint_off), but will not
|
||||||
|
propagate upwards to any parent file (file that included the file with
|
||||||
|
the lint_off).
|
||||||
|
|
||||||
#. Disable the warning using :ref:`Configuration Files` with a
|
#. Disable the warning using :ref:`Configuration Files` with a
|
||||||
:option:`lint_off` command. This is useful when a script suppresses
|
:option:`lint_off` command. This is useful when a script suppresses
|
||||||
warnings, and the Verilog source should not be changed. This method also
|
warnings, and the Verilog source should not be changed. This method also
|
||||||
@@ -32,12 +46,6 @@ Warnings may be disabled in multiple ways:
|
|||||||
|
|
||||||
lint_off -rule UNSIGNED -file "*/example.v" -line 1
|
lint_off -rule UNSIGNED -file "*/example.v" -line 1
|
||||||
|
|
||||||
#. Disable the warning globally invoking Verilator with the
|
|
||||||
:code:`-Wno-{warning-code}` option. This should be avoided, as it
|
|
||||||
removes all checking across the designs, and prevents other users from
|
|
||||||
compiling your code without knowing the magic set of disables needed to
|
|
||||||
compile your design successfully.
|
|
||||||
|
|
||||||
|
|
||||||
Error And Warning Format
|
Error And Warning Format
|
||||||
========================
|
========================
|
||||||
@@ -153,8 +161,8 @@ List Of Warnings
|
|||||||
.. option:: BADSTDPRAGMA
|
.. option:: BADSTDPRAGMA
|
||||||
|
|
||||||
An error that a pragma is badly formed, for pragmas defined by IEEE
|
An error that a pragma is badly formed, for pragmas defined by IEEE
|
||||||
1800-2017. For example, an empty pragma line, or an incorrectly used
|
1800-2023. For example, an empty pragma line, or an incorrectly used
|
||||||
'pragma protect'. Third-party pragmas not defined by IEEE 1800-2017 are
|
'pragma protect'. Third-party pragmas not defined by IEEE 1800-2023 are
|
||||||
ignored.
|
ignored.
|
||||||
|
|
||||||
|
|
||||||
@@ -275,7 +283,7 @@ List Of Warnings
|
|||||||
Unique case statements that select on an enumerated variable, where all
|
Unique case statements that select on an enumerated variable, where all
|
||||||
of the enumerated values are covered by case items, are considered
|
of the enumerated values are covered by case items, are considered
|
||||||
complete even if the case statement does not cover illegal
|
complete even if the case statement does not cover illegal
|
||||||
non-enumerated values (IEEE 1800-2017 12.5.3). To check that illegal
|
non-enumerated values (IEEE 1800-2023 12.5.3). To check that illegal
|
||||||
values are not hit, use :vlopt:`--assert`.
|
values are not hit, use :vlopt:`--assert`.
|
||||||
|
|
||||||
Ignoring this warning will only suppress the lint check; it will
|
Ignoring this warning will only suppress the lint check; it will
|
||||||
@@ -471,7 +479,7 @@ List Of Warnings
|
|||||||
|
|
||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
%Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2017 C.4.1)
|
%Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2023 C.4.1)
|
||||||
: ... Suggest use instantiation with #(.MY_PARAM(...etc...))
|
: ... Suggest use instantiation with #(.MY_PARAM(...etc...))
|
||||||
|
|
||||||
To repair use :code:`#(.PARAMETER(...))` syntax. Repaired Example:
|
To repair use :code:`#(.PARAMETER(...))` syntax. Repaired Example:
|
||||||
@@ -699,7 +707,7 @@ List Of Warnings
|
|||||||
|
|
||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
%Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2017 27.6)
|
%Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2023 27.6)
|
||||||
|
|
||||||
To fix this assign a label (often with the naming convention prefix of
|
To fix this assign a label (often with the naming convention prefix of
|
||||||
:code:`gen_` or :code:`g_`), for example:
|
:code:`gen_` or :code:`g_`), for example:
|
||||||
@@ -755,7 +763,7 @@ List Of Warnings
|
|||||||
|
|
||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
%Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2017 13.4.1)
|
%Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2023 13.4.1)
|
||||||
|
|
||||||
The portable way to suppress this warning (in SystemVerilog) is to use a
|
The portable way to suppress this warning (in SystemVerilog) is to use a
|
||||||
void cast, for example:
|
void cast, for example:
|
||||||
@@ -1166,7 +1174,7 @@ List Of Warnings
|
|||||||
|
|
||||||
Warns that a feature requires a newer standard of Verilog or SystemVerilog
|
Warns that a feature requires a newer standard of Verilog or SystemVerilog
|
||||||
than the one specified by the :vlopt:`--language` option. For example, unsized
|
than the one specified by the :vlopt:`--language` option. For example, unsized
|
||||||
unbased literals (`'0`, `'1`, `'z`, `'x`) require 1800-2005 or later.
|
unbased literals (`'0`, `'1`, `'z`, `'x`) require IEEE 1800-2005 or later.
|
||||||
|
|
||||||
To avoid this warning, use a Verilog or SystemVerilog standard that
|
To avoid this warning, use a Verilog or SystemVerilog standard that
|
||||||
supports the feature. Alternatively, modify your code to use a different
|
supports the feature. Alternatively, modify your code to use a different
|
||||||
@@ -1320,10 +1328,35 @@ List Of Warnings
|
|||||||
.. TODO better example
|
.. TODO better example
|
||||||
|
|
||||||
An error that a package/class appears to have been referenced that has not
|
An error that a package/class appears to have been referenced that has not
|
||||||
yet been declared. According to IEEE 1800-2017 26.3, all packages must
|
yet been declared. According to IEEE 1800-2023 26.3, all packages must
|
||||||
be declared before being used.
|
be declared before being used.
|
||||||
|
|
||||||
|
|
||||||
|
.. option:: PREPROCZERO
|
||||||
|
|
||||||
|
Warns that a preprocessor \`ifdef/\`ifndef expression (added in IEEE
|
||||||
|
1800-2023) evaluates a define value which has a value of :code:`0`.
|
||||||
|
This will evaluate in the expression as :code:`1` because the define has
|
||||||
|
a definition, unlike in the C preprocessor, which evaluates using the
|
||||||
|
define's value (of :code:`1`).
|
||||||
|
|
||||||
|
Referring to a define with an empty value does not give this warning, as
|
||||||
|
in C, the preprocessor will give an error on a preprocessor expression
|
||||||
|
of a define that is empty.
|
||||||
|
|
||||||
|
.. code-block:: sv
|
||||||
|
:linenos:
|
||||||
|
:emphasize-lines: 2
|
||||||
|
|
||||||
|
`define ZERO 0
|
||||||
|
`ifdef (ZERO || ZERO) //<--- warning PREPROCZERO
|
||||||
|
`error This_will_error_which_might_be_not_the_intent
|
||||||
|
`endif
|
||||||
|
|
||||||
|
The portable way to suppress this warning is to use a define value other
|
||||||
|
than zero to when used in a preprocessor expression.
|
||||||
|
|
||||||
|
|
||||||
.. option:: PROCASSWIRE
|
.. option:: PROCASSWIRE
|
||||||
|
|
||||||
.. TODO better example
|
.. TODO better example
|
||||||
@@ -1360,7 +1393,10 @@ List Of Warnings
|
|||||||
|
|
||||||
.. option:: RANDC
|
.. option:: RANDC
|
||||||
|
|
||||||
Warns that the :code:`randc` keyword is unsupported and being converted
|
Historical, never issued since version 5.018, when :code:`randc` became
|
||||||
|
fully supported.
|
||||||
|
|
||||||
|
Warned that the :code:`randc` keyword was unsupported and was converted
|
||||||
to :code:`rand`.
|
to :code:`rand`.
|
||||||
|
|
||||||
|
|
||||||
@@ -1503,6 +1539,39 @@ List Of Warnings
|
|||||||
modeled values, or DPI calls.
|
modeled values, or DPI calls.
|
||||||
|
|
||||||
|
|
||||||
|
.. option:: SIDEEFFECT
|
||||||
|
|
||||||
|
Warns that an expression has a side effect that might not properly be
|
||||||
|
executed by Verilator.
|
||||||
|
|
||||||
|
This often represents a bug in Verilator, as opposed to a bad code
|
||||||
|
construct, however the Verilog code can typically be changed to avoid
|
||||||
|
the warning.
|
||||||
|
|
||||||
|
Faulty example:
|
||||||
|
|
||||||
|
.. code-block:: sv
|
||||||
|
:linenos:
|
||||||
|
:emphasize-lines: 1
|
||||||
|
|
||||||
|
x = y[a++];
|
||||||
|
|
||||||
|
This example warns because Verilator does not currently handle side
|
||||||
|
effects inside array subscripts; the a++ may be executed multiple times.
|
||||||
|
|
||||||
|
Rewrite the code to avoid expression side effects, typically by using a
|
||||||
|
temporary:
|
||||||
|
|
||||||
|
.. code-block:: sv
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
temp = a++;
|
||||||
|
x = y[temp];
|
||||||
|
|
||||||
|
Ignoring this warning may make Verilator simulations differ from other
|
||||||
|
simulators.
|
||||||
|
|
||||||
|
|
||||||
.. option:: SPLITVAR
|
.. option:: SPLITVAR
|
||||||
|
|
||||||
Warns that a variable with a :option:`/*verilator&32;split_var*/`
|
Warns that a variable with a :option:`/*verilator&32;split_var*/`
|
||||||
@@ -1663,7 +1732,7 @@ List Of Warnings
|
|||||||
|
|
||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
%Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.3)
|
%Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2023 3.14.2.3)
|
||||||
|
|
||||||
Recommend using :vlopt:`--timescale` argument, or in front of all
|
Recommend using :vlopt:`--timescale` argument, or in front of all
|
||||||
modules use:
|
modules use:
|
||||||
@@ -1905,7 +1974,7 @@ List Of Warnings
|
|||||||
.. option:: USERERROR
|
.. option:: USERERROR
|
||||||
|
|
||||||
A SystemVerilog elaboration-time assertion error was executed.
|
A SystemVerilog elaboration-time assertion error was executed.
|
||||||
IEEE 1800-2017 20.11 requires this error.
|
IEEE 1800-2023 20.11 requires this error.
|
||||||
|
|
||||||
Faulty example:
|
Faulty example:
|
||||||
|
|
||||||
@@ -1921,7 +1990,7 @@ List Of Warnings
|
|||||||
.. option:: USERFATAL
|
.. option:: USERFATAL
|
||||||
|
|
||||||
A SystemVerilog elaboration-time assertion fatal was executed.
|
A SystemVerilog elaboration-time assertion fatal was executed.
|
||||||
IEEE 1800-2017 20.11 requires this error.
|
IEEE 1800-2023 20.11 requires this error.
|
||||||
|
|
||||||
Faulty example:
|
Faulty example:
|
||||||
|
|
||||||
@@ -1937,7 +2006,7 @@ List Of Warnings
|
|||||||
.. option:: USERINFO
|
.. option:: USERINFO
|
||||||
|
|
||||||
A SystemVerilog elaboration-time assertion print was executed. This is
|
A SystemVerilog elaboration-time assertion print was executed. This is
|
||||||
not an error or warning, and IEEE 1800-2017 20.11 requires this
|
not an error or warning, and IEEE 1800-2023 20.11 requires this
|
||||||
behavior.
|
behavior.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -1952,7 +2021,7 @@ List Of Warnings
|
|||||||
.. option:: USERWARN
|
.. option:: USERWARN
|
||||||
|
|
||||||
A SystemVerilog elaboration-time assertion warning was executed.
|
A SystemVerilog elaboration-time assertion warning was executed.
|
||||||
IEEE 1800-2017 20.11 requires this warning.
|
IEEE 1800-2023 20.11 requires this warning.
|
||||||
|
|
||||||
Faulty example:
|
Faulty example:
|
||||||
|
|
||||||
@@ -1990,11 +2059,15 @@ List Of Warnings
|
|||||||
|
|
||||||
.. code-block:: sv
|
.. code-block:: sv
|
||||||
|
|
||||||
wait(0); // Blocks forever
|
wait(1); // Blocks forever
|
||||||
|
|
||||||
Warns that a `wait` statement awaits a constant condition, which means it
|
Warns that a `wait` statement awaits a constant condition, which means it
|
||||||
either blocks forever or never blocks.
|
either blocks forever or never blocks.
|
||||||
|
|
||||||
|
As a special case `wait(0)` with the literal constant `0` (as opposed to
|
||||||
|
something that elaborates to zero), does not warn, as it is presumed the
|
||||||
|
code is making the intent clear.
|
||||||
|
|
||||||
|
|
||||||
.. option:: WIDTH
|
.. option:: WIDTH
|
||||||
|
|
||||||
@@ -2039,17 +2112,18 @@ List Of Warnings
|
|||||||
|
|
||||||
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst
|
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst
|
||||||
|
|
||||||
|
|
||||||
.. option:: WIDTHTRUNC
|
.. option:: WIDTHTRUNC
|
||||||
|
|
||||||
A more granular WIDTH warning, for when a value is truncated
|
A more granular WIDTH warning, for when a value is truncated.
|
||||||
|
|
||||||
.. option:: WIDTHEXPAND
|
.. option:: WIDTHEXPAND
|
||||||
|
|
||||||
A more granular WIDTH warning, for when a value is zero expanded
|
A more granular WIDTH warning, for when a value is zero expanded.
|
||||||
|
|
||||||
.. option:: WIDTHXZEXPAND
|
.. option:: WIDTHXZEXPAND
|
||||||
|
|
||||||
A more granular WIDTH warning, for when a value is X/Z expanded
|
A more granular WIDTH warning, for when a value is X/Z expanded.
|
||||||
|
|
||||||
.. option:: WIDTHCONCAT
|
.. option:: WIDTHCONCAT
|
||||||
|
|
||||||
@@ -2082,3 +2156,46 @@ List Of Warnings
|
|||||||
Inactive region. Such processes do get resumed in the same time slot
|
Inactive region. Such processes do get resumed in the same time slot
|
||||||
somewhere in the Active region. Issued only if Verilator is run with the
|
somewhere in the Active region. Issued only if Verilator is run with the
|
||||||
:vlopt:`--timing` option.
|
:vlopt:`--timing` option.
|
||||||
|
|
||||||
|
.. option:: ZEROREPL
|
||||||
|
|
||||||
|
Warns that zero is used as the replication value in the replication
|
||||||
|
operator. This is specified as an error by IEEE 1800-2023 11.4.12.1.
|
||||||
|
|
||||||
|
Faulty example:
|
||||||
|
|
||||||
|
.. code-block:: sv
|
||||||
|
:linenos:
|
||||||
|
:emphasize-lines: 5
|
||||||
|
|
||||||
|
module dut
|
||||||
|
#(parameter int MY_PARAM = 0);
|
||||||
|
reg [7:0] data;
|
||||||
|
always @* begin
|
||||||
|
data = {MY_PARAM{1'b1}}; //<--- WARNING
|
||||||
|
end
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
Results in the following error:
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
%Error-ZEROREPL: test.v:5:22: Replication value of 0 is only legal under a concatenation (IEEE 1800-2023 11.4.12.1)
|
||||||
|
|
||||||
|
Note that in some cases, this warning may be false, when a condition
|
||||||
|
upstream or downstream of the access means the zero replication will
|
||||||
|
never execute or be used.
|
||||||
|
|
||||||
|
Repaired example:
|
||||||
|
|
||||||
|
.. code-block:: sv
|
||||||
|
:linenos:
|
||||||
|
:emphasize-lines: 2
|
||||||
|
|
||||||
|
module dut
|
||||||
|
#(parameter int MY_PARAM = 1); //<--- REPAIRED
|
||||||
|
reg [7:0] data;
|
||||||
|
always @* begin
|
||||||
|
data = {MY_PARAM{1'b1}};
|
||||||
|
end
|
||||||
|
endmodule
|
||||||
|
|||||||
+135
-20
@@ -224,7 +224,7 @@ Scheduling
|
|||||||
----------
|
----------
|
||||||
|
|
||||||
Verilator implements the Active and NBA regions of the SystemVerilog scheduling
|
Verilator implements the Active and NBA regions of the SystemVerilog scheduling
|
||||||
model as described in IEEE 1800-2017 chapter 4, and in particular sections
|
model as described in IEEE 1800-2023 chapter 4, and in particular sections
|
||||||
4.5 and Figure 4.1. The static (Verilation time) scheduling of SystemVerilog
|
4.5 and Figure 4.1. The static (Verilation time) scheduling of SystemVerilog
|
||||||
processes is performed by code in the ``V3Sched`` namespace. The single
|
processes is performed by code in the ``V3Sched`` namespace. The single
|
||||||
entry point to the scheduling algorithm is ``V3Sched::schedule``. Some
|
entry point to the scheduling algorithm is ``V3Sched::schedule``. Some
|
||||||
@@ -312,7 +312,7 @@ Scheduling of clocked and combinational logic
|
|||||||
For performance, clocked and combinational logic needs to be ordered.
|
For performance, clocked and combinational logic needs to be ordered.
|
||||||
Conceptually this minimizes the iterations through the evaluation loop
|
Conceptually this minimizes the iterations through the evaluation loop
|
||||||
presented in the reference algorithm in the SystemVerilog standard (IEEE
|
presented in the reference algorithm in the SystemVerilog standard (IEEE
|
||||||
1800-2017 section 4.5), by evaluating logic constructs in data-flow order.
|
1800-2023 section 4.5), by evaluating logic constructs in data-flow order.
|
||||||
Without going into a lot of detail here, accept that well thought out ordering
|
Without going into a lot of detail here, accept that well thought out ordering
|
||||||
is crucial to good simulation performance, and also enables further
|
is crucial to good simulation performance, and also enables further
|
||||||
optimizations later on.
|
optimizations later on.
|
||||||
@@ -407,7 +407,7 @@ triggered due to a combinational signal change from the previous evaluation
|
|||||||
pass, and a combinational loop settling due to hybrid logic, if the clocked
|
pass, and a combinational loop settling due to hybrid logic, if the clocked
|
||||||
logic reads the not yet settled combinationally driven signal. Such a race
|
logic reads the not yet settled combinationally driven signal. Such a race
|
||||||
is indeed possible, but our evaluation is consistent with the SystemVerilog
|
is indeed possible, but our evaluation is consistent with the SystemVerilog
|
||||||
scheduling semantics (IEEE 1800-2017 chapter 4), and therefore any program
|
scheduling semantics (IEEE 1800-2023 chapter 4), and therefore any program
|
||||||
that exhibits such a race has non-deterministic behavior according to the
|
that exhibits such a race has non-deterministic behavior according to the
|
||||||
SystemVerilog semantics, so we accept this.
|
SystemVerilog semantics, so we accept this.
|
||||||
|
|
||||||
@@ -1035,11 +1035,11 @@ Coding Conventions
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
|
|
||||||
Compiler Version and C++11
|
Compiler Version and C++14
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
Verilator requires C11. Verilator does not require any newer versions, but
|
Verilator requires C14. Verilator does not require any newer versions, but
|
||||||
is maintained to build successfully with C14/C17/C20.
|
is maintained to build successfully with C17/C20.
|
||||||
|
|
||||||
|
|
||||||
Indentation and Naming Style
|
Indentation and Naming Style
|
||||||
@@ -1222,9 +1222,9 @@ There are three ways data is passed between visitor functions.
|
|||||||
|
|
||||||
2. User attributes. Each ``AstNode`` (**Note.** The AST node, not the
|
2. User attributes. Each ``AstNode`` (**Note.** The AST node, not the
|
||||||
visitor) has five user attributes, which may be accessed as an
|
visitor) has five user attributes, which may be accessed as an
|
||||||
integer using the ``user1()`` through ``user5()`` methods, or as a
|
integer using the ``user1()`` through ``user4()`` methods, or as a
|
||||||
pointer (of type ``AstNUser``) using the ``user1p()`` through
|
pointer (of type ``AstNUser``) using the ``user1p()`` through
|
||||||
``user5p()`` methods (a common technique lifted from graph traversal
|
``user4p()`` methods (a common technique lifted from graph traversal
|
||||||
packages).
|
packages).
|
||||||
|
|
||||||
A visitor first clears the one it wants to use by calling
|
A visitor first clears the one it wants to use by calling
|
||||||
@@ -1400,7 +1400,7 @@ Controlling the Test Driver
|
|||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
The test driver script `driver.pl` runs tests; see the `Test Driver`
|
The test driver script `driver.pl` runs tests; see the `Test Driver`
|
||||||
section. The individual test drivers are written in PERL; see `Test
|
section. The individual test drivers are written in Perl; see `Test
|
||||||
Language`.
|
Language`.
|
||||||
|
|
||||||
|
|
||||||
@@ -1432,7 +1432,7 @@ Developers will also want to call ./configure with two extra flags:
|
|||||||
disabled by default, as SystemC installation problems would otherwise
|
disabled by default, as SystemC installation problems would otherwise
|
||||||
falsely indicate a Verilator problem.
|
falsely indicate a Verilator problem.
|
||||||
|
|
||||||
When enabling the long tests, some additional PERL modules are needed,
|
When enabling the long tests, some additional Perl modules are needed,
|
||||||
which you can install using cpan.
|
which you can install using cpan.
|
||||||
|
|
||||||
::
|
::
|
||||||
@@ -1462,6 +1462,19 @@ There are some traps to avoid when running regression tests
|
|||||||
system-dependent, but on Fedora Linux it would require editing the
|
system-dependent, but on Fedora Linux it would require editing the
|
||||||
``/etc/security/limits.conf`` file as root.
|
``/etc/security/limits.conf`` file as root.
|
||||||
|
|
||||||
|
Diffing generated code after changes
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
When making a change in the code generation area that should not change the
|
||||||
|
actual emitted code, it is useful to perform a diff to make sure the emitted
|
||||||
|
code really did not change. To do this, the top level Makefile provides the
|
||||||
|
*test-snap* and *test-diff* targets:
|
||||||
|
|
||||||
|
- Run the test suite with ``make test``
|
||||||
|
- Take a snapshot with ``make test-snap``
|
||||||
|
- Apply your changes
|
||||||
|
- Run the test suite again with ``make test``
|
||||||
|
- See the changes in the output with ``make test-diff``
|
||||||
|
|
||||||
Continuous Integration
|
Continuous Integration
|
||||||
----------------------
|
----------------------
|
||||||
@@ -1640,7 +1653,7 @@ Source file and line
|
|||||||
file is ``a``, the 26th is ``z``, the 27th is ``aa``, and so on.
|
file is ``a``, the 26th is ``z``, the 27th is ``aa``, and so on.
|
||||||
|
|
||||||
User pointers
|
User pointers
|
||||||
Shows the value of the node's user1p...user5p, if non-NULL.
|
Shows the value of the node's user1p...user4p, if non-NULL.
|
||||||
|
|
||||||
Data type
|
Data type
|
||||||
Many nodes have an explicit data type. "@dt=0x..." indicates the
|
Many nodes have an explicit data type. "@dt=0x..." indicates the
|
||||||
@@ -1683,6 +1696,84 @@ Similarly, the ``NETLIST`` has a list of modules referred to by its
|
|||||||
``op1p()`` pointer.
|
``op1p()`` pointer.
|
||||||
|
|
||||||
|
|
||||||
|
.tree.json Output
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
``.tree.json``` is an alternative dump format to ``.tree`` that is meant for
|
||||||
|
programmatic processing (e.g. with `astsee <https://github.com/antmicro/astsee>`_).
|
||||||
|
To enable this dump format, use :vlopt:`--dump-tree-json` or :vlopt:`--json-only`.
|
||||||
|
|
||||||
|
Structure:
|
||||||
|
::
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Attributes that are common to all types of nodes */
|
||||||
|
"type": "VAR",
|
||||||
|
"name": "cyc",
|
||||||
|
/* By default addresses and filenames use short/stable ids rather than real value */
|
||||||
|
"addr": "(H)",
|
||||||
|
"loc": "a,25:12,26:15", /* "fileid,firstLine:firstCol,lastLine:endCol" (endCol is right exclusive) */
|
||||||
|
"editNum": 602,
|
||||||
|
/* Fields that are specific to AstVar nodes: */
|
||||||
|
"origName": "cyc",
|
||||||
|
"isSc": false,
|
||||||
|
"ioDirection": "NONE",
|
||||||
|
"isConst": false,
|
||||||
|
"isPullup": false,
|
||||||
|
"isPulldown": false,
|
||||||
|
"isUsedClock": false,
|
||||||
|
"isSigPublic": false,
|
||||||
|
"isLatched": false,
|
||||||
|
"isUsedLoopIdx": false,
|
||||||
|
"noReset": false,
|
||||||
|
"attrIsolateAssign": false,
|
||||||
|
"attrFileDescr": false,
|
||||||
|
"isDpiOpenArray": false,
|
||||||
|
"isFuncReturn": false,
|
||||||
|
"isFuncLocal": false,
|
||||||
|
"attrClocker": "UNKNOWN",
|
||||||
|
"lifetime": "NONE",
|
||||||
|
"varType": "VAR",
|
||||||
|
/* Lists of child nodes (which use similar structure as their parent): */
|
||||||
|
"childDTypep": [ /* ... */ ],
|
||||||
|
"delayp": [ /* ... */ ],
|
||||||
|
"valuep": [ /* ... */ ],
|
||||||
|
"attrsp": [ /* ... */ ]
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree.meta.json Output
|
||||||
|
----------------
|
||||||
|
.tree.meta.json contains metadata that is common across the whole AST tree
|
||||||
|
(in case of --dump-tree-json, multiple trees share one meta file).
|
||||||
|
|
||||||
|
Besides de-duplication of data shared between multiple stages, .meta.json enables offloading
|
||||||
|
unstable data (that can vary from machine-to-machine or run-to-run) from main .tree.json.
|
||||||
|
This offloading allows, for example, to use byte-to-byte comparisons of AST dumps in tests.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
{"files": {
|
||||||
|
/* Map id to filename, and other metadata */
|
||||||
|
"d": {"filename":"/home/ant/tmp/verilator/include/verilated_std.sv", "realpath":"/home/ant/tmp/verilator/include/verilated_std.sv", "language":"1800-2023"},
|
||||||
|
"a": {"filename":"<built-in>", "realpath":"<built-in>", "language":"1800-2023"},
|
||||||
|
"b": {"filename":"<command-line>", "realpath":"<command-line>", "language":"1800-2023"},
|
||||||
|
"c": {"filename":"input.vc", "realpath":"/home/ant/tmp/verilator/test_regress/input.vc", "language":"1800-2023"},
|
||||||
|
"e": {"filename":"t/t_EXAMPLE.v", "realpath":"/home/ant/tmp/verilator/test_regress/t/t_EXAMPLE.v", "language":"1800-2023"}
|
||||||
|
},"pointers": {
|
||||||
|
/* Map id to real address */
|
||||||
|
"(AG)": "0x562997289180",
|
||||||
|
"(YF)": "0x5629971c50b0",
|
||||||
|
"(WF)": "0x5629971e7ae0",
|
||||||
|
/* ... /*
|
||||||
|
},"ptrFieldNames": [
|
||||||
|
/* List of fields that are used for storing pointers */
|
||||||
|
"aboveScopep",
|
||||||
|
"voidp",
|
||||||
|
"addr",
|
||||||
|
/* ... */
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
.tree.dot Output
|
.tree.dot Output
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@@ -1755,6 +1846,20 @@ To print a node:
|
|||||||
pnt nodep
|
pnt nodep
|
||||||
# or: call dumpTreeGdb(nodep) # aliased to "pnt" in src/.gdbinit
|
# or: call dumpTreeGdb(nodep) # aliased to "pnt" in src/.gdbinit
|
||||||
|
|
||||||
|
``src/.gdbinit`` and ``src/.gdbinit.py`` define handy utilities for working with
|
||||||
|
JSON AST dumps. For example:
|
||||||
|
|
||||||
|
* ``jstash nodep`` - Perform a JSON AST dump and save it into GDB value history (e.g. ``$1``)
|
||||||
|
* ``jtree nodep`` - Perform a JSON AST dump and pretty print it using ``astsee_verilator``.
|
||||||
|
* ``jtree $1`` - Pretty print a dump that was previously saved by ``jstash``.
|
||||||
|
* ``jtree nodep -d '.file, .timeunit'`` - Perform a JSON AST dump, filter out some fields and pretty print it.
|
||||||
|
* ``jtree 0x55555613dca0`` - Pretty print using address literal (rather than actual pointer).
|
||||||
|
* ``jtree $1 nodep`` - Diff ``nodep`` against an older dump.
|
||||||
|
|
||||||
|
A detailed description of ``jstash`` and ``jtree`` can be displayed using ``gdb``'s ``help`` command.
|
||||||
|
|
||||||
|
These commands require `astsee <https://github.com/antmicro/astsee>`_ to be installed.
|
||||||
|
|
||||||
When GDB halts, it is useful to understand that the backtrace will commonly
|
When GDB halts, it is useful to understand that the backtrace will commonly
|
||||||
show the iterator functions between each invocation of ``visit`` in the
|
show the iterator functions between each invocation of ``visit`` in the
|
||||||
backtrace. You will typically see a frame sequence something like:
|
backtrace. You will typically see a frame sequence something like:
|
||||||
@@ -1816,21 +1921,21 @@ Verilator ideally would support all of IEEE, and has the goal to get close
|
|||||||
to full support. However the following IEEE sections and features are not
|
to full support. However the following IEEE sections and features are not
|
||||||
anticipated to be ever implemented for the reasons indicated.
|
anticipated to be ever implemented for the reasons indicated.
|
||||||
|
|
||||||
IEEE 1800-2017 3.3 modules within modules
|
IEEE 1800-2023 3.3 modules within modules
|
||||||
Little/no tool support, and arguably not a good practice.
|
Little/no tool support, and arguably not a good practice.
|
||||||
IEEE 1800-2017 6.12 "shortreal"
|
IEEE 1800-2023 6.12 "shortreal"
|
||||||
Little/no tool support, and easily promoted to real.
|
Little/no tool support, and easily promoted to real.
|
||||||
IEEE 1800-2017 11.11 Min, typ, max
|
IEEE 1800-2023 11.11 Min, typ, max
|
||||||
No SDF support, so will always use typical.
|
No SDF support, so will always use typical.
|
||||||
IEEE 1800-2017 20.16 Stochastic analysis
|
IEEE 1800-2023 20.16 Stochastic analysis
|
||||||
Little industry use.
|
Little industry use.
|
||||||
IEEE 1800-2017 20.17 PLA modeling
|
IEEE 1800-2023 20.17 PLA modeling
|
||||||
Little industry use and outdated technology.
|
Little industry use and outdated technology.
|
||||||
IEEE 1800-2017 31 Timing checks
|
IEEE 1800-2023 31 Timing checks
|
||||||
No longer relevant with static timing analysis tools.
|
No longer relevant with static timing analysis tools.
|
||||||
IEEE 1800-2017 32 SDF annotation
|
IEEE 1800-2023 32 SDF annotation
|
||||||
No longer relevant with static timing analysis tools.
|
No longer relevant with static timing analysis tools.
|
||||||
IEEE 1800-2017 33 Config
|
IEEE 1800-2023 33 Config
|
||||||
Little industry use.
|
Little industry use.
|
||||||
|
|
||||||
|
|
||||||
@@ -1871,6 +1976,10 @@ driver.pl Non-Scenario Arguments
|
|||||||
files with dumping level 3, which dumps the standard critical stages.
|
files with dumping level 3, which dumps the standard critical stages.
|
||||||
For details on the format see `.tree Output`.
|
For details on the format see `.tree Output`.
|
||||||
|
|
||||||
|
--fail-max <numtests>
|
||||||
|
Set the number of failing tests, after which the driver will stop running
|
||||||
|
additional tests. Defaults to 20, 0 disables.
|
||||||
|
|
||||||
--gdb
|
--gdb
|
||||||
Same as ``verilator --gdb``: Run Verilator under the debugger.
|
Same as ``verilator --gdb``: Run Verilator under the debugger.
|
||||||
|
|
||||||
@@ -1924,6 +2033,9 @@ driver.pl Non-Scenario Arguments
|
|||||||
--trace
|
--trace
|
||||||
Set the simulator specific flags to request waveform tracing.
|
Set the simulator specific flags to request waveform tracing.
|
||||||
|
|
||||||
|
--valgrind
|
||||||
|
Same as ``verilator --valgrind``: Run Verilator under `Valgrind <https://valgrind.org/>`_.
|
||||||
|
|
||||||
--verbose
|
--verbose
|
||||||
Compile and run the test in verbose mode. This means ``TEST_VERBOSE``
|
Compile and run the test in verbose mode. This means ``TEST_VERBOSE``
|
||||||
will be defined for the test (Verilog and any C++/SystemC wrapper).
|
will be defined for the test (Verilog and any C++/SystemC wrapper).
|
||||||
@@ -1967,6 +2079,9 @@ simultaneously.
|
|||||||
--vltmt
|
--vltmt
|
||||||
Run Verilator tests in multithreaded mode.
|
Run Verilator tests in multithreaded mode.
|
||||||
|
|
||||||
|
--xrun
|
||||||
|
Run Cadence Xcelium simulator tests.
|
||||||
|
|
||||||
--xsim
|
--xsim
|
||||||
Run Xilinx XSim simulator tests.
|
Run Xilinx XSim simulator tests.
|
||||||
|
|
||||||
@@ -2224,7 +2339,7 @@ xsim_flags / xsim_flags2 / xsim_run_flags
|
|||||||
Distribution
|
Distribution
|
||||||
============
|
============
|
||||||
|
|
||||||
Copyright 2008-2023 by Wilson Snyder. Verilator is free software; you can
|
Copyright 2008-2024 by Wilson Snyder. Verilator is free software; you can
|
||||||
redistribute it and/or modify it under the terms of either the GNU Lesser
|
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.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
ABCp
|
ABCp
|
||||||
|
Aadi
|
||||||
Accellera
|
Accellera
|
||||||
Affe
|
Affe
|
||||||
Aleksander
|
Aleksander
|
||||||
@@ -13,21 +14,26 @@ Antonin
|
|||||||
Antwerpen
|
Antwerpen
|
||||||
Arasanipalai
|
Arasanipalai
|
||||||
Arjen
|
Arjen
|
||||||
|
Arshid
|
||||||
Asciidoc
|
Asciidoc
|
||||||
Ashutosh
|
Ashutosh
|
||||||
Ast
|
Ast
|
||||||
Atmel
|
Atmel
|
||||||
Aurelien
|
Aurelien
|
||||||
Bagri
|
Bagri
|
||||||
|
Balboni
|
||||||
Baltazar
|
Baltazar
|
||||||
Bardsley
|
Bardsley
|
||||||
Benchmarking
|
Benchmarking
|
||||||
Berman
|
Berman
|
||||||
Bhagavatula
|
Bhagavatula
|
||||||
Bhattacharyya
|
Bhattacharyya
|
||||||
|
Biancolin
|
||||||
Binderman
|
Binderman
|
||||||
|
Björk
|
||||||
Bleiweiss
|
Bleiweiss
|
||||||
Bogdan
|
Bogdan
|
||||||
|
Bonneau
|
||||||
Bouchard
|
Bouchard
|
||||||
Boumenot
|
Boumenot
|
||||||
Brej
|
Brej
|
||||||
@@ -35,32 +41,41 @@ Briquet
|
|||||||
Brownlee
|
Brownlee
|
||||||
Buckenmaier
|
Buckenmaier
|
||||||
Bybell
|
Bybell
|
||||||
|
CLang
|
||||||
CMake
|
CMake
|
||||||
Cai
|
Cai
|
||||||
Cavium
|
Cavium
|
||||||
Cfuncs
|
Cfuncs
|
||||||
Chandan
|
Chandan
|
||||||
|
Chentai
|
||||||
|
Cherkasov
|
||||||
|
Chih
|
||||||
Chitlesh
|
Chitlesh
|
||||||
Christophe
|
Christophe
|
||||||
Cochrane
|
Cochrane
|
||||||
Conda
|
Conda
|
||||||
Corteggiani
|
Corteggiani
|
||||||
|
Cozzocrea
|
||||||
Cuan
|
Cuan
|
||||||
Cygwin
|
Cygwin
|
||||||
DErrico
|
DErrico
|
||||||
DFG
|
DFG
|
||||||
Da
|
Da
|
||||||
|
Dai
|
||||||
Danilo
|
Danilo
|
||||||
Dannoritzer
|
Dannoritzer
|
||||||
Das
|
Das
|
||||||
|
Davide
|
||||||
Dcache
|
Dcache
|
||||||
Deadman
|
Deadman
|
||||||
Debacker
|
Debacker
|
||||||
Deepa
|
Deepa
|
||||||
Defparams
|
Defparams
|
||||||
|
Delm
|
||||||
Denio
|
Denio
|
||||||
Deprecations
|
Deprecations
|
||||||
Deroo
|
Deroo
|
||||||
|
Desai
|
||||||
Dickol
|
Dickol
|
||||||
Diez
|
Diez
|
||||||
Dimitris
|
Dimitris
|
||||||
@@ -69,9 +84,11 @@ Djordjevic
|
|||||||
Dobbie
|
Dobbie
|
||||||
Dockerfile
|
Dockerfile
|
||||||
Donal
|
Donal
|
||||||
|
Donovick
|
||||||
Doorn
|
Doorn
|
||||||
Doxygen
|
Doxygen
|
||||||
Dressler
|
Dressler
|
||||||
|
Dudek
|
||||||
Duraid
|
Duraid
|
||||||
Dutton
|
Dutton
|
||||||
Dzetkulic
|
Dzetkulic
|
||||||
@@ -89,14 +106,20 @@ Engstrom
|
|||||||
Enzo
|
Enzo
|
||||||
Eugen
|
Eugen
|
||||||
Fabrizio
|
Fabrizio
|
||||||
|
Faucher
|
||||||
|
Faure
|
||||||
Fekete
|
Fekete
|
||||||
Ferrandi
|
Ferrandi
|
||||||
Flachs
|
Flachs
|
||||||
Flavien
|
Flavien
|
||||||
|
Florian
|
||||||
Foletto
|
Foletto
|
||||||
|
Forencich
|
||||||
Forker
|
Forker
|
||||||
Francillon
|
Francillon
|
||||||
Fredieu
|
Fredieu
|
||||||
|
Freiberger
|
||||||
|
Frédéric
|
||||||
GTKWave
|
GTKWave
|
||||||
Galbi
|
Galbi
|
||||||
Gantt
|
Gantt
|
||||||
@@ -116,18 +139,24 @@ Goessling
|
|||||||
Gonnen
|
Gonnen
|
||||||
Goorah
|
Goorah
|
||||||
Gossner
|
Gossner
|
||||||
|
Graba
|
||||||
Graphviz
|
Graphviz
|
||||||
Graybeal
|
Graybeal
|
||||||
Grobman
|
Grobman
|
||||||
Grulfen
|
Grulfen
|
||||||
|
Gu
|
||||||
Gunter
|
Gunter
|
||||||
Guo
|
Guo
|
||||||
|
Hameed
|
||||||
Hao
|
Hao
|
||||||
|
Haojin
|
||||||
Harboe
|
Harboe
|
||||||
Hashimoto
|
Hashimoto
|
||||||
Hayenga
|
Hayenga
|
||||||
|
Hesselbarth
|
||||||
Hewson
|
Hewson
|
||||||
Hicamp
|
Hicamp
|
||||||
|
Hideto
|
||||||
Hiroki
|
Hiroki
|
||||||
Holdsworth
|
Holdsworth
|
||||||
Holme
|
Holme
|
||||||
@@ -135,8 +164,10 @@ Homebrew
|
|||||||
Hornung
|
Hornung
|
||||||
Hossell
|
Hossell
|
||||||
Hsu
|
Hsu
|
||||||
|
Hutt
|
||||||
Hyperthreading
|
Hyperthreading
|
||||||
Ibrahim
|
Ibrahim
|
||||||
|
Ikram
|
||||||
Iles
|
Iles
|
||||||
Inlines
|
Inlines
|
||||||
Inout
|
Inout
|
||||||
@@ -148,11 +179,14 @@ Jae
|
|||||||
Jalloq
|
Jalloq
|
||||||
Jankowski
|
Jankowski
|
||||||
Jannis
|
Jannis
|
||||||
|
Jasen
|
||||||
Jens
|
Jens
|
||||||
Jeras
|
Jeras
|
||||||
|
Jiaxun
|
||||||
Jiuyang
|
Jiuyang
|
||||||
Joannou
|
Joannou
|
||||||
Joly
|
Joly
|
||||||
|
Josse
|
||||||
Jullien
|
Jullien
|
||||||
Junji
|
Junji
|
||||||
Junyi
|
Junyi
|
||||||
@@ -163,6 +197,7 @@ Kahn
|
|||||||
Kai
|
Kai
|
||||||
Kamendje
|
Kamendje
|
||||||
Kandadi
|
Kandadi
|
||||||
|
Kaneda
|
||||||
Kaplan
|
Kaplan
|
||||||
Karge
|
Karge
|
||||||
Karlsson
|
Karlsson
|
||||||
@@ -178,6 +213,7 @@ Klnv
|
|||||||
Koenig
|
Koenig
|
||||||
Koh
|
Koh
|
||||||
Kolecki
|
Kolecki
|
||||||
|
Konstantin
|
||||||
Koonce
|
Koonce
|
||||||
Korteland
|
Korteland
|
||||||
Koszek
|
Koszek
|
||||||
@@ -189,17 +225,23 @@ Kumashikar
|
|||||||
Kuoping
|
Kuoping
|
||||||
Kurachi
|
Kurachi
|
||||||
Laeufer
|
Laeufer
|
||||||
|
Laroche
|
||||||
Laurens
|
Laurens
|
||||||
Lavino
|
Lavino
|
||||||
Leber
|
Leber
|
||||||
Leendert
|
Leendert
|
||||||
Lem
|
Lem
|
||||||
Lesik
|
Lesik
|
||||||
|
Libenzi
|
||||||
|
Licker
|
||||||
Liland
|
Liland
|
||||||
Liu
|
Liu
|
||||||
|
Liwei
|
||||||
Lockhart
|
Lockhart
|
||||||
Longo
|
Longo
|
||||||
|
Luca
|
||||||
Lussier
|
Lussier
|
||||||
|
Lübeck
|
||||||
MMD
|
MMD
|
||||||
MODDUP
|
MODDUP
|
||||||
MTasks
|
MTasks
|
||||||
@@ -209,11 +251,17 @@ Mahesh
|
|||||||
Mahmoudy
|
Mahmoudy
|
||||||
Makefile
|
Makefile
|
||||||
Makefiles
|
Makefiles
|
||||||
|
Maksymenko
|
||||||
|
Markley
|
||||||
|
Marquet
|
||||||
Matveyenko
|
Matveyenko
|
||||||
Maupin
|
Maupin
|
||||||
Mdir
|
Mdir
|
||||||
Mednick
|
Mednick
|
||||||
|
Mei
|
||||||
|
Melo
|
||||||
Menküc
|
Menküc
|
||||||
|
Michail
|
||||||
Michiels
|
Michiels
|
||||||
Microsystems
|
Microsystems
|
||||||
Milanovic
|
Milanovic
|
||||||
@@ -229,9 +277,11 @@ Mong
|
|||||||
Muhlestein
|
Muhlestein
|
||||||
Multithreaded
|
Multithreaded
|
||||||
Multithreading
|
Multithreading
|
||||||
|
Mykyta
|
||||||
NOUNOPTFLAT
|
NOUNOPTFLAT
|
||||||
NaN
|
NaN
|
||||||
Nalbantis
|
Nalbantis
|
||||||
|
Nandor
|
||||||
Narayan
|
Narayan
|
||||||
Nassim
|
Nassim
|
||||||
Nauticus
|
Nauticus
|
||||||
@@ -242,16 +292,20 @@ Niranjan
|
|||||||
Nitza
|
Nitza
|
||||||
Noack
|
Noack
|
||||||
Nodine
|
Nodine
|
||||||
|
Ober
|
||||||
Oleg
|
Oleg
|
||||||
Olof
|
Olof
|
||||||
Olofsson
|
Olofsson
|
||||||
|
Oron
|
||||||
Oyvind
|
Oyvind
|
||||||
PLI
|
PLI
|
||||||
Palaniappan
|
Palaniappan
|
||||||
Patricio
|
Patricio
|
||||||
Petr
|
Petr
|
||||||
|
Piard
|
||||||
Piechotka
|
Piechotka
|
||||||
Piersall
|
Piersall
|
||||||
|
Platz
|
||||||
Platzer
|
Platzer
|
||||||
Plunkett
|
Plunkett
|
||||||
Popolon
|
Popolon
|
||||||
@@ -263,10 +317,13 @@ Pre
|
|||||||
Preprocess
|
Preprocess
|
||||||
Pretet
|
Pretet
|
||||||
Pretl
|
Pretl
|
||||||
|
Pringlemeir
|
||||||
Priyadharshini
|
Priyadharshini
|
||||||
Pullup
|
Pullup
|
||||||
Pulver
|
Pulver
|
||||||
Puri
|
Puri
|
||||||
|
Qin
|
||||||
|
Qiu
|
||||||
Questa
|
Questa
|
||||||
Rachit
|
Rachit
|
||||||
Ralf
|
Ralf
|
||||||
@@ -276,27 +333,37 @@ Reitan
|
|||||||
Renga
|
Renga
|
||||||
Requin
|
Requin
|
||||||
Rodionov
|
Rodionov
|
||||||
|
Rohan
|
||||||
Rolfe
|
Rolfe
|
||||||
|
Rontionov
|
||||||
Roodselaar
|
Roodselaar
|
||||||
|
Roshit
|
||||||
Runtime
|
Runtime
|
||||||
Ruud
|
Ruud
|
||||||
Rystsov
|
Rystsov
|
||||||
STandarD
|
STandarD
|
||||||
Salman
|
Salman
|
||||||
|
Sammelson
|
||||||
|
Sanggyu
|
||||||
Sanguinetti
|
Sanguinetti
|
||||||
Sanjay
|
Sanjay
|
||||||
|
Sasselli
|
||||||
Scharrer
|
Scharrer
|
||||||
Seitz
|
Seitz
|
||||||
|
Shahid
|
||||||
Shankar
|
Shankar
|
||||||
Shanshan
|
Shanshan
|
||||||
Sharad
|
Sharad
|
||||||
Shareef
|
Shareef
|
||||||
|
Shen
|
||||||
Sheng
|
Sheng
|
||||||
Shi
|
Shi
|
||||||
Shinkarovsky
|
Shinkarovsky
|
||||||
|
Shinya
|
||||||
Shirakawa
|
Shirakawa
|
||||||
Shuba
|
Shuba
|
||||||
Shunyao
|
Shunyao
|
||||||
|
Slager
|
||||||
Slatter
|
Slatter
|
||||||
SoC
|
SoC
|
||||||
Sobhan
|
Sobhan
|
||||||
@@ -316,6 +383,7 @@ Stucki
|
|||||||
Su
|
Su
|
||||||
Suguimoto
|
Suguimoto
|
||||||
Sundararajan
|
Sundararajan
|
||||||
|
Sunderland
|
||||||
Suse
|
Suse
|
||||||
Syms
|
Syms
|
||||||
Synopsys
|
Synopsys
|
||||||
@@ -323,6 +391,7 @@ SystemC
|
|||||||
SystemVerilog
|
SystemVerilog
|
||||||
Takatsukasa
|
Takatsukasa
|
||||||
Tambe
|
Tambe
|
||||||
|
Tarik
|
||||||
Tariq
|
Tariq
|
||||||
Tejada
|
Tejada
|
||||||
Tengstrand
|
Tengstrand
|
||||||
@@ -330,6 +399,7 @@ Terpstra
|
|||||||
Thiede
|
Thiede
|
||||||
Thierry
|
Thierry
|
||||||
Thyer
|
Thyer
|
||||||
|
Tianrui
|
||||||
Tichelaar
|
Tichelaar
|
||||||
Timi
|
Timi
|
||||||
Tomov
|
Tomov
|
||||||
@@ -340,9 +410,11 @@ Trefor
|
|||||||
Tresidder
|
Tresidder
|
||||||
Tri
|
Tri
|
||||||
Tristate
|
Tristate
|
||||||
|
Truong
|
||||||
Turton
|
Turton
|
||||||
UNOPTFLAT
|
UNOPTFLAT
|
||||||
Ubixum
|
Ubixum
|
||||||
|
Ueno
|
||||||
Uints
|
Uints
|
||||||
Undefines
|
Undefines
|
||||||
Unsized
|
Unsized
|
||||||
@@ -351,6 +423,7 @@ Uselib
|
|||||||
Usha
|
Usha
|
||||||
Usuario
|
Usuario
|
||||||
VERILATOR
|
VERILATOR
|
||||||
|
Vandergriendt
|
||||||
Vasu
|
Vasu
|
||||||
Vdeeptemp
|
Vdeeptemp
|
||||||
Vdly
|
Vdly
|
||||||
@@ -368,6 +441,7 @@ Verilog
|
|||||||
Vighnesh
|
Vighnesh
|
||||||
Viktor
|
Viktor
|
||||||
Vilp
|
Vilp
|
||||||
|
Vlip
|
||||||
Vm
|
Vm
|
||||||
Vukobratovic
|
Vukobratovic
|
||||||
Wai
|
Wai
|
||||||
@@ -388,14 +462,21 @@ Wwarn
|
|||||||
XSim
|
XSim
|
||||||
Xcelium
|
Xcelium
|
||||||
Xiaoliang
|
Xiaoliang
|
||||||
|
Xiaoyi
|
||||||
Xuan
|
Xuan
|
||||||
Xuanqi
|
Xuanqi
|
||||||
|
Yao
|
||||||
Yazdanbakhsh
|
Yazdanbakhsh
|
||||||
|
Yernagula
|
||||||
Yi
|
Yi
|
||||||
Yike
|
Yike
|
||||||
Yinan
|
Yinan
|
||||||
|
Yoshitomo
|
||||||
Yosys
|
Yosys
|
||||||
Yu
|
Yu
|
||||||
|
Yujia
|
||||||
|
Yurii
|
||||||
|
Zaruba
|
||||||
Zhang
|
Zhang
|
||||||
abirkmanis
|
abirkmanis
|
||||||
accessor
|
accessor
|
||||||
@@ -415,6 +496,7 @@ arrarys
|
|||||||
assertOn
|
assertOn
|
||||||
astgen
|
astgen
|
||||||
async
|
async
|
||||||
|
atClone
|
||||||
ato
|
ato
|
||||||
atoi
|
atoi
|
||||||
autoconf
|
autoconf
|
||||||
@@ -443,6 +525,7 @@ buildenv
|
|||||||
bv
|
bv
|
||||||
bvs
|
bvs
|
||||||
callValueCbs
|
callValueCbs
|
||||||
|
callgrind
|
||||||
casex
|
casex
|
||||||
casez
|
casez
|
||||||
casted
|
casted
|
||||||
@@ -482,6 +565,7 @@ countbits
|
|||||||
countones
|
countones
|
||||||
cout
|
cout
|
||||||
cpp
|
cpp
|
||||||
|
cppstyle
|
||||||
cpu
|
cpu
|
||||||
ctor
|
ctor
|
||||||
ctrace
|
ctrace
|
||||||
@@ -506,8 +590,10 @@ der
|
|||||||
dereference
|
dereference
|
||||||
desassign
|
desassign
|
||||||
destructor
|
destructor
|
||||||
|
desynchronization
|
||||||
detections
|
detections
|
||||||
dev
|
dev
|
||||||
|
devcontainer
|
||||||
devel
|
devel
|
||||||
dir
|
dir
|
||||||
displayb
|
displayb
|
||||||
@@ -516,6 +602,7 @@ doxygen
|
|||||||
dpiGetContext
|
dpiGetContext
|
||||||
dpic
|
dpic
|
||||||
dsvf
|
dsvf
|
||||||
|
dt
|
||||||
dtor
|
dtor
|
||||||
dumpall
|
dumpall
|
||||||
dumpfile
|
dumpfile
|
||||||
@@ -534,6 +621,7 @@ dut
|
|||||||
dx
|
dx
|
||||||
dynarray
|
dynarray
|
||||||
elab
|
elab
|
||||||
|
eliasphanna
|
||||||
elike
|
elike
|
||||||
elsif
|
elsif
|
||||||
endcase
|
endcase
|
||||||
@@ -556,6 +644,7 @@ envvar
|
|||||||
eof
|
eof
|
||||||
errae
|
errae
|
||||||
erroring
|
erroring
|
||||||
|
esynr
|
||||||
et
|
et
|
||||||
eval
|
eval
|
||||||
evals
|
evals
|
||||||
@@ -587,6 +676,7 @@ foreach
|
|||||||
fprintf
|
fprintf
|
||||||
fprofile
|
fprofile
|
||||||
fread
|
fread
|
||||||
|
freloop
|
||||||
frewind
|
frewind
|
||||||
fs
|
fs
|
||||||
fscanf
|
fscanf
|
||||||
@@ -609,6 +699,7 @@ genvars
|
|||||||
getenv
|
getenv
|
||||||
getline
|
getline
|
||||||
ggdb
|
ggdb
|
||||||
|
glibc
|
||||||
gmake
|
gmake
|
||||||
gmon
|
gmon
|
||||||
gotFinish
|
gotFinish
|
||||||
@@ -653,6 +744,8 @@ ish
|
|||||||
isunbounded
|
isunbounded
|
||||||
isunknown
|
isunknown
|
||||||
jobserver
|
jobserver
|
||||||
|
json
|
||||||
|
jwoutersymatra
|
||||||
killua
|
killua
|
||||||
lang
|
lang
|
||||||
lcov
|
lcov
|
||||||
@@ -664,6 +757,7 @@ libext
|
|||||||
libgoogle
|
libgoogle
|
||||||
libsystemc
|
libsystemc
|
||||||
libtcmalloc
|
libtcmalloc
|
||||||
|
libverilated
|
||||||
linkers
|
linkers
|
||||||
linter
|
linter
|
||||||
linux
|
linux
|
||||||
@@ -692,6 +786,7 @@ miree
|
|||||||
mis
|
mis
|
||||||
misconnected
|
misconnected
|
||||||
misconversion
|
misconversion
|
||||||
|
misoptimized
|
||||||
missized
|
missized
|
||||||
mk
|
mk
|
||||||
mno
|
mno
|
||||||
@@ -716,6 +811,7 @@ multithreading
|
|||||||
musl
|
musl
|
||||||
mutexes
|
mutexes
|
||||||
mux
|
mux
|
||||||
|
muzafferkal
|
||||||
myftptoyman
|
myftptoyman
|
||||||
mysignal
|
mysignal
|
||||||
namespace
|
namespace
|
||||||
@@ -754,6 +850,7 @@ pdf
|
|||||||
perf
|
perf
|
||||||
perftools
|
perftools
|
||||||
pgo
|
pgo
|
||||||
|
phelter
|
||||||
picoChip
|
picoChip
|
||||||
pinIndex
|
pinIndex
|
||||||
pinout
|
pinout
|
||||||
@@ -771,7 +868,9 @@ pragma
|
|||||||
pragmas
|
pragmas
|
||||||
pre
|
pre
|
||||||
precisions
|
precisions
|
||||||
|
precompiled
|
||||||
predefines
|
predefines
|
||||||
|
prepareClone
|
||||||
prepend
|
prepend
|
||||||
prepended
|
prepended
|
||||||
preprocess
|
preprocess
|
||||||
@@ -795,10 +894,12 @@ pvalue
|
|||||||
pwd
|
pwd
|
||||||
py
|
py
|
||||||
qrq
|
qrq
|
||||||
|
qrqiuren
|
||||||
radix
|
radix
|
||||||
randc
|
randc
|
||||||
randcase
|
randcase
|
||||||
randstate
|
randstate
|
||||||
|
raphmaster
|
||||||
rarr
|
rarr
|
||||||
rdtsc
|
rdtsc
|
||||||
reStructuredText
|
reStructuredText
|
||||||
@@ -808,11 +909,13 @@ readmemb
|
|||||||
readmemh
|
readmemh
|
||||||
realpath
|
realpath
|
||||||
realtime
|
realtime
|
||||||
|
realtobits
|
||||||
recoding
|
recoding
|
||||||
recrem
|
recrem
|
||||||
redeclaring
|
redeclaring
|
||||||
regs
|
regs
|
||||||
reloop
|
reloop
|
||||||
|
replaceShiftOp
|
||||||
resetall
|
resetall
|
||||||
respecified
|
respecified
|
||||||
rodata
|
rodata
|
||||||
@@ -826,6 +929,7 @@ sVerilator
|
|||||||
sawatzke
|
sawatzke
|
||||||
sc
|
sc
|
||||||
scalared
|
scalared
|
||||||
|
sccache
|
||||||
sccanf
|
sccanf
|
||||||
seg
|
seg
|
||||||
setuphold
|
setuphold
|
||||||
@@ -850,6 +954,7 @@ stdin
|
|||||||
stdout
|
stdout
|
||||||
stime
|
stime
|
||||||
stmts
|
stmts
|
||||||
|
str
|
||||||
strcasecmp
|
strcasecmp
|
||||||
stringification
|
stringification
|
||||||
stringified
|
stringified
|
||||||
@@ -867,8 +972,11 @@ sv
|
|||||||
svBitVal
|
svBitVal
|
||||||
svBitVecVal
|
svBitVecVal
|
||||||
svGet
|
svGet
|
||||||
|
svGetTime
|
||||||
|
svGetTimePrecision
|
||||||
svLogicVal
|
svLogicVal
|
||||||
svdpi
|
svdpi
|
||||||
|
svgGetTimeUnit
|
||||||
swrite
|
swrite
|
||||||
sys
|
sys
|
||||||
systemc
|
systemc
|
||||||
@@ -924,13 +1032,17 @@ unsup
|
|||||||
untyped
|
untyped
|
||||||
urandom
|
urandom
|
||||||
uselib
|
uselib
|
||||||
|
utimes
|
||||||
uwire
|
uwire
|
||||||
uwires
|
uwires
|
||||||
|
valgrind
|
||||||
vc
|
vc
|
||||||
vcd
|
vcd
|
||||||
vcddiff
|
vcddiff
|
||||||
vcoverage
|
vcoverage
|
||||||
|
vdhotre
|
||||||
vec
|
vec
|
||||||
|
ventana
|
||||||
ver
|
ver
|
||||||
verFiles
|
verFiles
|
||||||
verible
|
verible
|
||||||
@@ -946,13 +1058,16 @@ vlt
|
|||||||
vltstd
|
vltstd
|
||||||
vluint
|
vluint
|
||||||
vpi
|
vpi
|
||||||
|
vpiConstType
|
||||||
vpiDefName
|
vpiDefName
|
||||||
|
vpiInstance
|
||||||
vpiLeftRange
|
vpiLeftRange
|
||||||
vpiModule
|
vpiModule
|
||||||
vpiSize
|
vpiSize
|
||||||
vpiSuppressVal
|
vpiSuppressVal
|
||||||
vpiTimeUnit
|
vpiTimeUnit
|
||||||
vpiType
|
vpiType
|
||||||
|
vpiUndefined
|
||||||
vpm
|
vpm
|
||||||
vpp
|
vpp
|
||||||
warmup
|
warmup
|
||||||
@@ -976,3 +1091,5 @@ ypq
|
|||||||
yurivict
|
yurivict
|
||||||
zdave
|
zdave
|
||||||
Øyvind
|
Øyvind
|
||||||
|
Алексеевич
|
||||||
|
Исаак
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ The XML document consists of 4 sections within the top level
|
|||||||
Distribution
|
Distribution
|
||||||
============
|
============
|
||||||
|
|
||||||
Copyright 2020-2023 by Wilson Snyder. Verilator is free software; you can
|
Copyright 2020-2024 by Wilson Snyder. Verilator is free software; you can
|
||||||
redistribute it and/or modify it under the terms of either the GNU Lesser
|
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.
|
General Public License Version 3 or the Perl Artistic License Version 2.0.
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ endif()
|
|||||||
|
|
||||||
# Create a new executable target that will contain all your sources
|
# Create a new executable target that will contain all your sources
|
||||||
add_executable(example ../make_hello_c/sim_main.cpp)
|
add_executable(example ../make_hello_c/sim_main.cpp)
|
||||||
|
target_compile_features(example PUBLIC cxx_std_14)
|
||||||
|
|
||||||
# Add the Verilated circuit to the target
|
# Add the Verilated circuit to the target
|
||||||
verilate(example
|
verilate(example
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ endif
|
|||||||
ifeq ($(shell which cmake),)
|
ifeq ($(shell which cmake),)
|
||||||
TARGET := nocmake
|
TARGET := nocmake
|
||||||
else
|
else
|
||||||
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
|
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
|
||||||
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
||||||
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
||||||
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ find_package(SystemCLanguage QUIET)
|
|||||||
|
|
||||||
# Create a new executable target that will contain all your sources
|
# Create a new executable target that will contain all your sources
|
||||||
add_executable(example ../make_hello_sc/sc_main.cpp)
|
add_executable(example ../make_hello_sc/sc_main.cpp)
|
||||||
|
target_compile_features(example PUBLIC cxx_std_14)
|
||||||
|
|
||||||
set_property(
|
set_property(
|
||||||
TARGET example
|
TARGET example
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ endif
|
|||||||
ifeq ($(shell which cmake),)
|
ifeq ($(shell which cmake),)
|
||||||
TARGET := nocmake
|
TARGET := nocmake
|
||||||
else
|
else
|
||||||
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
|
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
|
||||||
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
||||||
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
||||||
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
||||||
|
|||||||
@@ -30,9 +30,12 @@ endif()
|
|||||||
|
|
||||||
# Create the main executable target
|
# Create the main executable target
|
||||||
add_executable(example ../make_protect_lib/sim_main.cpp)
|
add_executable(example ../make_protect_lib/sim_main.cpp)
|
||||||
|
target_compile_features(example PUBLIC cxx_std_14)
|
||||||
|
|
||||||
# Create a secret library
|
# Create a secret library
|
||||||
add_library(verilated_secret STATIC) # or SHARED for a shared library
|
add_library(verilated_secret STATIC) # or SHARED for a shared library
|
||||||
|
target_compile_features(verilated_secret PUBLIC cxx_std_14)
|
||||||
|
|
||||||
target_link_libraries(example PRIVATE verilated_secret)
|
target_link_libraries(example PRIVATE verilated_secret)
|
||||||
# To create both libraries on CMake >= 3.12 replace the above 2 lines with the following:
|
# To create both libraries on CMake >= 3.12 replace the above 2 lines with the following:
|
||||||
# add_library(verilated_secret OBJECT)
|
# add_library(verilated_secret OBJECT)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ endif
|
|||||||
ifeq ($(shell which cmake),)
|
ifeq ($(shell which cmake),)
|
||||||
TARGET := nocmake
|
TARGET := nocmake
|
||||||
else
|
else
|
||||||
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
|
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
|
||||||
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
||||||
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
||||||
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ endif()
|
|||||||
|
|
||||||
# Create a new executable target that will contain all your sources
|
# Create a new executable target that will contain all your sources
|
||||||
add_executable(example ../make_tracing_c/sim_main.cpp)
|
add_executable(example ../make_tracing_c/sim_main.cpp)
|
||||||
|
target_compile_features(example PUBLIC cxx_std_14)
|
||||||
|
|
||||||
# Add the Verilated circuit to the target
|
# Add the Verilated circuit to the target
|
||||||
verilate(example COVERAGE TRACE
|
verilate(example COVERAGE TRACE
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ endif
|
|||||||
ifeq ($(shell which cmake),)
|
ifeq ($(shell which cmake),)
|
||||||
TARGET := nocmake
|
TARGET := nocmake
|
||||||
else
|
else
|
||||||
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
|
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
|
||||||
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
||||||
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
||||||
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ find_package(SystemCLanguage QUIET)
|
|||||||
|
|
||||||
# Create a new executable target that will contain all your sources
|
# Create a new executable target that will contain all your sources
|
||||||
add_executable(example ../make_tracing_sc/sc_main.cpp)
|
add_executable(example ../make_tracing_sc/sc_main.cpp)
|
||||||
|
target_compile_features(example PUBLIC cxx_std_14)
|
||||||
|
|
||||||
set_property(
|
set_property(
|
||||||
TARGET example
|
TARGET example
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ endif
|
|||||||
ifeq ($(shell which cmake),)
|
ifeq ($(shell which cmake),)
|
||||||
TARGET := nocmake
|
TARGET := nocmake
|
||||||
else
|
else
|
||||||
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
|
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
|
||||||
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
|
||||||
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
|
||||||
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- Python -*- See copyright, etc below
|
# -*- Python -*- See copyright, etc below
|
||||||
# pylint: disable=C0114,C0115,C0209,R0903
|
# pylint: disable=C0103,C0114,C0115,C0209,R0903
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
from shutil import copy2
|
from shutil import copy2
|
||||||
|
from tempfile import NamedTemporaryFile
|
||||||
# from pprint import pprint, pformat
|
# from pprint import pprint, pformat
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -25,29 +25,30 @@ class VlFileCopy:
|
|||||||
|
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile() as xml_temp:
|
with NamedTemporaryFile() as tree_temp, NamedTemporaryFile(
|
||||||
|
) as meta_temp:
|
||||||
vargs = [
|
vargs = [
|
||||||
'--xml-output',
|
'--json-only-output',
|
||||||
xml_temp.name,
|
tree_temp.name,
|
||||||
|
'--json-only-meta-output',
|
||||||
|
meta_temp.name,
|
||||||
'--bbox-sys', # Parse some stuff can't translate
|
'--bbox-sys', # Parse some stuff can't translate
|
||||||
'--bbox-unsup',
|
'--bbox-unsup',
|
||||||
'--prefix vlxml'
|
'--prefix vljson'
|
||||||
] # So we know name of .xml output
|
]
|
||||||
vargs += verilator_args
|
vargs += verilator_args
|
||||||
self.run_verilator(vargs)
|
self.run_verilator(vargs)
|
||||||
self.tree = ET.parse(xml_temp.name)
|
self.tree = json.load(tree_temp)
|
||||||
|
self.meta = json.load(meta_temp)
|
||||||
|
|
||||||
os.makedirs(output_dir, 0o777, True)
|
os.makedirs(output_dir, 0o777, True)
|
||||||
|
|
||||||
# Find and copy the files
|
for file_id in self.meta['files']:
|
||||||
root = self.tree.getroot()
|
path = self.meta['files'][file_id]['realpath']
|
||||||
xfiles = root.find('files')
|
if not re.match('^<', path): # e.g. <built-in>
|
||||||
for xfile in xfiles.findall('file'):
|
|
||||||
filename = xfile.get('filename')
|
|
||||||
if not re.match('^<', filename): # e.g. <built-in>
|
|
||||||
if self.debug:
|
if self.debug:
|
||||||
print("\tcp %s %s" % (filename, output_dir))
|
print("\tcp %s %s" % (path, output_dir))
|
||||||
copy2(filename, output_dir)
|
copy2(path, output_dir)
|
||||||
|
|
||||||
def run_verilator(self, vargs):
|
def run_verilator(self, vargs):
|
||||||
"""Run Verilator command, check errors"""
|
"""Run Verilator command, check errors"""
|
||||||
@@ -60,8 +61,8 @@ class VlFileCopy:
|
|||||||
print("\t%s " % command)
|
print("\t%s " % command)
|
||||||
status = subprocess.call(command, shell=True)
|
status = subprocess.call(command, shell=True)
|
||||||
if status != 0:
|
if status != 0:
|
||||||
raise Exception("Command failed running Verilator with '" +
|
raise RuntimeError("Command failed running Verilator with '" +
|
||||||
command + "', stopped")
|
command + "', stopped")
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -71,7 +72,7 @@ if __name__ == '__main__':
|
|||||||
allow_abbrev=False,
|
allow_abbrev=False,
|
||||||
formatter_class=argparse.RawTextHelpFormatter,
|
formatter_class=argparse.RawTextHelpFormatter,
|
||||||
description=
|
description=
|
||||||
"""Example of using Verilator XML output to copy a list of files to an
|
"""Example of using Verilator JSON output to copy a list of files to an
|
||||||
output directory (-odir, defaults to 'copied'), e.g. to easily create a
|
output directory (-odir, defaults to 'copied'), e.g. to easily create a
|
||||||
tarball of the design to pass to others.
|
tarball of the design to pass to others.
|
||||||
|
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
from tempfile import NamedTemporaryFile
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
# from pprint import pprint, pformat
|
# from pprint import pprint, pformat
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -22,19 +22,23 @@ class VlHierGraph:
|
|||||||
output_filename='graph.dot'): # output filename
|
output_filename='graph.dot'): # output filename
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
self.next_vertex_number = 0
|
self.next_vertex_number = 0
|
||||||
self.name_to_number = {}
|
self.addr_to_number = {}
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile() as xml_temp:
|
with NamedTemporaryFile() as tree_temp, NamedTemporaryFile(
|
||||||
|
) as meta_temp:
|
||||||
vargs = [
|
vargs = [
|
||||||
'--xml-output',
|
'--json-only-output',
|
||||||
xml_temp.name,
|
tree_temp.name,
|
||||||
|
'--json-only-meta-output',
|
||||||
|
meta_temp.name,
|
||||||
'--bbox-sys', # Parse some stuff can't translate
|
'--bbox-sys', # Parse some stuff can't translate
|
||||||
'--bbox-unsup',
|
'--bbox-unsup',
|
||||||
'--prefix vlxml'
|
'--prefix vljson'
|
||||||
] # So we know name of .xml output
|
]
|
||||||
vargs += verilator_args
|
vargs += verilator_args
|
||||||
self.run_verilator(vargs)
|
self.run_verilator(vargs)
|
||||||
self.tree = ET.parse(xml_temp.name)
|
self.tree = json.load(tree_temp)
|
||||||
|
self.meta = json.load(meta_temp)
|
||||||
|
|
||||||
with open(output_filename, "w", encoding="utf8") as fh:
|
with open(output_filename, "w", encoding="utf8") as fh:
|
||||||
# For more serious purposes, use the python graphviz package instead
|
# For more serious purposes, use the python graphviz package instead
|
||||||
@@ -46,31 +50,45 @@ class VlHierGraph:
|
|||||||
)
|
)
|
||||||
fh.write(" edge [fontsize=6]")
|
fh.write(" edge [fontsize=6]")
|
||||||
# Find cells
|
# Find cells
|
||||||
root = self.tree.getroot()
|
modules = self.flatten(self.tree, lambda n: n['type'] == "MODULE")
|
||||||
netlist = root.find('netlist')
|
top_module = True
|
||||||
for module in netlist.findall('module'):
|
for mod in modules:
|
||||||
# origNames are before parameterization, name if after
|
# origNames are before parameterization, name if after
|
||||||
mod_name = module.get('name')
|
mod_number = self.addr_to_vertex_number(mod['addr'])
|
||||||
mod_number = self.name_to_vertex_number(mod_name)
|
fh.write(" n%d [label=\"%s\"" % (mod_number, mod['name']))
|
||||||
fh.write(" n%d [label=\"%s\"" % (mod_number, mod_name))
|
if top_module:
|
||||||
if module.get('topModule'):
|
|
||||||
fh.write(" color=\"red\" rank=1")
|
fh.write(" color=\"red\" rank=1")
|
||||||
|
top_module = False
|
||||||
fh.write("];\n")
|
fh.write("];\n")
|
||||||
|
|
||||||
for instance in module.findall('instance'):
|
cells = self.flatten(mod, lambda n: n['type'] == "CELL")
|
||||||
inst_name = instance.get('name')
|
for cell in cells:
|
||||||
def_name = instance.get('defName')
|
def_number = self.addr_to_vertex_number(cell['modp'])
|
||||||
def_number = self.name_to_vertex_number(def_name)
|
|
||||||
fh.write(" n%d->n%d [label=\"%s\"];\n" %
|
fh.write(" n%d->n%d [label=\"%s\"];\n" %
|
||||||
(mod_number, def_number, inst_name))
|
(mod_number, def_number, cell['name']))
|
||||||
|
|
||||||
fh.write("}\n")
|
fh.write("}\n")
|
||||||
|
|
||||||
def name_to_vertex_number(self, name):
|
def flatten(self, node, accept_cb=lambda n: True):
|
||||||
if name not in self.name_to_number:
|
"""Flatten tree to list using DFS.
|
||||||
|
accept_cb(node) should return True for nodes you want to save"""
|
||||||
|
arr = []
|
||||||
|
self.dfs(node, lambda n: accept_cb(n) and arr.append(n))
|
||||||
|
return arr
|
||||||
|
|
||||||
|
def dfs(self, node, node_cb):
|
||||||
|
"""Traverse given tree using DFS and apply node_cb(node) on each one"""
|
||||||
|
node_cb(node)
|
||||||
|
for _, v in node.items():
|
||||||
|
if isinstance(v, list): # childlist
|
||||||
|
for child in v:
|
||||||
|
self.dfs(child, node_cb)
|
||||||
|
|
||||||
|
def addr_to_vertex_number(self, name):
|
||||||
|
if name not in self.addr_to_number:
|
||||||
self.next_vertex_number += 1
|
self.next_vertex_number += 1
|
||||||
self.name_to_number[name] = self.next_vertex_number
|
self.addr_to_number[name] = self.next_vertex_number
|
||||||
return self.name_to_number[name]
|
return self.addr_to_number[name]
|
||||||
|
|
||||||
def run_verilator(self, vargs):
|
def run_verilator(self, vargs):
|
||||||
"""Run Verilator command, check errors"""
|
"""Run Verilator command, check errors"""
|
||||||
@@ -83,8 +101,8 @@ class VlHierGraph:
|
|||||||
print("\t%s " % command)
|
print("\t%s " % command)
|
||||||
status = subprocess.call(command, shell=True)
|
status = subprocess.call(command, shell=True)
|
||||||
if status != 0:
|
if status != 0:
|
||||||
raise Exception("Command failed running Verilator with '" +
|
raise RuntimeError("Command failed running Verilator with '" +
|
||||||
command + "', stopped")
|
command + "', stopped")
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -94,7 +112,7 @@ if __name__ == '__main__':
|
|||||||
allow_abbrev=False,
|
allow_abbrev=False,
|
||||||
formatter_class=argparse.RawTextHelpFormatter,
|
formatter_class=argparse.RawTextHelpFormatter,
|
||||||
description=
|
description=
|
||||||
"""Example of using Verilator XML output to create a .dot file showing the
|
"""Example of using Verilator JSON output to create a .dot file showing the
|
||||||
design module hierarchy.
|
design module hierarchy.
|
||||||
|
|
||||||
Example usage:
|
Example usage:
|
||||||
@@ -19,14 +19,14 @@ int main(int argc, char** argv) {
|
|||||||
// e.g. examples/c_tracing.
|
// e.g. examples/c_tracing.
|
||||||
|
|
||||||
// Construct a VerilatedContext to hold simulation time, etc.
|
// Construct a VerilatedContext to hold simulation time, etc.
|
||||||
VerilatedContext* contextp = new VerilatedContext;
|
VerilatedContext* const contextp = new VerilatedContext;
|
||||||
|
|
||||||
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
||||||
// This needs to be called before you create any model
|
// This needs to be called before you create any model
|
||||||
contextp->commandArgs(argc, argv);
|
contextp->commandArgs(argc, argv);
|
||||||
|
|
||||||
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
||||||
Vtop* top = new Vtop{contextp};
|
Vtop* const top = new Vtop{contextp};
|
||||||
|
|
||||||
// Simulate until $finish
|
// Simulate until $finish
|
||||||
while (!contextp->gotFinish()) {
|
while (!contextp->gotFinish()) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
// e.g. examples/c_tracing.
|
// e.g. examples/c_tracing.
|
||||||
|
|
||||||
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
||||||
Vtop* top = new Vtop{"top"};
|
Vtop* const top = new Vtop{"top"};
|
||||||
|
|
||||||
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
||||||
// This needs to be called before you create any model
|
// This needs to be called before you create any model
|
||||||
|
|||||||
@@ -17,16 +17,17 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
if (false && argc && argv) {}
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
// Construct context to hold simulation time, etc
|
// Construct context to hold simulation time, etc
|
||||||
VerilatedContext* contextp = new VerilatedContext;
|
const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
|
||||||
contextp->debug(0);
|
contextp->debug(0);
|
||||||
contextp->randReset(2);
|
contextp->randReset(2);
|
||||||
contextp->commandArgs(argc, argv);
|
contextp->commandArgs(argc, argv);
|
||||||
|
|
||||||
// Construct the Verilated model, including the secret module
|
// Construct the Verilated model, including the secret module
|
||||||
Vtop* top = new Vtop{contextp};
|
const std::unique_ptr<Vtop> top{new Vtop{contextp.get(), "TOP"}};
|
||||||
|
|
||||||
#if VM_TRACE
|
#if VM_TRACE
|
||||||
// When tracing, the contents of the secret module will not be seen
|
// When tracing, the contents of the secret module will not be seen
|
||||||
@@ -65,12 +66,6 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Destroy model
|
|
||||||
delete top;
|
|
||||||
top = nullptr;
|
|
||||||
delete contextp;
|
|
||||||
contextp = nullptr;
|
|
||||||
|
|
||||||
// Return good completion status
|
// Return good completion status
|
||||||
// Don't use exit() or destructor won't get called
|
// Don't use exit() or destructor won't get called
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ double sc_time_stamp() { return 0; }
|
|||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
// This is a more complicated example, please also see the simpler examples/make_hello_c.
|
// This is a more complicated example, please also see the simpler examples/make_hello_c.
|
||||||
|
|
||||||
// Prevent unused variable warnings
|
|
||||||
if (false && argc && argv) {}
|
|
||||||
|
|
||||||
// Create logs/ directory in case we have traces to put under it
|
// Create logs/ directory in case we have traces to put under it
|
||||||
Verilated::mkdir("logs");
|
Verilated::mkdir("logs");
|
||||||
|
|
||||||
@@ -120,6 +117,9 @@ int main(int argc, char** argv) {
|
|||||||
contextp->coveragep()->write("logs/coverage.dat");
|
contextp->coveragep()->write("logs/coverage.dat");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Final simulation summary
|
||||||
|
contextp->statsPrintSummary();
|
||||||
|
|
||||||
// Return good completion status
|
// Return good completion status
|
||||||
// Don't use exit() or destructor won't get called
|
// Don't use exit() or destructor won't get called
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
#include "Vtop.h"
|
#include "Vtop.h"
|
||||||
|
|
||||||
using namespace sc_core;
|
using namespace sc_core;
|
||||||
|
using namespace sc_dt;
|
||||||
|
|
||||||
int sc_main(int argc, char* argv[]) {
|
int sc_main(int argc, char* argv[]) {
|
||||||
// This is a more complicated example, please also see the simpler examples/make_hello_c.
|
// This is a more complicated example, please also see the simpler examples/make_hello_c.
|
||||||
|
|
||||||
// Prevent unused variable warnings
|
|
||||||
if (false && argc && argv) {}
|
|
||||||
|
|
||||||
// Create logs/ directory in case we have traces to put under it
|
// Create logs/ directory in case we have traces to put under it
|
||||||
Verilated::mkdir("logs");
|
Verilated::mkdir("logs");
|
||||||
|
|
||||||
@@ -52,7 +50,7 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
Verilated::commandArgs(argc, argv);
|
Verilated::commandArgs(argc, argv);
|
||||||
|
|
||||||
// General logfile
|
// General logfile
|
||||||
ios::sync_with_stdio();
|
std::ios::sync_with_stdio();
|
||||||
|
|
||||||
// Define clocks
|
// Define clocks
|
||||||
sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true};
|
sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true};
|
||||||
|
|||||||
+187
-37
@@ -34,7 +34,6 @@
|
|||||||
* FST_DEBUG : not for production use, only enable for development
|
* FST_DEBUG : not for production use, only enable for development
|
||||||
* FST_REMOVE_DUPLICATE_VC : glitch removal (has writer performance impact)
|
* FST_REMOVE_DUPLICATE_VC : glitch removal (has writer performance impact)
|
||||||
* HAVE_LIBPTHREAD -> FST_WRITER_PARALLEL : enables inclusion of parallel writer code
|
* HAVE_LIBPTHREAD -> FST_WRITER_PARALLEL : enables inclusion of parallel writer code
|
||||||
* FST_DO_MISALIGNED_OPS (defined automatically for x86 and some others) : CPU architecture can handle misaligned loads/stores
|
|
||||||
* _WAVE_HAVE_JUDY : use Judy arrays instead of Jenkins (undefine if LGPL is not acceptable)
|
* _WAVE_HAVE_JUDY : use Judy arrays instead of Jenkins (undefine if LGPL is not acceptable)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -132,10 +131,6 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
|
|||||||
#define FST_GZIO_LEN (32768)
|
#define FST_GZIO_LEN (32768)
|
||||||
#define FST_HDR_FOURPACK_DUO_SIZE (4*1024*1024)
|
#define FST_HDR_FOURPACK_DUO_SIZE (4*1024*1024)
|
||||||
|
|
||||||
#if defined(__i386__) || defined(__x86_64__) || defined(_AIX) || defined(__aarch64__)
|
|
||||||
#define FST_DO_MISALIGNED_OPS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
#define FST_MACOSX
|
#define FST_MACOSX
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
@@ -192,6 +187,16 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
|
|||||||
/* 01234567 */
|
/* 01234567 */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* report abort messages
|
||||||
|
*/
|
||||||
|
static void chk_report_abort(const char *s)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"Triggered %s security check, exiting.\n", s);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* prevent old file overwrite when currently being read
|
* prevent old file overwrite when currently being read
|
||||||
*/
|
*/
|
||||||
@@ -367,22 +372,15 @@ return ptr;
|
|||||||
/*
|
/*
|
||||||
* regular and variable-length integer access functions
|
* regular and variable-length integer access functions
|
||||||
*/
|
*/
|
||||||
#ifdef FST_DO_MISALIGNED_OPS
|
|
||||||
#define fstGetUint32(x) (*(uint32_t *)(x))
|
|
||||||
#else
|
|
||||||
static uint32_t fstGetUint32(unsigned char *mem)
|
static uint32_t fstGetUint32(unsigned char *mem)
|
||||||
{
|
{
|
||||||
uint32_t u32;
|
uint32_t u32;
|
||||||
unsigned char *buf = (unsigned char *)(&u32);
|
unsigned char *buf = (unsigned char *)(&u32);
|
||||||
|
|
||||||
buf[0] = mem[0];
|
memcpy(buf, mem, sizeof(uint32_t));
|
||||||
buf[1] = mem[1];
|
|
||||||
buf[2] = mem[2];
|
|
||||||
buf[3] = mem[3];
|
|
||||||
|
|
||||||
return(*(uint32_t *)buf);
|
return(*(uint32_t *)buf);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static int fstWriterUint64(FILE *handle, uint64_t v)
|
static int fstWriterUint64(FILE *handle, uint64_t v)
|
||||||
@@ -550,7 +548,8 @@ return(rc);
|
|||||||
|
|
||||||
static uint32_t fstReaderVarint32(FILE *f)
|
static uint32_t fstReaderVarint32(FILE *f)
|
||||||
{
|
{
|
||||||
unsigned char buf[5];
|
int chk_len = 5; /* TALOS-2023-1783 */
|
||||||
|
unsigned char buf[chk_len];
|
||||||
unsigned char *mem = buf;
|
unsigned char *mem = buf;
|
||||||
uint32_t rc = 0;
|
uint32_t rc = 0;
|
||||||
int ch;
|
int ch;
|
||||||
@@ -559,7 +558,9 @@ do
|
|||||||
{
|
{
|
||||||
ch = fgetc(f);
|
ch = fgetc(f);
|
||||||
*(mem++) = ch;
|
*(mem++) = ch;
|
||||||
} while(ch & 0x80);
|
} while((ch & 0x80) && (--chk_len));
|
||||||
|
|
||||||
|
if(ch & 0x80) chk_report_abort("TALOS-2023-1783");
|
||||||
mem--;
|
mem--;
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
@@ -579,7 +580,8 @@ return(rc);
|
|||||||
|
|
||||||
static uint32_t fstReaderVarint32WithSkip(FILE *f, uint32_t *skiplen)
|
static uint32_t fstReaderVarint32WithSkip(FILE *f, uint32_t *skiplen)
|
||||||
{
|
{
|
||||||
unsigned char buf[5];
|
int chk_len = 5; /* TALOS-2023-1783 */
|
||||||
|
unsigned char buf[chk_len];
|
||||||
unsigned char *mem = buf;
|
unsigned char *mem = buf;
|
||||||
uint32_t rc = 0;
|
uint32_t rc = 0;
|
||||||
int ch;
|
int ch;
|
||||||
@@ -588,7 +590,9 @@ do
|
|||||||
{
|
{
|
||||||
ch = fgetc(f);
|
ch = fgetc(f);
|
||||||
*(mem++) = ch;
|
*(mem++) = ch;
|
||||||
} while(ch & 0x80);
|
} while((ch & 0x80) && (--chk_len));
|
||||||
|
|
||||||
|
if(ch & 0x80) chk_report_abort("TALOS-2023-1783");
|
||||||
*skiplen = mem - buf;
|
*skiplen = mem - buf;
|
||||||
mem--;
|
mem--;
|
||||||
|
|
||||||
@@ -609,7 +613,8 @@ return(rc);
|
|||||||
|
|
||||||
static uint64_t fstReaderVarint64(FILE *f)
|
static uint64_t fstReaderVarint64(FILE *f)
|
||||||
{
|
{
|
||||||
unsigned char buf[16];
|
int chk_len = 16; /* TALOS-2023-1783 */
|
||||||
|
unsigned char buf[chk_len];
|
||||||
unsigned char *mem = buf;
|
unsigned char *mem = buf;
|
||||||
uint64_t rc = 0;
|
uint64_t rc = 0;
|
||||||
int ch;
|
int ch;
|
||||||
@@ -618,9 +623,12 @@ do
|
|||||||
{
|
{
|
||||||
ch = fgetc(f);
|
ch = fgetc(f);
|
||||||
*(mem++) = ch;
|
*(mem++) = ch;
|
||||||
} while(ch & 0x80);
|
} while((ch & 0x80) && (--chk_len));
|
||||||
|
|
||||||
|
if(ch & 0x80) chk_report_abort("TALOS-2023-1783");
|
||||||
mem--;
|
mem--;
|
||||||
|
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
rc <<= 7;
|
rc <<= 7;
|
||||||
@@ -851,11 +859,7 @@ unsigned char *pnt = buf;
|
|||||||
uint32_t nxt;
|
uint32_t nxt;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
|
||||||
#ifdef FST_DO_MISALIGNED_OPS
|
|
||||||
(*(uint32_t *)(pnt)) = (*(uint32_t *)(u));
|
|
||||||
#else
|
|
||||||
memcpy(pnt, u, sizeof(uint32_t));
|
memcpy(pnt, u, sizeof(uint32_t));
|
||||||
#endif
|
|
||||||
pnt += 4;
|
pnt += 4;
|
||||||
|
|
||||||
while((nxt = v>>7))
|
while((nxt = v>>7))
|
||||||
@@ -878,11 +882,7 @@ unsigned char *pnt = buf;
|
|||||||
uint32_t nxt;
|
uint32_t nxt;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
|
||||||
#ifdef FST_DO_MISALIGNED_OPS
|
|
||||||
(*(uint32_t *)(pnt)) = (*(uint32_t *)(u));
|
|
||||||
#else
|
|
||||||
memcpy(pnt, u, sizeof(uint32_t));
|
memcpy(pnt, u, sizeof(uint32_t));
|
||||||
#endif
|
|
||||||
pnt += 4;
|
pnt += 4;
|
||||||
|
|
||||||
while((nxt = v>>7))
|
while((nxt = v>>7))
|
||||||
@@ -1542,7 +1542,7 @@ for(i=0;i<xc->maxhandle;i++)
|
|||||||
dmem = packmem = (unsigned char *)malloc(packmemlen = (wrlen * 2) + 2);
|
dmem = packmem = (unsigned char *)malloc(packmemlen = (wrlen * 2) + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = (xc->fourpack) ? LZ4_compress((char *)scratchpnt, (char *)dmem, wrlen) : fastlz_compress(scratchpnt, wrlen, dmem);
|
rc = (xc->fourpack) ? LZ4_compress_default((char *)scratchpnt, (char *)dmem, wrlen, packmemlen) : fastlz_compress(scratchpnt, wrlen, dmem);
|
||||||
if(rc < destlen)
|
if(rc < destlen)
|
||||||
{
|
{
|
||||||
#ifndef FST_DYNAMIC_ALIAS_DISABLE
|
#ifndef FST_DYNAMIC_ALIAS_DISABLE
|
||||||
@@ -1646,7 +1646,11 @@ if(1)
|
|||||||
{
|
{
|
||||||
if(vm4ip[2] != prev_alias)
|
if(vm4ip[2] != prev_alias)
|
||||||
{
|
{
|
||||||
fpos += fstWriterSVarint(f, (((int64_t)((int32_t)(prev_alias = vm4ip[2]))) << 1) | 1);
|
int32_t t_i32 = ((int32_t)(prev_alias = vm4ip[2])); /* vm4ip is generic unsigned data */
|
||||||
|
int64_t t_i64 = (int64_t)t_i32; /* convert to signed */
|
||||||
|
uint64_t t_u64 = (uint64_t)t_i64; /* sign extend through 64b */
|
||||||
|
|
||||||
|
fpos += fstWriterSVarint(f, (int64_t)((t_u64 << 1) | 1)); /* all in this block was: fpos += fstWriterSVarint(f, (((int64_t)((int32_t)(prev_alias = vm4ip[2]))) << 1) | 1); */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1838,6 +1842,14 @@ if(xc->parallel_enabled)
|
|||||||
xc->xc_parent = xc;
|
xc->xc_parent = xc;
|
||||||
memcpy(xc2, xc, sizeof(struct fstWriterContext));
|
memcpy(xc2, xc, sizeof(struct fstWriterContext));
|
||||||
|
|
||||||
|
if(sizeof(size_t) < sizeof(uint64_t))
|
||||||
|
{
|
||||||
|
/* TALOS-2023-1777 for 32b overflow */
|
||||||
|
uint64_t chk_64 = xc->maxhandle * 4 * sizeof(uint32_t);
|
||||||
|
size_t chk_32 = xc->maxhandle * 4 * sizeof(uint32_t);
|
||||||
|
if(chk_64 != chk_32) chk_report_abort("TALOS-2023-1777");
|
||||||
|
}
|
||||||
|
|
||||||
xc2->valpos_mem = (uint32_t *)malloc(xc->maxhandle * 4 * sizeof(uint32_t));
|
xc2->valpos_mem = (uint32_t *)malloc(xc->maxhandle * 4 * sizeof(uint32_t));
|
||||||
memcpy(xc2->valpos_mem, xc->valpos_mem, xc->maxhandle * 4 * sizeof(uint32_t));
|
memcpy(xc2->valpos_mem, xc->valpos_mem, xc->maxhandle * 4 * sizeof(uint32_t));
|
||||||
|
|
||||||
@@ -2101,7 +2113,7 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
|
|||||||
{
|
{
|
||||||
fstWriterMmapSanity(hmem = (unsigned char *)fstMmap(NULL, xc->hier_file_len, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->hier_handle), 0), __FILE__, __LINE__, "hmem");
|
fstWriterMmapSanity(hmem = (unsigned char *)fstMmap(NULL, xc->hier_file_len, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->hier_handle), 0), __FILE__, __LINE__, "hmem");
|
||||||
}
|
}
|
||||||
packed_len = LZ4_compress((char *)hmem, (char *)mem, xc->hier_file_len);
|
packed_len = LZ4_compress_default((char *)hmem, (char *)mem, xc->hier_file_len, lz4_maxlen);
|
||||||
fstMunmap(hmem, xc->hier_file_len);
|
fstMunmap(hmem, xc->hier_file_len);
|
||||||
|
|
||||||
fourpack_duo = (!xc->repack_on_close) && (xc->hier_file_len > FST_HDR_FOURPACK_DUO_SIZE); /* double pack when hierarchy is large */
|
fourpack_duo = (!xc->repack_on_close) && (xc->hier_file_len > FST_HDR_FOURPACK_DUO_SIZE); /* double pack when hierarchy is large */
|
||||||
@@ -2114,7 +2126,7 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
|
|||||||
|
|
||||||
lz4_maxlen_duo = LZ4_compressBound(packed_len);
|
lz4_maxlen_duo = LZ4_compressBound(packed_len);
|
||||||
mem_duo = (unsigned char *)malloc(lz4_maxlen_duo);
|
mem_duo = (unsigned char *)malloc(lz4_maxlen_duo);
|
||||||
packed_len_duo = LZ4_compress((char *)mem, (char *)mem_duo, packed_len);
|
packed_len_duo = LZ4_compress_default((char *)mem, (char *)mem_duo, packed_len, lz4_maxlen_duo);
|
||||||
|
|
||||||
fstWriterVarint(xc->handle, packed_len); /* 1st round compressed length */
|
fstWriterVarint(xc->handle, packed_len); /* 1st round compressed length */
|
||||||
fstFwrite(mem_duo, packed_len_duo, 1, xc->handle);
|
fstFwrite(mem_duo, packed_len_duo, 1, xc->handle);
|
||||||
@@ -3434,7 +3446,7 @@ return(rc);
|
|||||||
|
|
||||||
|
|
||||||
#ifndef FST_WRITEX_DISABLE
|
#ifndef FST_WRITEX_DISABLE
|
||||||
static void fstWritex(struct fstReaderContext *xc, void *v, int len)
|
static void fstWritex(struct fstReaderContext *xc, void *v, uint32_t len) /* TALOS-2023-1793: change len to unsigned */
|
||||||
{
|
{
|
||||||
unsigned char *s = (unsigned char *)v;
|
unsigned char *s = (unsigned char *)v;
|
||||||
|
|
||||||
@@ -4181,7 +4193,7 @@ if(!(isfeof=feof(xc->fh)))
|
|||||||
if((xc->hier.u.attr.subtype == FST_MT_SOURCESTEM)||(xc->hier.u.attr.subtype == FST_MT_SOURCEISTEM))
|
if((xc->hier.u.attr.subtype == FST_MT_SOURCESTEM)||(xc->hier.u.attr.subtype == FST_MT_SOURCEISTEM))
|
||||||
{
|
{
|
||||||
int sidx_skiplen_dummy = 0;
|
int sidx_skiplen_dummy = 0;
|
||||||
xc->hier.u.attr.arg_from_name = fstGetVarint64((unsigned char *)xc->str_scope_nam, &sidx_skiplen_dummy);
|
xc->hier.u.attr.arg_from_name = fstGetVarint64((unsigned char *)xc->str_scope_attr, &sidx_skiplen_dummy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -5060,6 +5072,7 @@ if(fv)
|
|||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
uint32_t *tc_head = NULL;
|
uint32_t *tc_head = NULL;
|
||||||
|
uint32_t tc_head_items = 0;
|
||||||
traversal_mem_offs = 0;
|
traversal_mem_offs = 0;
|
||||||
|
|
||||||
fstReaderFseeko(xc, xc->f, blkpos, SEEK_SET);
|
fstReaderFseeko(xc, xc->f, blkpos, SEEK_SET);
|
||||||
@@ -5103,12 +5116,12 @@ for(;;)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mem_required_for_traversal = fstReaderUint64(xc->f);
|
mem_required_for_traversal = fstReaderUint64(xc->f) + 66; /* add in potential fastlz overhead */
|
||||||
mem_for_traversal = (unsigned char *)malloc(mem_required_for_traversal + 66); /* add in potential fastlz overhead */
|
mem_for_traversal = (unsigned char *)malloc(mem_required_for_traversal);
|
||||||
#ifdef FST_DEBUG
|
#ifdef FST_DEBUG
|
||||||
fprintf(stderr, FST_APIMESS "sec: %u seclen: %d begtim: %d endtim: %d\n",
|
fprintf(stderr, FST_APIMESS "sec: %u seclen: %d begtim: %d endtim: %d\n",
|
||||||
secnum, (int)seclen, (int)beg_tim, (int)end_tim);
|
secnum, (int)seclen, (int)beg_tim, (int)end_tim);
|
||||||
fprintf(stderr, FST_APIMESS "mem_required_for_traversal: %d\n", (int)mem_required_for_traversal);
|
fprintf(stderr, FST_APIMESS "mem_required_for_traversal: %d\n", (int)mem_required_for_traversal-66);
|
||||||
#endif
|
#endif
|
||||||
/* process time block */
|
/* process time block */
|
||||||
{
|
{
|
||||||
@@ -5158,6 +5171,22 @@ for(;;)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(time_table);
|
free(time_table);
|
||||||
|
|
||||||
|
if(sizeof(size_t) < sizeof(uint64_t))
|
||||||
|
{
|
||||||
|
/* TALOS-2023-1792 for 32b overflow */
|
||||||
|
uint64_t chk_64 = tsec_nitems * sizeof(uint64_t);
|
||||||
|
size_t chk_32 = ((size_t)tsec_nitems) * sizeof(uint64_t);
|
||||||
|
if(chk_64 != chk_32) chk_report_abort("TALOS-2023-1792");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint64_t chk_64 = tsec_nitems * sizeof(uint64_t);
|
||||||
|
if((chk_64/sizeof(uint64_t)) != tsec_nitems)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1792");
|
||||||
|
}
|
||||||
|
}
|
||||||
time_table = (uint64_t *)calloc(tsec_nitems, sizeof(uint64_t));
|
time_table = (uint64_t *)calloc(tsec_nitems, sizeof(uint64_t));
|
||||||
tpnt = ucdata;
|
tpnt = ucdata;
|
||||||
tpval = 0;
|
tpval = 0;
|
||||||
@@ -5169,7 +5198,23 @@ for(;;)
|
|||||||
tpnt += skiplen;
|
tpnt += skiplen;
|
||||||
}
|
}
|
||||||
|
|
||||||
tc_head = (uint32_t *)calloc(tsec_nitems /* scan-build */ ? tsec_nitems : 1, sizeof(uint32_t));
|
tc_head_items = tsec_nitems /* scan-build */ ? tsec_nitems : 1;
|
||||||
|
if(sizeof(size_t) < sizeof(uint64_t))
|
||||||
|
{
|
||||||
|
/* TALOS-2023-1792 for 32b overflow */
|
||||||
|
uint64_t chk_64 = tc_head_items * sizeof(uint32_t);
|
||||||
|
size_t chk_32 = ((size_t)tc_head_items) * sizeof(uint32_t);
|
||||||
|
if(chk_64 != chk_32) chk_report_abort("TALOS-2023-1792");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint64_t chk_64 = tc_head_items * sizeof(uint32_t);
|
||||||
|
if((chk_64/sizeof(uint32_t)) != tc_head_items)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1792");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tc_head = (uint32_t *)calloc(tc_head_items, sizeof(uint32_t));
|
||||||
free(ucdata);
|
free(ucdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5273,6 +5318,10 @@ for(;;)
|
|||||||
{
|
{
|
||||||
if(value_change_callback)
|
if(value_change_callback)
|
||||||
{
|
{
|
||||||
|
if(xc->signal_lens[idx] > xc->longest_signal_value_len)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1797");
|
||||||
|
}
|
||||||
memcpy(xc->temp_signal_value_buf, mu+sig_offs, xc->signal_lens[idx]);
|
memcpy(xc->temp_signal_value_buf, mu+sig_offs, xc->signal_lens[idx]);
|
||||||
xc->temp_signal_value_buf[xc->signal_lens[idx]] = 0;
|
xc->temp_signal_value_buf[xc->signal_lens[idx]] = 0;
|
||||||
value_change_callback(user_callback_data_pointer, beg_tim, idx+1, xc->temp_signal_value_buf);
|
value_change_callback(user_callback_data_pointer, beg_tim, idx+1, xc->temp_signal_value_buf);
|
||||||
@@ -5286,6 +5335,10 @@ for(;;)
|
|||||||
|
|
||||||
vcd_id[0] = (xc->signal_typs[idx] != FST_VT_VCD_PORT) ? 'b' : 'p';
|
vcd_id[0] = (xc->signal_typs[idx] != FST_VT_VCD_PORT) ? 'b' : 'p';
|
||||||
fstWritex(xc, vcd_id, 1);
|
fstWritex(xc, vcd_id, 1);
|
||||||
|
if((sig_offs + xc->signal_lens[idx]) > frame_uclen)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1793");
|
||||||
|
}
|
||||||
fstWritex(xc,mu+sig_offs, xc->signal_lens[idx]);
|
fstWritex(xc,mu+sig_offs, xc->signal_lens[idx]);
|
||||||
|
|
||||||
vcd_id[0] = ' '; /* collapse 3 writes into one I/O call */
|
vcd_id[0] = ' '; /* collapse 3 writes into one I/O call */
|
||||||
@@ -5410,7 +5463,44 @@ for(;;)
|
|||||||
free(chain_table_lengths);
|
free(chain_table_lengths);
|
||||||
|
|
||||||
vc_maxhandle_largest = vc_maxhandle;
|
vc_maxhandle_largest = vc_maxhandle;
|
||||||
|
|
||||||
|
if(!(vc_maxhandle+1))
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1798");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sizeof(size_t) < sizeof(uint64_t))
|
||||||
|
{
|
||||||
|
/* TALOS-2023-1798 for 32b overflow */
|
||||||
|
uint64_t chk_64 = (vc_maxhandle+1) * sizeof(fst_off_t);
|
||||||
|
size_t chk_32 = ((size_t)(vc_maxhandle+1)) * sizeof(fst_off_t);
|
||||||
|
if(chk_64 != chk_32) chk_report_abort("TALOS-2023-1798");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint64_t chk_64 = (vc_maxhandle+1) * sizeof(fst_off_t);
|
||||||
|
if((chk_64/sizeof(fst_off_t)) != (vc_maxhandle+1))
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1798");
|
||||||
|
}
|
||||||
|
}
|
||||||
chain_table = (fst_off_t *)calloc((vc_maxhandle+1), sizeof(fst_off_t));
|
chain_table = (fst_off_t *)calloc((vc_maxhandle+1), sizeof(fst_off_t));
|
||||||
|
|
||||||
|
if(sizeof(size_t) < sizeof(uint64_t))
|
||||||
|
{
|
||||||
|
/* TALOS-2023-1798 for 32b overflow */
|
||||||
|
uint64_t chk_64 = (vc_maxhandle+1) * sizeof(uint32_t);
|
||||||
|
size_t chk_32 = ((size_t)(vc_maxhandle+1)) * sizeof(uint32_t);
|
||||||
|
if(chk_64 != chk_32) chk_report_abort("TALOS-2023-1798");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint64_t chk_64 = (vc_maxhandle+1) * sizeof(uint32_t);
|
||||||
|
if((chk_64/sizeof(uint32_t)) != (vc_maxhandle+1))
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1798");
|
||||||
|
}
|
||||||
|
}
|
||||||
chain_table_lengths = (uint32_t *)calloc((vc_maxhandle+1), sizeof(uint32_t));
|
chain_table_lengths = (uint32_t *)calloc((vc_maxhandle+1), sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5454,6 +5544,11 @@ for(;;)
|
|||||||
uint64_t val = fstGetVarint32(pnt, &skiplen);
|
uint64_t val = fstGetVarint32(pnt, &skiplen);
|
||||||
|
|
||||||
fstHandle loopcnt = val >> 1;
|
fstHandle loopcnt = val >> 1;
|
||||||
|
if((idx+loopcnt-1) > vc_maxhandle) /* TALOS-2023-1789 */
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1789");
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0;i<loopcnt;i++)
|
for(i=0;i<loopcnt;i++)
|
||||||
{
|
{
|
||||||
chain_table[idx++] = 0;
|
chain_table[idx++] = 0;
|
||||||
@@ -5487,6 +5582,12 @@ for(;;)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
fstHandle loopcnt = val >> 1;
|
fstHandle loopcnt = val >> 1;
|
||||||
|
|
||||||
|
if((idx+loopcnt-1) > vc_maxhandle) /* TALOS-2023-1789 */
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1789");
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0;i<loopcnt;i++)
|
for(i=0;i<loopcnt;i++)
|
||||||
{
|
{
|
||||||
chain_table[idx++] = 0;
|
chain_table[idx++] = 0;
|
||||||
@@ -5547,6 +5648,11 @@ for(;;)
|
|||||||
unsigned long destlen = val;
|
unsigned long destlen = val;
|
||||||
unsigned long sourcelen = chain_table_lengths[i];
|
unsigned long sourcelen = chain_table_lengths[i];
|
||||||
|
|
||||||
|
if(traversal_mem_offs >= mem_required_for_traversal)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1785");
|
||||||
|
}
|
||||||
|
|
||||||
if(mc_mem_len < chain_table_lengths[i])
|
if(mc_mem_len < chain_table_lengths[i])
|
||||||
{
|
{
|
||||||
free(mc_mem);
|
free(mc_mem);
|
||||||
@@ -5575,6 +5681,12 @@ for(;;)
|
|||||||
{
|
{
|
||||||
int destlen = chain_table_lengths[i] - skiplen;
|
int destlen = chain_table_lengths[i] - skiplen;
|
||||||
unsigned char *mu = mem_for_traversal + traversal_mem_offs;
|
unsigned char *mu = mem_for_traversal + traversal_mem_offs;
|
||||||
|
|
||||||
|
if(traversal_mem_offs >= mem_required_for_traversal)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1785");
|
||||||
|
}
|
||||||
|
|
||||||
fstFread(mu, destlen, 1, xc->f);
|
fstFread(mu, destlen, 1, xc->f);
|
||||||
/* data to process is for(j=0;j<destlen;j++) in mu[j] */
|
/* data to process is for(j=0;j<destlen;j++) in mu[j] */
|
||||||
headptr[i] = traversal_mem_offs;
|
headptr[i] = traversal_mem_offs;
|
||||||
@@ -5600,6 +5712,11 @@ for(;;)
|
|||||||
tdelta = vli >> 1;
|
tdelta = vli >> 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(tdelta >= tc_head_items)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1791");
|
||||||
|
}
|
||||||
|
|
||||||
scatterptr[i] = tc_head[tdelta];
|
scatterptr[i] = tc_head[tdelta];
|
||||||
tc_head[tdelta] = i+1;
|
tc_head[tdelta] = i+1;
|
||||||
}
|
}
|
||||||
@@ -5698,6 +5815,11 @@ for(;;)
|
|||||||
shamt = 2 << (vli & 1);
|
shamt = 2 << (vli & 1);
|
||||||
tdelta = vli >> shamt;
|
tdelta = vli >> shamt;
|
||||||
|
|
||||||
|
if((tdelta+i) >= tc_head_items)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1791");
|
||||||
|
}
|
||||||
|
|
||||||
scatterptr[idx] = tc_head[i+tdelta];
|
scatterptr[idx] = tc_head[i+tdelta];
|
||||||
tc_head[i+tdelta] = idx+1;
|
tc_head[i+tdelta] = idx+1;
|
||||||
}
|
}
|
||||||
@@ -5731,6 +5853,14 @@ for(;;)
|
|||||||
|
|
||||||
vcdid_len = fstVcdIDForFwrite(vcd_id+1, idx+1);
|
vcdid_len = fstVcdIDForFwrite(vcd_id+1, idx+1);
|
||||||
{
|
{
|
||||||
|
if(sizeof(size_t) < sizeof(uint64_t))
|
||||||
|
{
|
||||||
|
/* TALOS-2023-1790 for 32b overflow */
|
||||||
|
uint64_t chk_64 = len*4 + 1;
|
||||||
|
size_t chk_32 = len*4 + 1;
|
||||||
|
if(chk_64 != chk_32) chk_report_abort("TALOS-2023-1790");
|
||||||
|
}
|
||||||
|
|
||||||
unsigned char *vesc = (unsigned char *)malloc(len*4 + 1);
|
unsigned char *vesc = (unsigned char *)malloc(len*4 + 1);
|
||||||
int vlen = fstUtilityBinToEsc(vesc, vdata, len);
|
int vlen = fstUtilityBinToEsc(vesc, vdata, len);
|
||||||
fstWritex(xc, vesc, vlen);
|
fstWritex(xc, vesc, vlen);
|
||||||
@@ -5756,6 +5886,11 @@ for(;;)
|
|||||||
vli = fstGetVarint32NoSkip(mem_for_traversal + headptr[idx]);
|
vli = fstGetVarint32NoSkip(mem_for_traversal + headptr[idx]);
|
||||||
tdelta = vli >> 1;
|
tdelta = vli >> 1;
|
||||||
|
|
||||||
|
if((tdelta+i) >= tc_head_items)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1791");
|
||||||
|
}
|
||||||
|
|
||||||
scatterptr[idx] = tc_head[i+tdelta];
|
scatterptr[idx] = tc_head[i+tdelta];
|
||||||
tc_head[i+tdelta] = idx+1;
|
tc_head[i+tdelta] = idx+1;
|
||||||
}
|
}
|
||||||
@@ -5772,6 +5907,11 @@ for(;;)
|
|||||||
|
|
||||||
if(xc->signal_typs[idx] != FST_VT_VCD_REAL)
|
if(xc->signal_typs[idx] != FST_VT_VCD_REAL)
|
||||||
{
|
{
|
||||||
|
if(len > xc->longest_signal_value_len)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1797");
|
||||||
|
}
|
||||||
|
|
||||||
if(!(vli & 1))
|
if(!(vli & 1))
|
||||||
{
|
{
|
||||||
int byte = 0;
|
int byte = 0;
|
||||||
@@ -5817,8 +5957,13 @@ for(;;)
|
|||||||
if(fv)
|
if(fv)
|
||||||
{
|
{
|
||||||
unsigned char ch_bp = (xc->signal_typs[idx] != FST_VT_VCD_PORT) ? 'b' : 'p';
|
unsigned char ch_bp = (xc->signal_typs[idx] != FST_VT_VCD_PORT) ? 'b' : 'p';
|
||||||
|
uint64_t mem_required_for_traversal_chk = vdata - mem_for_traversal + len;
|
||||||
|
|
||||||
fstWritex(xc, &ch_bp, 1);
|
fstWritex(xc, &ch_bp, 1);
|
||||||
|
if(mem_required_for_traversal_chk > mem_required_for_traversal)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1793");
|
||||||
|
}
|
||||||
fstWritex(xc, vdata, len);
|
fstWritex(xc, vdata, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5941,6 +6086,11 @@ for(;;)
|
|||||||
vli = fstGetVarint32NoSkip(mem_for_traversal + headptr[idx]);
|
vli = fstGetVarint32NoSkip(mem_for_traversal + headptr[idx]);
|
||||||
tdelta = vli >> 1;
|
tdelta = vli >> 1;
|
||||||
|
|
||||||
|
if((tdelta+i) >= tc_head_items)
|
||||||
|
{
|
||||||
|
chk_report_abort("TALOS-2023-1791");
|
||||||
|
}
|
||||||
|
|
||||||
scatterptr[idx] = tc_head[i+tdelta];
|
scatterptr[idx] = tc_head[i+tdelta];
|
||||||
tc_head[i+tdelta] = idx+1;
|
tc_head[i+tdelta] = idx+1;
|
||||||
}
|
}
|
||||||
|
|||||||
+2240
-972
File diff suppressed because it is too large
Load Diff
+771
-265
File diff suppressed because it is too large
Load Diff
+289
-136
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Code available from: https://verilator.org
|
// Code available from: https://verilator.org
|
||||||
//
|
//
|
||||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2024 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
@@ -71,6 +71,11 @@
|
|||||||
# include <execinfo.h>
|
# include <execinfo.h>
|
||||||
# define _VL_HAVE_STACKTRACE
|
# define _VL_HAVE_STACKTRACE
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <sys/resource.h>
|
||||||
|
# define _VL_HAVE_GETRLIMIT
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "verilated_threads.h"
|
#include "verilated_threads.h"
|
||||||
// clang-format on
|
// clang-format on
|
||||||
@@ -107,16 +112,10 @@ thread_local Verilated::ThreadLocal Verilated::t_s;
|
|||||||
|
|
||||||
#ifndef VL_USER_FINISH ///< Define this to override the vl_finish function
|
#ifndef VL_USER_FINISH ///< Define this to override the vl_finish function
|
||||||
void vl_finish(const char* filename, int linenum, const char* hier) VL_MT_UNSAFE {
|
void vl_finish(const char* filename, int linenum, const char* hier) VL_MT_UNSAFE {
|
||||||
if (false && hier) {}
|
// hier is unused in the default implementation.
|
||||||
|
(void)hier;
|
||||||
VL_PRINTF( // Not VL_PRINTF_MT, already on main thread
|
VL_PRINTF( // Not VL_PRINTF_MT, already on main thread
|
||||||
"- %s:%d: Verilog $finish\n", filename, linenum);
|
"- %s:%d: Verilog $finish\n", filename, linenum);
|
||||||
if (Verilated::threadContextp()->gotFinish()) {
|
|
||||||
VL_PRINTF( // Not VL_PRINTF_MT, already on main thread
|
|
||||||
"- %s:%d: Second verilog $finish, exiting\n", filename, linenum);
|
|
||||||
Verilated::runFlushCallbacks();
|
|
||||||
Verilated::runExitCallbacks();
|
|
||||||
std::exit(0);
|
|
||||||
}
|
|
||||||
Verilated::threadContextp()->gotFinish(true);
|
Verilated::threadContextp()->gotFinish(true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -142,7 +141,8 @@ void vl_stop(const char* filename, int linenum, const char* hier) VL_MT_UNSAFE {
|
|||||||
|
|
||||||
#ifndef VL_USER_FATAL ///< Define this to override the vl_fatal function
|
#ifndef VL_USER_FATAL ///< Define this to override the vl_fatal function
|
||||||
void vl_fatal(const char* filename, int linenum, const char* hier, const char* msg) VL_MT_UNSAFE {
|
void vl_fatal(const char* filename, int linenum, const char* hier, const char* msg) VL_MT_UNSAFE {
|
||||||
if (false && hier) {}
|
// hier is unused in the default implementation.
|
||||||
|
(void)hier;
|
||||||
Verilated::threadContextp()->gotError(true);
|
Verilated::threadContextp()->gotError(true);
|
||||||
Verilated::threadContextp()->gotFinish(true);
|
Verilated::threadContextp()->gotFinish(true);
|
||||||
if (filename && filename[0]) {
|
if (filename && filename[0]) {
|
||||||
@@ -169,9 +169,12 @@ void vl_stop_maybe(const char* filename, int linenum, const char* hier, bool may
|
|||||||
Verilated::threadContextp()->errorCountInc();
|
Verilated::threadContextp()->errorCountInc();
|
||||||
if (maybe
|
if (maybe
|
||||||
&& Verilated::threadContextp()->errorCount() < Verilated::threadContextp()->errorLimit()) {
|
&& Verilated::threadContextp()->errorCount() < Verilated::threadContextp()->errorLimit()) {
|
||||||
VL_PRINTF( // Not VL_PRINTF_MT, already on main thread
|
// Do just once when cross error limit
|
||||||
"-Info: %s:%d: %s\n", filename, linenum,
|
if (Verilated::threadContextp()->errorCount() == 1) {
|
||||||
"Verilog $stop, ignored due to +verilator+error+limit");
|
VL_PRINTF( // Not VL_PRINTF_MT, already on main thread
|
||||||
|
"-Info: %s:%d: %s\n", filename, linenum,
|
||||||
|
"Verilog $stop, ignored due to +verilator+error+limit");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vl_stop(filename, linenum, hier);
|
vl_stop(filename, linenum, hier);
|
||||||
}
|
}
|
||||||
@@ -180,7 +183,8 @@ void vl_stop_maybe(const char* filename, int linenum, const char* hier, bool may
|
|||||||
|
|
||||||
#ifndef VL_USER_WARN ///< Define this to override the vl_warn function
|
#ifndef VL_USER_WARN ///< Define this to override the vl_warn function
|
||||||
void vl_warn(const char* filename, int linenum, const char* hier, const char* msg) VL_MT_UNSAFE {
|
void vl_warn(const char* filename, int linenum, const char* hier, const char* msg) VL_MT_UNSAFE {
|
||||||
if (false && hier) {}
|
// hier is unused in the default implementation.
|
||||||
|
(void)hier;
|
||||||
if (filename && filename[0]) {
|
if (filename && filename[0]) {
|
||||||
// Not VL_PRINTF_MT, already on main thread
|
// Not VL_PRINTF_MT, already on main thread
|
||||||
VL_PRINTF("%%Warning: %s:%d: %s\n", filename, linenum, msg);
|
VL_PRINTF("%%Warning: %s:%d: %s\n", filename, linenum, msg);
|
||||||
@@ -320,7 +324,7 @@ std::string VlRNG::get_randstate() const VL_MT_UNSAFE {
|
|||||||
const char* const stateCharsp = reinterpret_cast<const char*>(&m_state);
|
const char* const stateCharsp = reinterpret_cast<const char*>(&m_state);
|
||||||
static_assert(sizeof(m_state) == 16, "");
|
static_assert(sizeof(m_state) == 16, "");
|
||||||
std::string result{"R00112233445566770011223344556677"};
|
std::string result{"R00112233445566770011223344556677"};
|
||||||
for (int i = 0; i < sizeof(m_state); ++i) {
|
for (size_t i = 0; i < sizeof(m_state); ++i) {
|
||||||
result[1 + i * 2] = 'a' + ((stateCharsp[i] >> 4) & 15);
|
result[1 + i * 2] = 'a' + ((stateCharsp[i] >> 4) & 15);
|
||||||
result[1 + i * 2 + 1] = 'a' + (stateCharsp[i] & 15);
|
result[1 + i * 2 + 1] = 'a' + (stateCharsp[i] & 15);
|
||||||
}
|
}
|
||||||
@@ -332,7 +336,7 @@ void VlRNG::set_randstate(const std::string& state) VL_MT_UNSAFE {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char* const stateCharsp = reinterpret_cast<char*>(&m_state);
|
char* const stateCharsp = reinterpret_cast<char*>(&m_state);
|
||||||
for (int i = 0; i < sizeof(m_state); ++i) {
|
for (size_t i = 0; i < sizeof(m_state); ++i) {
|
||||||
stateCharsp[i]
|
stateCharsp[i]
|
||||||
= (((state[1 + i * 2] - 'a') & 15) << 4) | ((state[1 + i * 2 + 1] - 'a') & 15);
|
= (((state[1 + i * 2] - 'a') & 15) << 4) | ((state[1 + i * 2 + 1] - 'a') & 15);
|
||||||
}
|
}
|
||||||
@@ -451,6 +455,8 @@ WDataOutP _vl_moddiv_w(int lbits, WDataOutP owp, const WDataInP lwp, const WData
|
|||||||
|
|
||||||
const int uw = VL_WORDS_I(umsbp1); // aka "m" in the algorithm
|
const int uw = VL_WORDS_I(umsbp1); // aka "m" in the algorithm
|
||||||
const int vw = VL_WORDS_I(vmsbp1); // aka "n" in the algorithm
|
const int vw = VL_WORDS_I(vmsbp1); // aka "n" in the algorithm
|
||||||
|
VL_DEBUG_IFDEF(assert(uw <= VL_MULS_MAX_WORDS););
|
||||||
|
VL_DEBUG_IFDEF(assert(vw <= VL_MULS_MAX_WORDS););
|
||||||
|
|
||||||
if (vw == 1) { // Single divisor word breaks rest of algorithm
|
if (vw == 1) { // Single divisor word breaks rest of algorithm
|
||||||
uint64_t k = 0;
|
uint64_t k = 0;
|
||||||
@@ -472,27 +478,25 @@ WDataOutP _vl_moddiv_w(int lbits, WDataOutP owp, const WDataInP lwp, const WData
|
|||||||
|
|
||||||
// Zero for ease of debugging and to save having to zero for shifts
|
// Zero for ease of debugging and to save having to zero for shifts
|
||||||
// Note +1 as loop will use extra word
|
// Note +1 as loop will use extra word
|
||||||
for (int i = 0; i < words + 1; ++i) { un[i] = vn[i] = 0; }
|
for (int i = 0; i < words + 1; ++i) un[i] = vn[i] = 0;
|
||||||
|
|
||||||
// Algorithm requires divisor MSB to be set
|
// Algorithm requires divisor MSB to be set
|
||||||
// Copy and shift to normalize divisor so MSB of vn[vw-1] is set
|
// Copy and shift to normalize divisor so MSB of vn[vw-1] is set
|
||||||
const int s = 31 - VL_BITBIT_I(vmsbp1 - 1); // shift amount (0...31)
|
const int s = 31 - VL_BITBIT_I(vmsbp1 - 1); // shift amount (0...31)
|
||||||
const uint32_t shift_mask = s ? 0xffffffff : 0; // otherwise >> 32 won't mask the value
|
|
||||||
for (int i = vw - 1; i > 0; --i) {
|
|
||||||
vn[i] = (rwp[i] << s) | (shift_mask & (rwp[i - 1] >> (32 - s)));
|
|
||||||
}
|
|
||||||
vn[0] = rwp[0] << s;
|
|
||||||
|
|
||||||
// Copy and shift dividend by same amount; may set new upper word
|
// Copy and shift dividend by same amount; may set new upper word
|
||||||
if (s) {
|
if (s) {
|
||||||
|
for (int i = vw - 1; i > 0; --i) vn[i] = (rwp[i] << s) | (rwp[i - 1] >> (32 - s));
|
||||||
|
vn[0] = rwp[0] << s;
|
||||||
un[uw] = lwp[uw - 1] >> (32 - s);
|
un[uw] = lwp[uw - 1] >> (32 - s);
|
||||||
|
for (int i = uw - 1; i > 0; --i) un[i] = (lwp[i] << s) | (lwp[i - 1] >> (32 - s));
|
||||||
|
un[0] = lwp[0] << s;
|
||||||
} else {
|
} else {
|
||||||
|
for (int i = vw - 1; i > 0; --i) vn[i] = rwp[i];
|
||||||
|
vn[0] = rwp[0];
|
||||||
un[uw] = 0;
|
un[uw] = 0;
|
||||||
|
for (int i = uw - 1; i > 0; --i) un[i] = lwp[i];
|
||||||
|
un[0] = lwp[0];
|
||||||
}
|
}
|
||||||
for (int i = uw - 1; i > 0; --i) {
|
|
||||||
un[i] = (lwp[i] << s) | (shift_mask & (lwp[i - 1] >> (32 - s)));
|
|
||||||
}
|
|
||||||
un[0] = lwp[0] << s;
|
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
for (int j = uw - vw; j >= 0; --j) {
|
for (int j = uw - vw; j >= 0; --j) {
|
||||||
@@ -536,8 +540,10 @@ WDataOutP _vl_moddiv_w(int lbits, WDataOutP owp, const WDataInP lwp, const WData
|
|||||||
|
|
||||||
if (is_modulus) { // modulus
|
if (is_modulus) { // modulus
|
||||||
// Need to reverse normalization on copy to output
|
// Need to reverse normalization on copy to output
|
||||||
for (int i = 0; i < vw; ++i) {
|
if (s) {
|
||||||
owp[i] = (un[i] >> s) | (shift_mask & (un[i + 1] << (32 - s)));
|
for (int i = 0; i < vw; ++i) owp[i] = (un[i] >> s) | (un[i + 1] << (32 - s));
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < vw; ++i) owp[i] = un[i];
|
||||||
}
|
}
|
||||||
for (int i = vw; i < words; ++i) owp[i] = 0;
|
for (int i = vw; i < words; ++i) owp[i] = 0;
|
||||||
return owp;
|
return owp;
|
||||||
@@ -549,6 +555,8 @@ WDataOutP _vl_moddiv_w(int lbits, WDataOutP owp, const WDataInP lwp, const WData
|
|||||||
WDataOutP VL_POW_WWW(int obits, int, int rbits, WDataOutP owp, const WDataInP lwp,
|
WDataOutP VL_POW_WWW(int obits, int, int rbits, WDataOutP owp, const WDataInP lwp,
|
||||||
const WDataInP rwp) VL_MT_SAFE {
|
const WDataInP rwp) VL_MT_SAFE {
|
||||||
// obits==lbits, rbits can be different
|
// obits==lbits, rbits can be different
|
||||||
|
const int owords = VL_WORDS_I(obits);
|
||||||
|
VL_DEBUG_IFDEF(assert(owords <= VL_MULS_MAX_WORDS););
|
||||||
owp[0] = 1;
|
owp[0] = 1;
|
||||||
for (int i = 1; i < VL_WORDS_I(obits); i++) owp[i] = 0;
|
for (int i = 1; i < VL_WORDS_I(obits); i++) owp[i] = 0;
|
||||||
// cppcheck-has-bug-suppress variableScope
|
// cppcheck-has-bug-suppress variableScope
|
||||||
@@ -560,11 +568,11 @@ WDataOutP VL_POW_WWW(int obits, int, int rbits, WDataOutP owp, const WDataInP lw
|
|||||||
for (int bit = 0; bit < rbits; bit++) {
|
for (int bit = 0; bit < rbits; bit++) {
|
||||||
if (bit > 0) { // power = power*power
|
if (bit > 0) { // power = power*power
|
||||||
VL_ASSIGN_W(obits, lastpowstore, powstore);
|
VL_ASSIGN_W(obits, lastpowstore, powstore);
|
||||||
VL_MUL_W(VL_WORDS_I(obits), powstore, lastpowstore, lastpowstore);
|
VL_MUL_W(owords, powstore, lastpowstore, lastpowstore);
|
||||||
}
|
}
|
||||||
if (VL_BITISSET_W(rwp, bit)) { // out *= power
|
if (VL_BITISSET_W(rwp, bit)) { // out *= power
|
||||||
VL_ASSIGN_W(obits, lastoutstore, owp);
|
VL_ASSIGN_W(obits, lastoutstore, owp);
|
||||||
VL_MUL_W(VL_WORDS_I(obits), owp, lastoutstore, powstore);
|
VL_MUL_W(owords, owp, lastoutstore, powstore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return owp;
|
return owp;
|
||||||
@@ -576,7 +584,10 @@ WDataOutP VL_POW_WWQ(int obits, int lbits, int rbits, WDataOutP owp, const WData
|
|||||||
return VL_POW_WWW(obits, lbits, rbits, owp, lwp, rhsw);
|
return VL_POW_WWW(obits, lbits, rbits, owp, lwp, rhsw);
|
||||||
}
|
}
|
||||||
QData VL_POW_QQW(int, int, int rbits, QData lhs, const WDataInP rwp) VL_MT_SAFE {
|
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
|
const int rwords = VL_WORDS_I(rbits);
|
||||||
|
EData rnz = rwp[0];
|
||||||
|
for (int w = 1; w < rwords; ++w) rnz |= rwp[w];
|
||||||
|
if (!rnz) return 1; // rwp == 0
|
||||||
if (VL_UNLIKELY(lhs == 0)) return 0;
|
if (VL_UNLIKELY(lhs == 0)) return 0;
|
||||||
QData power = lhs;
|
QData power = lhs;
|
||||||
QData result = 1ULL;
|
QData result = 1ULL;
|
||||||
@@ -594,7 +605,7 @@ WDataOutP VL_POWSS_WWW(int obits, int, int rbits, WDataOutP owp, const WDataInP
|
|||||||
const int words = VL_WORDS_I(obits);
|
const int words = VL_WORDS_I(obits);
|
||||||
VL_ZERO_W(obits, owp);
|
VL_ZERO_W(obits, owp);
|
||||||
EData lor = 0; // 0=all zeros, ~0=all ones, else mix
|
EData lor = 0; // 0=all zeros, ~0=all ones, else mix
|
||||||
for (int i = 1; i < (words - 1); ++i) { lor |= lwp[i]; }
|
for (int i = 1; i < (words - 1); ++i) lor |= lwp[i];
|
||||||
lor |= ((lwp[words - 1] == VL_MASK_E(rbits)) ? ~VL_EUL(0) : 0);
|
lor |= ((lwp[words - 1] == VL_MASK_E(rbits)) ? ~VL_EUL(0) : 0);
|
||||||
if (lor == 0 && lwp[0] == 0) { // "X" so return 0
|
if (lor == 0 && lwp[0] == 0) { // "X" so return 0
|
||||||
return owp;
|
return owp;
|
||||||
@@ -657,8 +668,10 @@ double VL_ITOR_D_W(int lbits, const WDataInP lwp) VL_PURE {
|
|||||||
}
|
}
|
||||||
double VL_ISTOR_D_W(int lbits, const WDataInP lwp) VL_MT_SAFE {
|
double VL_ISTOR_D_W(int lbits, const WDataInP lwp) VL_MT_SAFE {
|
||||||
if (!VL_SIGN_W(lbits, lwp)) return VL_ITOR_D_W(lbits, lwp);
|
if (!VL_SIGN_W(lbits, lwp)) return VL_ITOR_D_W(lbits, lwp);
|
||||||
|
const int words = VL_WORDS_I(lbits);
|
||||||
|
VL_DEBUG_IFDEF(assert(words <= VL_MULS_MAX_WORDS););
|
||||||
uint32_t pos[VL_MULS_MAX_WORDS + 1]; // Fixed size, as MSVC++ doesn't allow [words] here
|
uint32_t pos[VL_MULS_MAX_WORDS + 1]; // Fixed size, as MSVC++ doesn't allow [words] here
|
||||||
VL_NEGATE_W(VL_WORDS_I(lbits), pos, lwp);
|
VL_NEGATE_W(words, pos, lwp);
|
||||||
_vl_clean_inplace_w(lbits, pos);
|
_vl_clean_inplace_w(lbits, pos);
|
||||||
return -VL_ITOR_D_W(lbits, pos);
|
return -VL_ITOR_D_W(lbits, pos);
|
||||||
}
|
}
|
||||||
@@ -781,7 +794,7 @@ std::string _vl_vsformat_time(char* tmp, T ld, int timeunit, bool left, size_t w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int needmore = width - digits;
|
const int needmore = static_cast<int>(width) - digits;
|
||||||
std::string padding;
|
std::string padding;
|
||||||
if (needmore > 0) padding.append(needmore, ' '); // Pad with spaces
|
if (needmore > 0) padding.append(needmore, ' '); // Pad with spaces
|
||||||
return left ? (tmp + padding) : (padding + tmp);
|
return left ? (tmp + padding) : (padding + tmp);
|
||||||
@@ -790,7 +803,7 @@ std::string _vl_vsformat_time(char* tmp, T ld, int timeunit, bool left, size_t w
|
|||||||
// Do a va_arg returning a quad, assuming input argument is anything less than wide
|
// Do a va_arg returning a quad, assuming input argument is anything less than wide
|
||||||
#define VL_VA_ARG_Q_(ap, bits) (((bits) <= VL_IDATASIZE) ? va_arg(ap, IData) : va_arg(ap, QData))
|
#define VL_VA_ARG_Q_(ap, bits) (((bits) <= VL_IDATASIZE) ? va_arg(ap, IData) : va_arg(ap, QData))
|
||||||
|
|
||||||
void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SAFE {
|
void _vl_vsformat(std::string& output, const std::string& format, va_list ap) VL_MT_SAFE {
|
||||||
// Format a Verilog $write style format into the output list
|
// Format a Verilog $write style format into the output list
|
||||||
// The format must be pre-processed (and lower cased) by Verilator
|
// The format must be pre-processed (and lower cased) by Verilator
|
||||||
// Arguments are in "width, arg-value (or WDataIn* if wide)" form
|
// Arguments are in "width, arg-value (or WDataIn* if wide)" form
|
||||||
@@ -799,24 +812,24 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||||||
// Note also assumes variables < 64 are not wide, this assumption is
|
// Note also assumes variables < 64 are not wide, this assumption is
|
||||||
// sometimes not true in low-level routines written here in verilated.cpp
|
// sometimes not true in low-level routines written here in verilated.cpp
|
||||||
static thread_local char t_tmp[VL_VALUE_STRING_MAX_WIDTH];
|
static thread_local char t_tmp[VL_VALUE_STRING_MAX_WIDTH];
|
||||||
const char* pctp = nullptr; // Most recent %##.##g format
|
std::string::const_iterator pctit = format.end(); // Most recent %##.##g format
|
||||||
bool inPct = false;
|
bool inPct = false;
|
||||||
bool widthSet = false;
|
bool widthSet = false;
|
||||||
bool left = false;
|
bool left = false;
|
||||||
size_t width = 0;
|
size_t width = 0;
|
||||||
for (const char* pos = formatp; *pos; ++pos) {
|
for (std::string::const_iterator pos = format.cbegin(); pos != format.cend(); ++pos) {
|
||||||
if (!inPct && pos[0] == '%') {
|
if (!inPct && pos[0] == '%') {
|
||||||
pctp = pos;
|
pctit = pos;
|
||||||
inPct = true;
|
inPct = true;
|
||||||
widthSet = false;
|
widthSet = false;
|
||||||
width = 0;
|
width = 0;
|
||||||
} else if (!inPct) { // Normal text
|
} else if (!inPct) { // Normal text
|
||||||
// Fast-forward to next escape and add to output
|
// Fast-forward to next escape and add to output
|
||||||
const char* ep = pos;
|
std::string::const_iterator ep = pos;
|
||||||
while (ep[0] && ep[0] != '%') ++ep;
|
while (ep != format.end() && ep[0] != '%') ++ep;
|
||||||
if (ep != pos) {
|
if (ep != pos) {
|
||||||
output.append(pos, ep - pos);
|
output.append(pos, ep);
|
||||||
pos += ep - pos - 1;
|
pos = ep - 1;
|
||||||
}
|
}
|
||||||
} else { // Format character
|
} else { // Format character
|
||||||
inPct = false;
|
inPct = false;
|
||||||
@@ -873,14 +886,13 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||||||
case '^': { // Realtime
|
case '^': { // Realtime
|
||||||
const int lbits = va_arg(ap, int);
|
const int lbits = va_arg(ap, int);
|
||||||
const double d = va_arg(ap, double);
|
const double d = va_arg(ap, double);
|
||||||
if (lbits) {} // UNUSED - always 64
|
(void)lbits; // UNUSED - always 64
|
||||||
if (fmt == '^') { // Realtime
|
if (fmt == '^') { // Realtime
|
||||||
if (!widthSet) width = Verilated::threadContextp()->impp()->timeFormatWidth();
|
if (!widthSet) width = Verilated::threadContextp()->impp()->timeFormatWidth();
|
||||||
const int timeunit = va_arg(ap, int);
|
const int timeunit = va_arg(ap, int);
|
||||||
output += _vl_vsformat_time(t_tmp, d, timeunit, left, width);
|
output += _vl_vsformat_time(t_tmp, d, timeunit, left, width);
|
||||||
} else {
|
} else {
|
||||||
const size_t len = pos - pctp + 1;
|
const std::string fmts{pctit, pos + 1};
|
||||||
const std::string fmts{pctp, len};
|
|
||||||
VL_SNPRINTF(t_tmp, VL_VALUE_STRING_MAX_WIDTH, fmts.c_str(), d);
|
VL_SNPRINTF(t_tmp, VL_VALUE_STRING_MAX_WIDTH, fmts.c_str(), d);
|
||||||
output += t_tmp;
|
output += t_tmp;
|
||||||
}
|
}
|
||||||
@@ -934,20 +946,20 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||||||
if (VL_SIGN_E(lbits, lwp[VL_WORDS_I(lbits) - 1])) {
|
if (VL_SIGN_E(lbits, lwp[VL_WORDS_I(lbits) - 1])) {
|
||||||
VlWide<VL_VALUE_STRING_MAX_WIDTH / 4 + 2> neg;
|
VlWide<VL_VALUE_STRING_MAX_WIDTH / 4 + 2> neg;
|
||||||
VL_NEGATE_W(VL_WORDS_I(lbits), neg, lwp);
|
VL_NEGATE_W(VL_WORDS_I(lbits), neg, lwp);
|
||||||
append = std::string{"-"} + VL_DECIMAL_NW(lbits, neg);
|
append = "-"s + VL_DECIMAL_NW(lbits, neg);
|
||||||
} else {
|
} else {
|
||||||
append = VL_DECIMAL_NW(lbits, lwp);
|
append = VL_DECIMAL_NW(lbits, lwp);
|
||||||
}
|
}
|
||||||
digits = append.length();
|
digits = static_cast<int>(append.length());
|
||||||
}
|
}
|
||||||
const int needmore = width - digits;
|
const int needmore = static_cast<int>(width) - digits;
|
||||||
if (needmore > 0) {
|
if (needmore > 0) {
|
||||||
std::string padding;
|
std::string padding;
|
||||||
if (left) {
|
if (left) {
|
||||||
padding.append(needmore, ' '); // Pre-pad spaces
|
padding.append(needmore, ' '); // Pre-pad spaces
|
||||||
output += append + padding;
|
output += append + padding;
|
||||||
} else {
|
} else {
|
||||||
if (pctp && pctp[0] && pctp[1] == '0') { // %0
|
if (pctit != format.end() && pctit[0] && pctit[1] == '0') { // %0
|
||||||
padding.append(needmore, '0'); // Pre-pad zero
|
padding.append(needmore, '0'); // Pre-pad zero
|
||||||
} else {
|
} else {
|
||||||
padding.append(needmore, ' '); // Pre-pad spaces
|
padding.append(needmore, ' '); // Pre-pad spaces
|
||||||
@@ -967,16 +979,16 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||||||
append = t_tmp;
|
append = t_tmp;
|
||||||
} else {
|
} else {
|
||||||
append = VL_DECIMAL_NW(lbits, lwp);
|
append = VL_DECIMAL_NW(lbits, lwp);
|
||||||
digits = append.length();
|
digits = static_cast<int>(append.length());
|
||||||
}
|
}
|
||||||
const int needmore = width - digits;
|
const int needmore = static_cast<int>(width) - digits;
|
||||||
if (needmore > 0) {
|
if (needmore > 0) {
|
||||||
std::string padding;
|
std::string padding;
|
||||||
if (left) {
|
if (left) {
|
||||||
padding.append(needmore, ' '); // Pre-pad spaces
|
padding.append(needmore, ' '); // Pre-pad spaces
|
||||||
output += append + padding;
|
output += append + padding;
|
||||||
} else {
|
} else {
|
||||||
if (pctp && pctp[0] && pctp[1] == '0') { // %0
|
if (pctit != format.end() && pctit[0] && pctit[1] == '0') { // %0
|
||||||
padding.append(needmore, '0'); // Pre-pad zero
|
padding.append(needmore, '0'); // Pre-pad zero
|
||||||
} else {
|
} else {
|
||||||
padding.append(needmore, ' '); // Pre-pad spaces
|
padding.append(needmore, ' '); // Pre-pad spaces
|
||||||
@@ -1035,7 +1047,7 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||||||
}
|
}
|
||||||
} // switch
|
} // switch
|
||||||
|
|
||||||
const int needmore = width - digits;
|
const int needmore = static_cast<int>(width) - digits;
|
||||||
if (needmore > 0) {
|
if (needmore > 0) {
|
||||||
std::string padding;
|
std::string padding;
|
||||||
if (left) {
|
if (left) {
|
||||||
@@ -1076,7 +1088,7 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: { // LCOV_EXCL_START
|
default: { // LCOV_EXCL_START
|
||||||
const std::string msg = std::string{"Unknown _vl_vsformat code: "} + pos[0];
|
const std::string msg = "Unknown _vl_vsformat code: "s + pos[0];
|
||||||
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
||||||
break;
|
break;
|
||||||
} // LCOV_EXCL_STOP
|
} // LCOV_EXCL_STOP
|
||||||
@@ -1194,7 +1206,7 @@ static void _vl_vsss_based(WDataOutP owp, int obits, int baseLog2, const char* s
|
|||||||
IData _vl_vsscanf(FILE* fp, // If a fscanf
|
IData _vl_vsscanf(FILE* fp, // If a fscanf
|
||||||
int fbits, const WDataInP fromp, // Else if a sscanf
|
int fbits, const WDataInP fromp, // Else if a sscanf
|
||||||
const std::string& fstr, // if a sscanf to string
|
const std::string& fstr, // if a sscanf to string
|
||||||
const char* formatp, va_list ap) VL_MT_SAFE {
|
const std::string& format, va_list ap) VL_MT_SAFE {
|
||||||
// Read a Verilog $sscanf/$fscanf style format into the output list
|
// Read a Verilog $sscanf/$fscanf style format into the output list
|
||||||
// The format must be pre-processed (and lower cased) by Verilator
|
// The format must be pre-processed (and lower cased) by Verilator
|
||||||
// Arguments are in "width, arg-value (or WDataIn* if wide)" form
|
// Arguments are in "width, arg-value (or WDataIn* if wide)" form
|
||||||
@@ -1203,15 +1215,15 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
|
|||||||
IData got = 0;
|
IData got = 0;
|
||||||
bool inPct = false;
|
bool inPct = false;
|
||||||
bool inIgnore = false;
|
bool inIgnore = false;
|
||||||
const char* pos = formatp;
|
std::string::const_iterator pos = format.cbegin();
|
||||||
for (; *pos && !_vl_vsss_eof(fp, floc); ++pos) {
|
for (; pos != format.cend() && !_vl_vsss_eof(fp, floc); ++pos) {
|
||||||
// VL_DBG_MSGF("_vlscan fmt='"<<pos[0]<<"' floc="<<floc<<" file='"<<_vl_vsss_peek(fp, floc,
|
// VL_DBG_MSGF("_vlscan fmt='"<<pos[0]<<"' floc="<<floc<<" file='"<<_vl_vsss_peek(fp, floc,
|
||||||
// fromp, fstr)<<"'\n");
|
// fromp, fstr)<<"'\n");
|
||||||
if (!inPct && pos[0] == '%') {
|
if (!inPct && pos[0] == '%') {
|
||||||
inPct = true;
|
inPct = true;
|
||||||
inIgnore = false;
|
inIgnore = false;
|
||||||
} else if (!inPct && std::isspace(pos[0])) { // Format spaces
|
} else if (!inPct && std::isspace(pos[0])) { // Format spaces
|
||||||
while (std::isspace(pos[1])) pos++;
|
while (std::isspace(pos[1])) ++pos;
|
||||||
_vl_vsss_skipspace(fp, floc, fromp, fstr);
|
_vl_vsss_skipspace(fp, floc, fromp, fstr);
|
||||||
} else if (!inPct) { // Expected Format
|
} else if (!inPct) { // Expected Format
|
||||||
_vl_vsss_skipspace(fp, floc, fromp, fstr);
|
_vl_vsss_skipspace(fp, floc, fromp, fstr);
|
||||||
@@ -1358,7 +1370,7 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: { // LCOV_EXCL_START
|
default: { // LCOV_EXCL_START
|
||||||
const std::string msg = std::string{"Unknown _vl_vsscanf code: "} + pos[0];
|
const std::string msg = "Unknown _vl_vsscanf code: "s + pos[0];
|
||||||
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
||||||
break;
|
break;
|
||||||
} // LCOV_EXCL_STOP
|
} // LCOV_EXCL_STOP
|
||||||
@@ -1427,8 +1439,8 @@ void _vl_string_to_vint(int obits, void* destp, size_t srclen, const char* srcp)
|
|||||||
char* op = reinterpret_cast<char*>(destp);
|
char* op = reinterpret_cast<char*>(destp);
|
||||||
if (srclen > bytes) srclen = bytes; // Don't overflow destination
|
if (srclen > bytes) srclen = bytes; // Don't overflow destination
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for (i = 0; i < srclen; ++i) { *op++ = srcp[srclen - 1 - i]; }
|
for (i = 0; i < srclen; ++i) *op++ = srcp[srclen - 1 - i];
|
||||||
for (; i < bytes; ++i) { *op++ = 0; }
|
for (; i < bytes; ++i) *op++ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IData getLine(std::string& str, IData fpi, size_t maxLen) VL_MT_SAFE {
|
static IData getLine(std::string& str, IData fpi, size_t maxLen) VL_MT_SAFE {
|
||||||
@@ -1498,149 +1510,153 @@ void VL_FCLOSE_I(IData fdi) VL_MT_SAFE {
|
|||||||
Verilated::threadContextp()->impp()->fdClose(fdi);
|
Verilated::threadContextp()->impp()->fdClose(fdi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits, CData& destr, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_NX(int obits, CData& destr, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits, SData& destr, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_NX(int obits, SData& destr, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits, IData& destr, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_NX(int obits, IData& destr, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits, QData& destr, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_NX(int obits, QData& destr, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
_vl_string_to_vint(obits, &destr, t_output.length(), t_output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits, void* destp, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_NX(int obits, void* destp, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
_vl_string_to_vint(obits, destp, t_output.length(), t_output.c_str());
|
_vl_string_to_vint(obits, destp, t_output.length(), t_output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits_ignored, std::string& output, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_NX(int obits_ignored, std::string& output, const std::string& format, int argc,
|
||||||
if (obits_ignored) {}
|
...) VL_MT_SAFE {
|
||||||
|
(void)obits_ignored; // So VL_SFORMAT_NNX function signatures all match
|
||||||
std::string temp_output;
|
std::string temp_output;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(temp_output, formatp, ap);
|
_vl_vsformat(temp_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
output = temp_output;
|
output = temp_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VL_SFORMATF_NX(const char* formatp, ...) VL_MT_SAFE {
|
std::string VL_SFORMATF_N_NX(const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
return t_output;
|
return t_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_WRITEF(const char* formatp, ...) VL_MT_SAFE {
|
void VL_WRITEF_NX(const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
VL_PRINTF_MT("%s", t_output.c_str());
|
VL_PRINTF_MT("%s", t_output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VL_FWRITEF(IData fpi, const char* formatp, ...) VL_MT_SAFE {
|
void VL_FWRITEF_NX(IData fpi, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
// While threadsafe, each thread can only access different file handles
|
// While threadsafe, each thread can only access different file handles
|
||||||
static thread_local std::string t_output; // static only for speed
|
static thread_local std::string t_output; // static only for speed
|
||||||
t_output = "";
|
t_output = "";
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
_vl_vsformat(t_output, formatp, ap);
|
_vl_vsformat(t_output, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
Verilated::threadContextp()->impp()->fdWrite(fpi, t_output);
|
Verilated::threadContextp()->impp()->fdWrite(fpi, t_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
IData VL_FSCANF_IX(IData fpi, const char* formatp, ...) VL_MT_SAFE {
|
IData VL_FSCANF_INX(IData fpi, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
// While threadsafe, each thread can only access different file handles
|
// While threadsafe, each thread can only access different file handles
|
||||||
FILE* const fp = VL_CVT_I_FP(fpi);
|
FILE* const fp = VL_CVT_I_FP(fpi);
|
||||||
if (VL_UNLIKELY(!fp)) return ~0U; // -1
|
if (VL_UNLIKELY(!fp)) return ~0U; // -1
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
const IData got = _vl_vsscanf(fp, 0, nullptr, "", formatp, ap);
|
const IData got = _vl_vsscanf(fp, 0, nullptr, "", format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
|
|
||||||
IData VL_SSCANF_IIX(int lbits, IData ld, const char* formatp, ...) VL_MT_SAFE {
|
IData VL_SSCANF_IINX(int lbits, IData ld, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
VlWide<VL_WQ_WORDS_E> fnw;
|
VlWide<VL_WQ_WORDS_E> fnw;
|
||||||
VL_SET_WI(fnw, ld);
|
VL_SET_WI(fnw, ld);
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
const IData got = _vl_vsscanf(nullptr, lbits, fnw, "", formatp, ap);
|
const IData got = _vl_vsscanf(nullptr, lbits, fnw, "", format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
IData VL_SSCANF_IQX(int lbits, QData ld, const char* formatp, ...) VL_MT_SAFE {
|
IData VL_SSCANF_IQNX(int lbits, QData ld, const std::string& format, int argc, ...) VL_MT_SAFE {
|
||||||
VlWide<VL_WQ_WORDS_E> fnw;
|
VlWide<VL_WQ_WORDS_E> fnw;
|
||||||
VL_SET_WQ(fnw, ld);
|
VL_SET_WQ(fnw, ld);
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
const IData got = _vl_vsscanf(nullptr, lbits, fnw, "", formatp, ap);
|
const IData got = _vl_vsscanf(nullptr, lbits, fnw, "", format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
IData VL_SSCANF_IWX(int lbits, const WDataInP lwp, const char* formatp, ...) VL_MT_SAFE {
|
IData VL_SSCANF_IWNX(int lbits, const WDataInP lwp, const std::string& format, int argc,
|
||||||
|
...) VL_MT_SAFE {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
const IData got = _vl_vsscanf(nullptr, lbits, lwp, "", formatp, ap);
|
const IData got = _vl_vsscanf(nullptr, lbits, lwp, "", format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
IData VL_SSCANF_INX(int, const std::string& ld, const char* formatp, ...) VL_MT_SAFE {
|
IData VL_SSCANF_INNX(int, const std::string& ld, const std::string& format, int argc,
|
||||||
|
...) VL_MT_SAFE {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, argc);
|
||||||
const IData got = _vl_vsscanf(nullptr, ld.length() * 8, nullptr, ld, formatp, ap);
|
const IData got
|
||||||
|
= _vl_vsscanf(nullptr, static_cast<int>(ld.length() * 8), nullptr, ld, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
@@ -1715,7 +1731,7 @@ std::string VL_STACKTRACE_N() VL_MT_SAFE {
|
|||||||
if (!strings) return "Unable to backtrace\n";
|
if (!strings) return "Unable to backtrace\n";
|
||||||
|
|
||||||
std::string result = "Backtrace:\n";
|
std::string result = "Backtrace:\n";
|
||||||
for (int j = 0; j < nptrs; j++) result += std::string{strings[j]} + std::string{"\n"};
|
for (int j = 0; j < nptrs; j++) result += std::string{strings[j]} + "\n"s;
|
||||||
free(strings);
|
free(strings);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1858,13 +1874,13 @@ const char* vl_mc_scan_plusargs(const char* prefixp) VL_MT_SAFE {
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
// Heavy string functions
|
// Heavy string functions
|
||||||
|
|
||||||
std::string VL_TO_STRING(CData lhs) { return VL_SFORMATF_NX("'h%0x", 8, lhs); }
|
std::string VL_TO_STRING(CData lhs) { return VL_SFORMATF_N_NX("'h%0x", 0, 8, lhs); }
|
||||||
std::string VL_TO_STRING(SData lhs) { return VL_SFORMATF_NX("'h%0x", 16, lhs); }
|
std::string VL_TO_STRING(SData lhs) { return VL_SFORMATF_N_NX("'h%0x", 0, 16, lhs); }
|
||||||
std::string VL_TO_STRING(IData lhs) { return VL_SFORMATF_NX("'h%0x", 32, lhs); }
|
std::string VL_TO_STRING(IData lhs) { return VL_SFORMATF_N_NX("'h%0x", 0, 32, lhs); }
|
||||||
std::string VL_TO_STRING(QData lhs) { return VL_SFORMATF_NX("'h%0x", 64, lhs); }
|
std::string VL_TO_STRING(QData lhs) { return VL_SFORMATF_N_NX("'h%0x", 0, 64, lhs); }
|
||||||
std::string VL_TO_STRING(double lhs) { return VL_SFORMATF_NX("%d", 64, lhs); }
|
std::string VL_TO_STRING(double lhs) { return VL_SFORMATF_N_NX("%d", 0, 64, lhs); }
|
||||||
std::string VL_TO_STRING_W(int words, const WDataInP obj) {
|
std::string VL_TO_STRING_W(int words, const WDataInP obj) {
|
||||||
return VL_SFORMATF_NX("'h%0x", words * VL_EDATASIZE, obj);
|
return VL_SFORMATF_N_NX("'h%0x", 0, words * VL_EDATASIZE, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VL_TOLOWER_NN(const std::string& ld) VL_PURE {
|
std::string VL_TOLOWER_NN(const std::string& ld) VL_PURE {
|
||||||
@@ -1929,7 +1945,7 @@ std::string VL_SUBSTR_N(const std::string& lhs, IData rhs, IData ths) VL_PURE {
|
|||||||
|
|
||||||
IData VL_ATOI_N(const std::string& str, int base) VL_PURE {
|
IData VL_ATOI_N(const std::string& str, int base) VL_PURE {
|
||||||
std::string str_mod = str;
|
std::string str_mod = str;
|
||||||
// IEEE 1800-2017 6.16.9 says '_' may exist.
|
// IEEE 1800-2023 6.16.9 says '_' may exist.
|
||||||
str_mod.erase(std::remove(str_mod.begin(), str_mod.end(), '_'), str_mod.end());
|
str_mod.erase(std::remove(str_mod.begin(), str_mod.end(), '_'), str_mod.end());
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
@@ -2094,10 +2110,11 @@ bool VlReadMem::get(QData& addrr, std::string& valuer) {
|
|||||||
|
|
||||||
if (VL_UNLIKELY(m_end != ~0ULL && m_addr <= m_end && !m_anyAddr)) {
|
if (VL_UNLIKELY(m_end != ~0ULL && m_addr <= m_end && !m_anyAddr)) {
|
||||||
VL_WARN_MT(m_filename.c_str(), m_linenum, "",
|
VL_WARN_MT(m_filename.c_str(), m_linenum, "",
|
||||||
"$readmem file ended before specified final address (IEEE 2017 21.4)");
|
"$readmem file ended before specified final address (IEEE 1800-2023 21.4)");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // EOF
|
addrr = m_addr;
|
||||||
|
return indata; // EOF
|
||||||
}
|
}
|
||||||
void VlReadMem::setData(void* valuep, const std::string& rhs) {
|
void VlReadMem::setData(void* valuep, const std::string& rhs) {
|
||||||
const QData shift = m_hex ? 4ULL : 1ULL;
|
const QData shift = m_hex ? 4ULL : 1ULL;
|
||||||
@@ -2246,6 +2263,7 @@ void VL_READMEM_N(bool hex, // Hex format, else binary
|
|||||||
QData addr = 0;
|
QData addr = 0;
|
||||||
std::string value;
|
std::string value;
|
||||||
if (rmem.get(addr /*ref*/, value /*ref*/)) {
|
if (rmem.get(addr /*ref*/, value /*ref*/)) {
|
||||||
|
// printf("readmem.get [%" PRIu64 "]=%s\n", addr, value.c_str());
|
||||||
if (VL_UNLIKELY(addr < static_cast<QData>(array_lsb)
|
if (VL_UNLIKELY(addr < static_cast<QData>(array_lsb)
|
||||||
|| addr >= static_cast<QData>(array_lsb + depth))) {
|
|| addr >= static_cast<QData>(array_lsb + depth))) {
|
||||||
VL_FATAL_MT(filename.c_str(), rmem.linenum(), "",
|
VL_FATAL_MT(filename.c_str(), rmem.linenum(), "",
|
||||||
@@ -2400,6 +2418,22 @@ uint64_t vl_time_pow10(int n) {
|
|||||||
return pow10[n];
|
return pow10[n];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string vl_timescaled_double(double value, const char* format) VL_PURE {
|
||||||
|
const char* suffixp = "s";
|
||||||
|
// clang-format off
|
||||||
|
if (value >= 1e0) { suffixp = "s"; value *= 1e0; }
|
||||||
|
else if (value >= 1e-3) { suffixp = "ms"; value *= 1e3; }
|
||||||
|
else if (value >= 1e-6) { suffixp = "us"; value *= 1e6; }
|
||||||
|
else if (value >= 1e-9) { suffixp = "ns"; value *= 1e9; }
|
||||||
|
else if (value >= 1e-12) { suffixp = "ps"; value *= 1e12; }
|
||||||
|
else if (value >= 1e-15) { suffixp = "fs"; value *= 1e15; }
|
||||||
|
else if (value >= 1e-18) { suffixp = "as"; value *= 1e18; }
|
||||||
|
// clang-format on
|
||||||
|
char valuestr[100];
|
||||||
|
VL_SNPRINTF(valuestr, 100, format, value, suffixp);
|
||||||
|
return std::string{valuestr}; // Gets converted to string, so no ref to stack
|
||||||
|
}
|
||||||
|
|
||||||
void VL_PRINTTIMESCALE(const char* namep, const char* timeunitp,
|
void VL_PRINTTIMESCALE(const char* namep, const char* timeunitp,
|
||||||
const VerilatedContext* contextp) VL_MT_SAFE {
|
const VerilatedContext* contextp) VL_MT_SAFE {
|
||||||
VL_PRINTF_MT("Time scale of %s is %s / %s\n", namep, timeunitp,
|
VL_PRINTF_MT("Time scale of %s is %s / %s\n", namep, timeunitp,
|
||||||
@@ -2420,12 +2454,14 @@ VerilatedContext::VerilatedContext()
|
|||||||
: m_impdatap{new VerilatedContextImpData} {
|
: m_impdatap{new VerilatedContextImpData} {
|
||||||
Verilated::lastContextp(this);
|
Verilated::lastContextp(this);
|
||||||
Verilated::threadContextp(this);
|
Verilated::threadContextp(this);
|
||||||
|
m_ns.m_coverageFilename = "coverage.dat";
|
||||||
m_ns.m_profExecFilename = "profile_exec.dat";
|
m_ns.m_profExecFilename = "profile_exec.dat";
|
||||||
m_ns.m_profVltFilename = "profile.vlt";
|
m_ns.m_profVltFilename = "profile.vlt";
|
||||||
m_fdps.resize(31);
|
m_fdps.resize(31);
|
||||||
std::fill(m_fdps.begin(), m_fdps.end(), static_cast<FILE*>(nullptr));
|
std::fill(m_fdps.begin(), m_fdps.end(), static_cast<FILE*>(nullptr));
|
||||||
m_fdFreeMct.resize(30);
|
m_fdFreeMct.resize(30);
|
||||||
for (std::size_t i = 0, id = 1; i < m_fdFreeMct.size(); ++i, ++id) m_fdFreeMct[i] = id;
|
IData id = 1;
|
||||||
|
for (std::size_t i = 0; i < m_fdFreeMct.size(); ++i, ++id) m_fdFreeMct[i] = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must declare here not in interface, as otherwise forward declarations not known
|
// Must declare here not in interface, as otherwise forward declarations not known
|
||||||
@@ -2455,6 +2491,14 @@ void VerilatedContext::calcUnusedSigs(bool flag) VL_MT_SAFE {
|
|||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
m_s.m_calcUnusedSigs = flag;
|
m_s.m_calcUnusedSigs = flag;
|
||||||
}
|
}
|
||||||
|
void VerilatedContext::coverageFilename(const std::string& flag) VL_MT_SAFE {
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
m_ns.m_coverageFilename = flag;
|
||||||
|
}
|
||||||
|
std::string VerilatedContext::coverageFilename() const VL_MT_SAFE {
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
return m_ns.m_coverageFilename;
|
||||||
|
}
|
||||||
void VerilatedContext::dumpfile(const std::string& flag) VL_MT_SAFE_EXCLUDES(m_timeDumpMutex) {
|
void VerilatedContext::dumpfile(const std::string& flag) VL_MT_SAFE_EXCLUDES(m_timeDumpMutex) {
|
||||||
const VerilatedLockGuard lock{m_timeDumpMutex};
|
const VerilatedLockGuard lock{m_timeDumpMutex};
|
||||||
m_dumpfile = flag;
|
m_dumpfile = flag;
|
||||||
@@ -2523,6 +2567,10 @@ std::string VerilatedContext::profVltFilename() const VL_MT_SAFE {
|
|||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
return m_ns.m_profVltFilename;
|
return m_ns.m_profVltFilename;
|
||||||
}
|
}
|
||||||
|
void VerilatedContext::quiet(bool flag) VL_MT_SAFE {
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
m_s.m_quiet = flag;
|
||||||
|
}
|
||||||
void VerilatedContext::randReset(int val) VL_MT_SAFE {
|
void VerilatedContext::randReset(int val) VL_MT_SAFE {
|
||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
m_s.m_randReset = val;
|
m_s.m_randReset = val;
|
||||||
@@ -2590,8 +2638,16 @@ void VerilatedContext::internalsDump() const VL_MT_SAFE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VerilatedContext::addModel(VerilatedModel* modelp) {
|
void VerilatedContext::addModel(VerilatedModel* modelp) {
|
||||||
|
if (!quiet()) {
|
||||||
|
// CPU time isn't read as starting point until model creation, so that quiet() is set
|
||||||
|
// Thus if quiet(), avoids slow OS read affecting some usages that make many models
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
m_ns.m_cpuTimeStart.start();
|
||||||
|
m_ns.m_wallTimeStart.start();
|
||||||
|
}
|
||||||
threadPoolp(); // Ensure thread pool is created, so m_threads cannot change any more
|
threadPoolp(); // Ensure thread pool is created, so m_threads cannot change any more
|
||||||
|
|
||||||
|
m_threadsInModels += modelp->threads();
|
||||||
if (VL_UNLIKELY(modelp->threads() > m_threads)) {
|
if (VL_UNLIKELY(modelp->threads() > m_threads)) {
|
||||||
std::ostringstream msg;
|
std::ostringstream msg;
|
||||||
msg << "VerilatedContext has " << m_threads << " threads but model '"
|
msg << "VerilatedContext has " << m_threads << " threads but model '"
|
||||||
@@ -2608,6 +2664,14 @@ VerilatedVirtualBase* VerilatedContext::threadPoolp() {
|
|||||||
return m_threadPool.get();
|
return m_threadPool.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VerilatedContext::prepareClone() { delete m_threadPool.release(); }
|
||||||
|
|
||||||
|
VerilatedVirtualBase* VerilatedContext::threadPoolpOnClone() {
|
||||||
|
if (VL_UNLIKELY(m_threadPool)) m_threadPool.release();
|
||||||
|
m_threadPool = std::unique_ptr<VlThreadPool>(new VlThreadPool{this, m_threads - 1});
|
||||||
|
return m_threadPool.get();
|
||||||
|
}
|
||||||
|
|
||||||
VerilatedVirtualBase*
|
VerilatedVirtualBase*
|
||||||
VerilatedContext::enableExecutionProfiler(VerilatedVirtualBase* (*construct)(VerilatedContext&)) {
|
VerilatedContext::enableExecutionProfiler(VerilatedVirtualBase* (*construct)(VerilatedContext&)) {
|
||||||
if (!m_executionProfiler) m_executionProfiler.reset(construct(*this));
|
if (!m_executionProfiler) m_executionProfiler.reset(construct(*this));
|
||||||
@@ -2616,6 +2680,7 @@ VerilatedContext::enableExecutionProfiler(VerilatedVirtualBase* (*construct)(Ver
|
|||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// VerilatedContextImp:: Methods - command line
|
// VerilatedContextImp:: Methods - command line
|
||||||
|
|
||||||
void VerilatedContextImp::commandArgsGuts(int argc, const char** argv)
|
void VerilatedContextImp::commandArgsGuts(int argc, const char** argv)
|
||||||
VL_MT_SAFE_EXCLUDES(m_argMutex) {
|
VL_MT_SAFE_EXCLUDES(m_argMutex) {
|
||||||
const VerilatedLockGuard lock{m_argMutex};
|
const VerilatedLockGuard lock{m_argMutex};
|
||||||
@@ -2675,7 +2740,7 @@ std::pair<int, char**> VerilatedContextImp::argc_argv() VL_MT_SAFE_EXCLUDES(m_ar
|
|||||||
int in = 0;
|
int in = 0;
|
||||||
for (const auto& i : m_args.m_argVec) {
|
for (const auto& i : m_args.m_argVec) {
|
||||||
s_argvp[in] = new char[i.length() + 1];
|
s_argvp[in] = new char[i.length() + 1];
|
||||||
std::strcpy(s_argvp[in], i.c_str());
|
std::memcpy(s_argvp[in], i.c_str(), i.length() + 1);
|
||||||
++in;
|
++in;
|
||||||
}
|
}
|
||||||
s_argvp[s_argc] = nullptr;
|
s_argvp[s_argc] = nullptr;
|
||||||
@@ -2687,7 +2752,9 @@ void VerilatedContextImp::commandArgVl(const std::string& arg) {
|
|||||||
if (0 == std::strncmp(arg.c_str(), "+verilator+", std::strlen("+verilator+"))) {
|
if (0 == std::strncmp(arg.c_str(), "+verilator+", std::strlen("+verilator+"))) {
|
||||||
std::string str;
|
std::string str;
|
||||||
uint64_t u64;
|
uint64_t u64;
|
||||||
if (arg == "+verilator+debug") {
|
if (commandArgVlString(arg, "+verilator+coverage+file+", str)) {
|
||||||
|
coverageFilename(str);
|
||||||
|
} else if (arg == "+verilator+debug") {
|
||||||
Verilated::debug(4);
|
Verilated::debug(4);
|
||||||
} else if (commandArgVlUint64(arg, "+verilator+debugi+", u64, 0,
|
} else if (commandArgVlUint64(arg, "+verilator+debugi+", u64, 0,
|
||||||
std::numeric_limits<int>::max())) {
|
std::numeric_limits<int>::max())) {
|
||||||
@@ -2702,17 +2769,16 @@ void VerilatedContextImp::commandArgVl(const std::string& arg) {
|
|||||||
"Exiting due to command line argument (not an error)");
|
"Exiting due to command line argument (not an error)");
|
||||||
} else if (arg == "+verilator+noassert") {
|
} else if (arg == "+verilator+noassert") {
|
||||||
assertOn(false);
|
assertOn(false);
|
||||||
} else if (commandArgVlUint64(arg, "+verilator+prof+exec+start+", u64)
|
} else if (commandArgVlUint64(arg, "+verilator+prof+exec+start+", u64)) {
|
||||||
|| commandArgVlUint64(arg, "+verilator+prof+threads+start+", u64)) {
|
|
||||||
profExecStart(u64);
|
profExecStart(u64);
|
||||||
} else if (commandArgVlUint64(arg, "+verilator+prof+exec+window+", u64, 1)
|
} else if (commandArgVlUint64(arg, "+verilator+prof+exec+window+", u64, 1)) {
|
||||||
|| commandArgVlUint64(arg, "+verilator+prof+threads+window+", u64, 1)) {
|
|
||||||
profExecWindow(u64);
|
profExecWindow(u64);
|
||||||
} else if (commandArgVlString(arg, "+verilator+prof+exec+file+", str)
|
} else if (commandArgVlString(arg, "+verilator+prof+exec+file+", str)) {
|
||||||
|| commandArgVlString(arg, "+verilator+prof+threads+file+", str)) {
|
|
||||||
profExecFilename(str);
|
profExecFilename(str);
|
||||||
} else if (commandArgVlString(arg, "+verilator+prof+vlt+file+", str)) {
|
} else if (commandArgVlString(arg, "+verilator+prof+vlt+file+", str)) {
|
||||||
profVltFilename(str);
|
profVltFilename(str);
|
||||||
|
} else if (arg == "+verilator+quiet") {
|
||||||
|
quiet(true);
|
||||||
} else if (commandArgVlUint64(arg, "+verilator+rand+reset+", u64, 0, 2)) {
|
} else if (commandArgVlUint64(arg, "+verilator+rand+reset+", u64, 0, 2)) {
|
||||||
randReset(static_cast<int>(u64));
|
randReset(static_cast<int>(u64));
|
||||||
} else if (commandArgVlUint64(arg, "+verilator+seed+", u64, 1,
|
} else if (commandArgVlUint64(arg, "+verilator+seed+", u64, 1,
|
||||||
@@ -2758,7 +2824,7 @@ bool VerilatedContextImp::commandArgVlUint64(const std::string& arg, const std::
|
|||||||
VL_FATAL_MT("COMMAND_LINE", 0, "", msg.c_str());
|
VL_FATAL_MT("COMMAND_LINE", 0, "", msg.c_str());
|
||||||
};
|
};
|
||||||
|
|
||||||
if (std::any_of(str.begin(), str.end(), [](int c) { return !std::isdigit(c); })) fail();
|
if (std::any_of(str.cbegin(), str.cend(), [](int c) { return !std::isdigit(c); })) fail();
|
||||||
char* end;
|
char* end;
|
||||||
valuer = std::strtoull(str.c_str(), &end, 10);
|
valuer = std::strtoull(str.c_str(), &end, 10);
|
||||||
if (errno == ERANGE) fail("Value out of range of uint64_t");
|
if (errno == ERANGE) fail("Value out of range of uint64_t");
|
||||||
@@ -2790,6 +2856,36 @@ uint64_t VerilatedContextImp::randSeedDefault64() const VL_MT_SAFE {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
// VerilatedContext:: Statistics
|
||||||
|
|
||||||
|
double VerilatedContext::statCpuTimeSinceStart() const VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
return m_ns.m_cpuTimeStart.deltaTime();
|
||||||
|
}
|
||||||
|
double VerilatedContext::statWallTimeSinceStart() const VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
return m_ns.m_wallTimeStart.deltaTime();
|
||||||
|
}
|
||||||
|
void VerilatedContext::statsPrintSummary() VL_MT_UNSAFE {
|
||||||
|
if (quiet()) return;
|
||||||
|
VL_PRINTF("- S i m u l a t i o n R e p o r t: %s %s\n", Verilated::productName(),
|
||||||
|
Verilated::productVersion());
|
||||||
|
const std::string endwhy = gotError() ? "$stop" : gotFinish() ? "$finish" : "end";
|
||||||
|
const double simtimeInUnits = VL_TIME_Q() * vl_time_multiplier(timeunit())
|
||||||
|
* vl_time_multiplier(timeprecision() - timeunit());
|
||||||
|
const std::string simtime = vl_timescaled_double(simtimeInUnits);
|
||||||
|
const double walltime = statWallTimeSinceStart();
|
||||||
|
const double cputime = statCpuTimeSinceStart();
|
||||||
|
const std::string simtimePerf
|
||||||
|
= vl_timescaled_double((cputime != 0.0) ? (simtimeInUnits / cputime) : 0, "%0.3f %s");
|
||||||
|
VL_PRINTF("- Verilator: %s at %s; walltime %0.3f s; speed %s/s\n", endwhy.c_str(),
|
||||||
|
simtime.c_str(), walltime, simtimePerf.c_str());
|
||||||
|
const double modelMB = VlOs::memUsageBytes() / 1024.0 / 1024.0;
|
||||||
|
VL_PRINTF("- Verilator: cpu %0.3f s on %d threads; alloced %0.0f MB\n", cputime,
|
||||||
|
threadsInModels(), modelMB);
|
||||||
|
}
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// VerilatedContext:: Methods - scopes
|
// VerilatedContext:: Methods - scopes
|
||||||
|
|
||||||
@@ -2828,6 +2924,37 @@ const VerilatedScopeNameMap* VerilatedContext::scopeNameMap() VL_MT_SAFE {
|
|||||||
return &(impp()->m_impdatap->m_nameMap);
|
return &(impp()->m_impdatap->m_nameMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
// VerilatedContext:: Methods - trace
|
||||||
|
|
||||||
|
void VerilatedContext::trace(VerilatedTraceBaseC* tfp, int levels, int options) VL_MT_SAFE {
|
||||||
|
VL_DEBUG_IF(VL_DBG_MSGF("+ VerilatedContext::trace\n"););
|
||||||
|
if (tfp->isOpen()) {
|
||||||
|
VL_FATAL_MT("", 0, "",
|
||||||
|
"Testbench C call to 'VerilatedContext::trace()' must not be called"
|
||||||
|
" after 'VerilatedTrace*::open()'\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// Legacy usage may call {modela}->trace(...) then {modelb}->trace(...)
|
||||||
|
// So check for and suppress second and later calls
|
||||||
|
if (tfp->modelConnected()) return;
|
||||||
|
tfp->modelConnected(true);
|
||||||
|
}
|
||||||
|
// We rely on m_ns.m_traceBaseModelCbs being stable when trace() is called
|
||||||
|
// nope: const VerilatedLockGuard lock{m_mutex};
|
||||||
|
if (m_ns.m_traceBaseModelCbs.empty())
|
||||||
|
VL_FATAL_MT("", 0, "",
|
||||||
|
"Testbench C call to 'VerilatedContext::trace()' requires model(s) Verilated"
|
||||||
|
" with --trace or --trace-vcd option");
|
||||||
|
for (auto& cbr : m_ns.m_traceBaseModelCbs) cbr(tfp, levels, options);
|
||||||
|
}
|
||||||
|
void VerilatedContext::traceBaseModelCbAdd(traceBaseModelCb_t cb) VL_MT_SAFE {
|
||||||
|
// Model creation registering a callback for when Verilated::trace() called
|
||||||
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
|
m_ns.m_traceBaseModelCbs.push_back(cb);
|
||||||
|
}
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// VerilatedSyms:: Methods
|
// VerilatedSyms:: Methods
|
||||||
|
|
||||||
@@ -2962,7 +3089,7 @@ void Verilated::nullPointerError(const char* filename, int linenum) VL_MT_SAFE {
|
|||||||
|
|
||||||
void Verilated::overWidthError(const char* signame) VL_MT_SAFE {
|
void Verilated::overWidthError(const char* signame) VL_MT_SAFE {
|
||||||
// Slowpath - Called only when signal sets too high of a bit
|
// Slowpath - Called only when signal sets too high of a bit
|
||||||
const std::string msg = (std::string{"Testbench C set input '"} + signame
|
const std::string msg = ("Testbench C set input '"s + signame
|
||||||
+ "' to value that overflows what the signal's width can fit");
|
+ "' to value that overflows what the signal's width can fit");
|
||||||
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
||||||
VL_UNREACHABLE;
|
VL_UNREACHABLE;
|
||||||
@@ -2988,6 +3115,29 @@ void Verilated::scTraceBeforeElaborationError() VL_MT_SAFE {
|
|||||||
VL_UNREACHABLE;
|
VL_UNREACHABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Verilated::stackCheck(QData needSize) VL_MT_UNSAFE {
|
||||||
|
// Slowpath - Called only when constructing
|
||||||
|
#ifdef _VL_HAVE_GETRLIMIT
|
||||||
|
QData haveSize = 0;
|
||||||
|
rlimit rlim;
|
||||||
|
if (0 == getrlimit(RLIMIT_STACK, &rlim)) {
|
||||||
|
haveSize = rlim.rlim_cur;
|
||||||
|
if (haveSize == RLIM_INFINITY) haveSize = rlim.rlim_max;
|
||||||
|
if (haveSize == RLIM_INFINITY) haveSize = 0;
|
||||||
|
}
|
||||||
|
// VL_PRINTF_MT("-Info: stackCheck(%" PRIu64 ") have %" PRIu64 "\n", needSize, haveSize);
|
||||||
|
// Check for 1.5x need, but suggest 2x so small model increase won't cause warning
|
||||||
|
// if the user follows the suggestions
|
||||||
|
if (VL_UNLIKELY(haveSize && needSize && haveSize < (needSize + needSize / 2))) {
|
||||||
|
VL_PRINTF_MT("%%Warning: System has stack size %" PRIu64 " kb"
|
||||||
|
" which may be too small; suggest 'ulimit -s %" PRIu64 "' or larger\n",
|
||||||
|
haveSize / 1024, (needSize * 2) / 1024);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
(void)needSize; // Unused argument
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void Verilated::mkdir(const char* dirname) VL_MT_UNSAFE {
|
void Verilated::mkdir(const char* dirname) VL_MT_UNSAFE {
|
||||||
#if defined(_WIN32) || defined(__MINGW32__)
|
#if defined(_WIN32) || defined(__MINGW32__)
|
||||||
::mkdir(dirname);
|
::mkdir(dirname);
|
||||||
@@ -3016,6 +3166,7 @@ void Verilated::endOfEval(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE {
|
|||||||
// It should be ok to call into endOfEvalGuts, it returns immediately
|
// It should be ok to call into endOfEvalGuts, it returns immediately
|
||||||
// if there are no transactions.
|
// if there are no transactions.
|
||||||
VL_DEBUG_IF(VL_DBG_MSGF("End-of-eval cleanup\n"););
|
VL_DEBUG_IF(VL_DBG_MSGF("End-of-eval cleanup\n"););
|
||||||
|
VerilatedThreadMsgQueue::flush(evalMsgQp);
|
||||||
evalMsgQp->process();
|
evalMsgQp->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3160,8 +3311,7 @@ void VerilatedScope::varInsert(int finalize, const char* namep, void* datap, boo
|
|||||||
} else {
|
} else {
|
||||||
// We could have a linked list of ranges, but really this whole thing needs
|
// We could have a linked list of ranges, but really this whole thing needs
|
||||||
// to be generalized to support structs and unions, etc.
|
// to be generalized to support structs and unions, etc.
|
||||||
const std::string msg
|
const std::string msg = "Unsupported multi-dimensional public varInsert: "s + namep;
|
||||||
= std::string{"Unsupported multi-dimensional public varInsert: "} + namep;
|
|
||||||
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3181,10 +3331,9 @@ VerilatedVar* VerilatedScope::varFind(const char* namep) const VL_MT_SAFE_POSTIN
|
|||||||
|
|
||||||
void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
|
void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
|
||||||
// Slowpath - Called only when find has failed
|
// Slowpath - Called only when find has failed
|
||||||
const std::string msg
|
const std::string msg = ("Testbench C called '"s + VerilatedImp::exportName(funcnum)
|
||||||
= (std::string{"Testbench C called '"} + VerilatedImp::exportName(funcnum)
|
+ "' but scope wasn't set, perhaps due to dpi import call without "
|
||||||
+ "' but scope wasn't set, perhaps due to dpi import call without "
|
+ "'context', or missing svSetScope. See IEEE 1800-2023 35.5.3.");
|
||||||
+ "'context', or missing svSetScope. See IEEE 1800-2017 35.5.3.");
|
|
||||||
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -3192,7 +3341,7 @@ void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
|
|||||||
void* VerilatedScope::exportFindError(int funcnum) const VL_MT_SAFE {
|
void* VerilatedScope::exportFindError(int funcnum) const VL_MT_SAFE {
|
||||||
// Slowpath - Called only when find has failed
|
// Slowpath - Called only when find has failed
|
||||||
const std::string msg
|
const std::string msg
|
||||||
= (std::string{"Testbench C called '"} + VerilatedImp::exportName(funcnum)
|
= ("Testbench C called '"s + VerilatedImp::exportName(funcnum)
|
||||||
+ "' but this DPI export function exists only in other scopes, not scope '" + name()
|
+ "' but this DPI export function exists only in other scopes, not scope '" + name()
|
||||||
+ "'");
|
+ "'");
|
||||||
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
||||||
@@ -3240,13 +3389,17 @@ void VlDeleter::deleteAll() VL_EXCLUDES(m_mutex) VL_EXCLUDES(m_deleteMutex) VL_M
|
|||||||
VerilatedLockGuard lock{m_mutex};
|
VerilatedLockGuard lock{m_mutex};
|
||||||
if (m_newGarbage.empty()) break;
|
if (m_newGarbage.empty()) break;
|
||||||
m_deleteMutex.lock();
|
m_deleteMutex.lock();
|
||||||
std::swap(m_newGarbage, m_toDelete);
|
std::swap(m_newGarbage, m_deleteNow);
|
||||||
// m_mutex is unlocked here, so destructors can enqueue new objects
|
// m_mutex is unlocked here, so destructors can enqueue new objects
|
||||||
}
|
}
|
||||||
for (VlDeletable* const objp : m_toDelete) delete objp;
|
for (VlDeletable* const objp : m_deleteNow) delete objp;
|
||||||
m_toDelete.clear();
|
m_deleteNow.clear();
|
||||||
m_deleteMutex.unlock();
|
m_deleteMutex.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
// OS functions (last, so we have minimal OS dependencies above)
|
||||||
|
|
||||||
|
#define VL_ALLOW_VERILATEDOS_C
|
||||||
|
#include "verilatedos_c.h"
|
||||||
|
|||||||
+54
-9
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Code available from: https://verilator.org
|
// Code available from: https://verilator.org
|
||||||
//
|
//
|
||||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2024 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
@@ -73,6 +73,8 @@
|
|||||||
#endif
|
#endif
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
using namespace std::literals; // "<std::string literal>"s; see SF.7 core guideline
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// Switches
|
// Switches
|
||||||
|
|
||||||
@@ -99,6 +101,7 @@ class VerilatedScope;
|
|||||||
class VerilatedScopeNameMap;
|
class VerilatedScopeNameMap;
|
||||||
template <class, class>
|
template <class, class>
|
||||||
class VerilatedTrace;
|
class VerilatedTrace;
|
||||||
|
class VerilatedTraceBaseC;
|
||||||
class VerilatedTraceConfig;
|
class VerilatedTraceConfig;
|
||||||
class VerilatedVar;
|
class VerilatedVar;
|
||||||
class VerilatedVarNameMap;
|
class VerilatedVarNameMap;
|
||||||
@@ -133,7 +136,8 @@ enum VerilatedVarType : uint8_t {
|
|||||||
VLVT_UINT32, // AKA IData
|
VLVT_UINT32, // AKA IData
|
||||||
VLVT_UINT64, // AKA QData
|
VLVT_UINT64, // AKA QData
|
||||||
VLVT_WDATA, // AKA WData
|
VLVT_WDATA, // AKA WData
|
||||||
VLVT_STRING // C++ string
|
VLVT_STRING, // C++ string
|
||||||
|
VLVT_REAL // AKA double
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VerilatedVarFlags {
|
enum VerilatedVarFlags {
|
||||||
@@ -164,7 +168,9 @@ inline constexpr size_t roundUpToMultipleOf(size_t value) {
|
|||||||
// Return current thread ID (or 0), not super fast, cache if needed
|
// Return current thread ID (or 0), not super fast, cache if needed
|
||||||
extern uint32_t VL_THREAD_ID() VL_MT_SAFE;
|
extern uint32_t VL_THREAD_ID() VL_MT_SAFE;
|
||||||
|
|
||||||
|
#ifndef VL_LOCK_SPINS
|
||||||
#define VL_LOCK_SPINS 50000 /// Number of times to spin for a mutex before yielding
|
#define VL_LOCK_SPINS 50000 /// Number of times to spin for a mutex before yielding
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Mutex, wrapped to allow -fthread_safety checks
|
/// Mutex, wrapped to allow -fthread_safety checks
|
||||||
class VL_CAPABILITY("mutex") VerilatedMutex final {
|
class VL_CAPABILITY("mutex") VerilatedMutex final {
|
||||||
@@ -342,20 +348,25 @@ class VerilatedContext VL_NOT_FINAL {
|
|||||||
friend class VerilatedContextImp;
|
friend class VerilatedContextImp;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// TYPES
|
||||||
|
using traceBaseModelCb_t
|
||||||
|
= std::function<void(VerilatedTraceBaseC*, int, int)>; // Type of traceBaseModel callbacks
|
||||||
|
|
||||||
// MEMBERS
|
// MEMBERS
|
||||||
// Slow path variables
|
// Slow path variables
|
||||||
mutable VerilatedMutex m_mutex; // Mutex for most s_s/s_ns members
|
mutable VerilatedMutex m_mutex; // Mutex for most s_s/s_ns members
|
||||||
|
|
||||||
struct Serialized { // All these members serialized/deserialized
|
struct Serialized final { // All these members serialized/deserialized
|
||||||
// No std::strings or pointers or will serialize badly!
|
// No std::strings or pointers or will serialize badly!
|
||||||
// Fast path
|
// Fast path
|
||||||
|
uint64_t m_time = 0; // Current $time (unscaled), 0=at zero, or legacy
|
||||||
bool m_assertOn = true; // Assertions are enabled
|
bool m_assertOn = true; // Assertions are enabled
|
||||||
bool m_calcUnusedSigs = false; // Waves file on, need all signals calculated
|
bool m_calcUnusedSigs = false; // Waves file on, need all signals calculated
|
||||||
bool m_fatalOnError = true; // Fatal on $stop/non-fatal error
|
bool m_fatalOnError = true; // Fatal on $stop/non-fatal error
|
||||||
bool m_fatalOnVpiError = true; // Fatal on vpi error/unsupported
|
bool m_fatalOnVpiError = true; // Fatal on vpi error/unsupported
|
||||||
bool m_gotError = false; // A $finish statement executed
|
bool m_gotError = false; // A $finish statement executed
|
||||||
bool m_gotFinish = false; // A $finish or $stop statement executed
|
bool m_gotFinish = false; // A $finish or $stop statement executed
|
||||||
uint64_t m_time = 0; // Current $time (unscaled), 0=at zero, or legacy
|
bool m_quiet = false; // Quiet, no summary report
|
||||||
// Slow path
|
// Slow path
|
||||||
int8_t m_timeunit; // Time unit as 0..15
|
int8_t m_timeunit; // Time unit as 0..15
|
||||||
int8_t m_timeprecision; // Time precision as 0..15
|
int8_t m_timeprecision; // Time precision as 0..15
|
||||||
@@ -376,20 +387,24 @@ protected:
|
|||||||
std::string m_timeFormatSuffix VL_GUARDED_BY(m_timeDumpMutex); // $timeformat printf format
|
std::string m_timeFormatSuffix VL_GUARDED_BY(m_timeDumpMutex); // $timeformat printf format
|
||||||
std::string m_dumpfile VL_GUARDED_BY(m_timeDumpMutex); // $dumpfile setting
|
std::string m_dumpfile VL_GUARDED_BY(m_timeDumpMutex); // $dumpfile setting
|
||||||
|
|
||||||
struct NonSerialized { // Non-serialized information
|
struct NonSerialized final { // Non-serialized information
|
||||||
// These are reloaded from on command-line settings, so do not need to persist
|
// These are reloaded from on command-line settings, so do not need to persist
|
||||||
// Fast path
|
// Fast path
|
||||||
uint64_t m_profExecStart = 1; // +prof+exec+start time
|
uint64_t m_profExecStart = 1; // +prof+exec+start time
|
||||||
uint32_t m_profExecWindow = 2; // +prof+exec+window size
|
uint32_t m_profExecWindow = 2; // +prof+exec+window size
|
||||||
// Slow path
|
// Slow path
|
||||||
|
std::string m_coverageFilename; // +coverage+file filename
|
||||||
std::string m_profExecFilename; // +prof+exec+file filename
|
std::string m_profExecFilename; // +prof+exec+file filename
|
||||||
std::string m_profVltFilename; // +prof+vlt filename
|
std::string m_profVltFilename; // +prof+vlt filename
|
||||||
|
VlOs::DeltaCpuTime m_cpuTimeStart{false}; // CPU time, starts when create first model
|
||||||
|
VlOs::DeltaWallTime m_wallTimeStart{false}; // Wall time, starts when create first model
|
||||||
|
std::vector<traceBaseModelCb_t> m_traceBaseModelCbs; // Callbacks to traceRegisterModel
|
||||||
} m_ns;
|
} m_ns;
|
||||||
|
|
||||||
mutable VerilatedMutex m_argMutex; // Protect m_argVec, m_argVecLoaded
|
mutable VerilatedMutex m_argMutex; // Protect m_argVec, m_argVecLoaded
|
||||||
// no need to be save-restored (serialized) the
|
// no need to be save-restored (serialized) the
|
||||||
// assumption is that the restore is allowed to pass different arguments
|
// assumption is that the restore is allowed to pass different arguments
|
||||||
struct NonSerializedCommandArgs {
|
struct NonSerializedCommandArgs final {
|
||||||
// Medium speed
|
// Medium speed
|
||||||
std::vector<std::string> m_argVec; // Argument list
|
std::vector<std::string> m_argVec; // Argument list
|
||||||
bool m_argVecLoaded = false; // Ever loaded argument list
|
bool m_argVecLoaded = false; // Ever loaded argument list
|
||||||
@@ -399,6 +414,8 @@ protected:
|
|||||||
const std::unique_ptr<VerilatedContextImpData> m_impdatap;
|
const std::unique_ptr<VerilatedContextImpData> m_impdatap;
|
||||||
// Number of threads to use for simulation (size of m_threadPool + 1 for main thread)
|
// Number of threads to use for simulation (size of m_threadPool + 1 for main thread)
|
||||||
unsigned m_threads = std::thread::hardware_concurrency();
|
unsigned m_threads = std::thread::hardware_concurrency();
|
||||||
|
// Number of threads in added models
|
||||||
|
unsigned m_threadsInModels = 0;
|
||||||
// The thread pool shared by all models added to this context
|
// The thread pool shared by all models added to this context
|
||||||
std::unique_ptr<VerilatedVirtualBase> m_threadPool;
|
std::unique_ptr<VerilatedVirtualBase> m_threadPool;
|
||||||
// The execution profiler shared by all models added to this context
|
// The execution profiler shared by all models added to this context
|
||||||
@@ -483,6 +500,10 @@ public:
|
|||||||
void gotFinish(bool flag) VL_MT_SAFE;
|
void gotFinish(bool flag) VL_MT_SAFE;
|
||||||
/// Return if got a $finish or $stop/error
|
/// Return if got a $finish or $stop/error
|
||||||
bool gotFinish() const VL_MT_SAFE { return m_s.m_gotFinish; }
|
bool gotFinish() const VL_MT_SAFE { return m_s.m_gotFinish; }
|
||||||
|
/// Enable quiet (also prevents need for OS calls to get CPU time)
|
||||||
|
void quiet(bool flag) VL_MT_SAFE;
|
||||||
|
/// Return if quiet enabled
|
||||||
|
bool quiet() const VL_MT_SAFE { return m_s.m_quiet; }
|
||||||
/// Select initial value of otherwise uninitialized signals.
|
/// Select initial value of otherwise uninitialized signals.
|
||||||
/// 0 = Set to zeros
|
/// 0 = Set to zeros
|
||||||
/// 1 = Set all bits to one
|
/// 1 = Set all bits to one
|
||||||
@@ -495,6 +516,13 @@ public:
|
|||||||
/// Set default random seed, 0 = seed it automatically
|
/// Set default random seed, 0 = seed it automatically
|
||||||
int randSeed() const VL_MT_SAFE { return m_s.m_randSeed; }
|
int randSeed() const VL_MT_SAFE { return m_s.m_randSeed; }
|
||||||
|
|
||||||
|
/// Return statistic: CPU time delta from model created until now
|
||||||
|
double statCpuTimeSinceStart() const VL_MT_SAFE_EXCLUDES(m_mutex);
|
||||||
|
/// Return statistic: Wall time delta from model created until now
|
||||||
|
double statWallTimeSinceStart() const VL_MT_SAFE_EXCLUDES(m_mutex);
|
||||||
|
/// Print statistics summary (if not quiet)
|
||||||
|
void statsPrintSummary() VL_MT_UNSAFE;
|
||||||
|
|
||||||
// Time handling
|
// Time handling
|
||||||
/// Returns current simulation time in units of timeprecision().
|
/// Returns current simulation time in units of timeprecision().
|
||||||
///
|
///
|
||||||
@@ -538,10 +566,14 @@ public:
|
|||||||
|
|
||||||
/// Get number of threads used for simulation (including the main thread)
|
/// Get number of threads used for simulation (including the main thread)
|
||||||
unsigned threads() const { return m_threads; }
|
unsigned threads() const { return m_threads; }
|
||||||
|
/// Get number of threads in added models (for statistical use only)
|
||||||
|
unsigned threadsInModels() const { return m_threadsInModels; }
|
||||||
/// Set number of threads used for simulation (including the main thread)
|
/// Set number of threads used for simulation (including the main thread)
|
||||||
/// Can only be called before the thread pool is created (before first model is added).
|
/// Can only be called before the thread pool is created (before first model is added).
|
||||||
void threads(unsigned n);
|
void threads(unsigned n);
|
||||||
|
|
||||||
|
/// Trace signals in models within the context; called by application code
|
||||||
|
void trace(VerilatedTraceBaseC* tfp, int levels, int options = 0);
|
||||||
/// Allow traces to at some point be enabled (disables some optimizations)
|
/// Allow traces to at some point be enabled (disables some optimizations)
|
||||||
void traceEverOn(bool flag) VL_MT_SAFE {
|
void traceEverOn(bool flag) VL_MT_SAFE {
|
||||||
if (flag) calcUnusedSigs(true);
|
if (flag) calcUnusedSigs(true);
|
||||||
@@ -565,12 +597,18 @@ public:
|
|||||||
return reinterpret_cast<const VerilatedContextImp*>(this);
|
return reinterpret_cast<const VerilatedContextImp*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Internal: Model and thread setup
|
||||||
void addModel(VerilatedModel*);
|
void addModel(VerilatedModel*);
|
||||||
|
|
||||||
VerilatedVirtualBase* threadPoolp();
|
VerilatedVirtualBase* threadPoolp();
|
||||||
|
void prepareClone();
|
||||||
|
VerilatedVirtualBase* threadPoolpOnClone();
|
||||||
VerilatedVirtualBase*
|
VerilatedVirtualBase*
|
||||||
enableExecutionProfiler(VerilatedVirtualBase* (*construct)(VerilatedContext&));
|
enableExecutionProfiler(VerilatedVirtualBase* (*construct)(VerilatedContext&));
|
||||||
|
|
||||||
|
// Internal: coverage
|
||||||
|
void coverageFilename(const std::string& flag) VL_MT_SAFE;
|
||||||
|
std::string coverageFilename() const VL_MT_SAFE;
|
||||||
|
|
||||||
// Internal: $dumpfile
|
// Internal: $dumpfile
|
||||||
void dumpfile(const std::string& flag) VL_MT_SAFE_EXCLUDES(m_timeDumpMutex);
|
void dumpfile(const std::string& flag) VL_MT_SAFE_EXCLUDES(m_timeDumpMutex);
|
||||||
std::string dumpfile() const VL_MT_SAFE_EXCLUDES(m_timeDumpMutex);
|
std::string dumpfile() const VL_MT_SAFE_EXCLUDES(m_timeDumpMutex);
|
||||||
@@ -594,6 +632,9 @@ public:
|
|||||||
static constexpr size_t serialized1Size() VL_PURE { return sizeof(m_s); }
|
static constexpr size_t serialized1Size() VL_PURE { return sizeof(m_s); }
|
||||||
void* serialized1Ptr() VL_MT_UNSAFE { return &m_s; }
|
void* serialized1Ptr() VL_MT_UNSAFE { return &m_s; }
|
||||||
|
|
||||||
|
// Internal: trace registration
|
||||||
|
void traceBaseModelCbAdd(traceBaseModelCb_t cb) VL_MT_SAFE;
|
||||||
|
|
||||||
// Internal: Check magic number
|
// Internal: Check magic number
|
||||||
static void checkMagic(const VerilatedContext* contextp);
|
static void checkMagic(const VerilatedContext* contextp);
|
||||||
void selfTestClearMagic() { m_magic = 0x2; }
|
void selfTestClearMagic() { m_magic = 0x2; }
|
||||||
@@ -622,8 +663,9 @@ class VerilatedScope final {
|
|||||||
public:
|
public:
|
||||||
enum Type : uint8_t {
|
enum Type : uint8_t {
|
||||||
SCOPE_MODULE,
|
SCOPE_MODULE,
|
||||||
SCOPE_OTHER
|
SCOPE_OTHER,
|
||||||
}; // Type of a scope, currently module is only interesting
|
SCOPE_PACKAGE
|
||||||
|
}; // Type of a scope, currently only module and package are interesting
|
||||||
private:
|
private:
|
||||||
// Fastpath:
|
// Fastpath:
|
||||||
VerilatedSyms* m_symsp = nullptr; // Symbol table
|
VerilatedSyms* m_symsp = nullptr; // Symbol table
|
||||||
@@ -892,6 +934,7 @@ public:
|
|||||||
static void overWidthError(const char* signame) VL_ATTR_NORETURN VL_MT_SAFE;
|
static void overWidthError(const char* signame) VL_ATTR_NORETURN VL_MT_SAFE;
|
||||||
static void scTimePrecisionError(int sc_prec, int vl_prec) VL_ATTR_NORETURN VL_MT_SAFE;
|
static void scTimePrecisionError(int sc_prec, int vl_prec) VL_ATTR_NORETURN VL_MT_SAFE;
|
||||||
static void scTraceBeforeElaborationError() VL_ATTR_NORETURN VL_MT_SAFE;
|
static void scTraceBeforeElaborationError() VL_ATTR_NORETURN VL_MT_SAFE;
|
||||||
|
static void stackCheck(QData needSize) VL_MT_UNSAFE;
|
||||||
|
|
||||||
// Internal: Get and set DPI context
|
// Internal: Get and set DPI context
|
||||||
static const VerilatedScope* dpiScope() VL_MT_SAFE { return t_s.t_dpiScopep; }
|
static const VerilatedScope* dpiScope() VL_MT_SAFE { return t_s.t_dpiScopep; }
|
||||||
@@ -917,6 +960,7 @@ public:
|
|||||||
|
|
||||||
// Internal: Called at end of each thread mtask, before finishing eval
|
// Internal: Called at end of each thread mtask, before finishing eval
|
||||||
static void endOfThreadMTask(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE {
|
static void endOfThreadMTask(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE {
|
||||||
|
mtaskId(0);
|
||||||
if (VL_UNLIKELY(t_s.t_endOfEvalReqd)) endOfThreadMTaskGuts(evalMsgQp);
|
if (VL_UNLIKELY(t_s.t_endOfEvalReqd)) endOfThreadMTaskGuts(evalMsgQp);
|
||||||
}
|
}
|
||||||
// Internal: Called at end of eval loop
|
// Internal: Called at end of eval loop
|
||||||
@@ -964,6 +1008,7 @@ void VerilatedContext::timeprecision(int value) VL_MT_SAFE {
|
|||||||
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_FS)) {
|
} else if (sc_res == sc_core::sc_time(1, sc_core::SC_FS)) {
|
||||||
sc_prec = 15;
|
sc_prec = 15;
|
||||||
}
|
}
|
||||||
|
// SC_AS, SC_ZS, SC_YS not supported as no Verilog equivalent; will error below
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if VM_SC
|
#if VM_SC
|
||||||
|
|||||||
+54
-19
@@ -2,13 +2,16 @@
|
|||||||
######################################################################
|
######################################################################
|
||||||
# DESCRIPTION: Makefile commands for all verilated target files
|
# DESCRIPTION: Makefile commands for all verilated target files
|
||||||
#
|
#
|
||||||
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
# Copyright 2003-2024 by Wilson Snyder. This program is free software; you
|
||||||
# can redistribute it and/or modify it under the terms of either the GNU
|
# 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
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
# Tool names.
|
||||||
|
# These are computed at configuration time, and most are not ?=
|
||||||
|
# to avoid picking up potentially incorrect Make implicit variables
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
CXX = @CXX@
|
CXX = @CXX@
|
||||||
LINK = @CXX@
|
LINK = @CXX@
|
||||||
@@ -16,6 +19,7 @@ OBJCACHE ?= @OBJCACHE@
|
|||||||
PERL = @PERL@
|
PERL = @PERL@
|
||||||
PYTHON3 = @PYTHON3@
|
PYTHON3 = @PYTHON3@
|
||||||
|
|
||||||
|
# Configuration time options
|
||||||
CFG_WITH_CCWARN = @CFG_WITH_CCWARN@
|
CFG_WITH_CCWARN = @CFG_WITH_CCWARN@
|
||||||
CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
|
CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
|
||||||
|
|
||||||
@@ -31,6 +35,12 @@ CFG_CXXFLAGS_NO_UNUSED = @CFG_CXXFLAGS_NO_UNUSED@
|
|||||||
CFG_CXXFLAGS_WEXTRA = @CFG_CXXFLAGS_WEXTRA@
|
CFG_CXXFLAGS_WEXTRA = @CFG_CXXFLAGS_WEXTRA@
|
||||||
# Compiler flags that enable coroutine support
|
# Compiler flags that enable coroutine support
|
||||||
CFG_CXXFLAGS_COROUTINES = @CFG_CXXFLAGS_COROUTINES@
|
CFG_CXXFLAGS_COROUTINES = @CFG_CXXFLAGS_COROUTINES@
|
||||||
|
# Compiler flags when creating a precompiled header
|
||||||
|
CFG_CXXFLAGS_PCH = -x c++-header
|
||||||
|
# Compiler option to put in front of filename to read precompiled header
|
||||||
|
CFG_CXXFLAGS_PCH_I = @CFG_CXXFLAGS_PCH_I@
|
||||||
|
# Compiler's filename prefix for precompiled headers, .gch if clang, empty if GCC
|
||||||
|
CFG_GCH_IF_CLANG = @CFG_GCH_IF_CLANG@
|
||||||
# Linker flags
|
# Linker flags
|
||||||
CFG_LDFLAGS_VERILATED = @CFG_LDFLAGS_VERILATED@
|
CFG_LDFLAGS_VERILATED = @CFG_LDFLAGS_VERILATED@
|
||||||
# Linker libraries for multithreading
|
# Linker libraries for multithreading
|
||||||
@@ -43,6 +53,12 @@ VERILATOR_COVERAGE = $(PERL) $(VERILATOR_ROOT)/bin/verilator_coverage
|
|||||||
VERILATOR_INCLUDER = $(PYTHON3) $(VERILATOR_ROOT)/bin/verilator_includer
|
VERILATOR_INCLUDER = $(PYTHON3) $(VERILATOR_ROOT)/bin/verilator_includer
|
||||||
VERILATOR_CCACHE_REPORT = $(PYTHON3) $(VERILATOR_ROOT)/bin/verilator_ccache_report
|
VERILATOR_CCACHE_REPORT = $(PYTHON3) $(VERILATOR_ROOT)/bin/verilator_ccache_report
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# CCACHE flags (via environment as no command line option available)
|
||||||
|
|
||||||
|
CCACHE_SLOPPINESS ?= pch_defines,time_macros
|
||||||
|
export CCACHE_SLOPPINESS
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Make checks
|
# Make checks
|
||||||
|
|
||||||
@@ -85,9 +101,6 @@ LDFLAGS += $(CFG_LDFLAGS_VERILATED)
|
|||||||
#OPT = -ggdb -DPRINTINITSTR
|
#OPT = -ggdb -DPRINTINITSTR
|
||||||
CPPFLAGS += $(OPT)
|
CPPFLAGS += $(OPT)
|
||||||
|
|
||||||
CPPFLAGS += $(M32)
|
|
||||||
LDFLAGS += $(M32)
|
|
||||||
|
|
||||||
# On macOS, specify all weak symbols as dynamic_lookup.
|
# On macOS, specify all weak symbols as dynamic_lookup.
|
||||||
# Otherwise, you get undefined symbol errors.
|
# Otherwise, you get undefined symbol errors.
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
@@ -138,7 +151,7 @@ ifeq ($(VM_SC),1)
|
|||||||
LDFLAGS += $(SYSTEMC_CXX_FLAGS) $(addprefix -L, $(SYSTEMC_LIBDIR))
|
LDFLAGS += $(SYSTEMC_CXX_FLAGS) $(addprefix -L, $(SYSTEMC_LIBDIR))
|
||||||
SC_LIBS = -lsystemc
|
SC_LIBS = -lsystemc
|
||||||
ifneq ($(wildcard $(SYSTEMC_LIBDIR)/*numeric_bit*),)
|
ifneq ($(wildcard $(SYSTEMC_LIBDIR)/*numeric_bit*),)
|
||||||
# Systemc 1.2.1beta
|
# SystemC 1.2.1beta
|
||||||
SC_LIBS += -lnumeric_bit -lqt
|
SC_LIBS += -lnumeric_bit -lqt
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -162,11 +175,17 @@ endif
|
|||||||
VM_FAST += $(VM_CLASSES_FAST) $(VM_SUPPORT_FAST)
|
VM_FAST += $(VM_CLASSES_FAST) $(VM_SUPPORT_FAST)
|
||||||
VM_SLOW += $(VM_CLASSES_SLOW) $(VM_SUPPORT_SLOW)
|
VM_SLOW += $(VM_CLASSES_SLOW) $(VM_SUPPORT_SLOW)
|
||||||
|
|
||||||
|
# Precompiled header filename
|
||||||
|
VK_PCH_H = $(VM_PREFIX)__pch.h
|
||||||
|
# Compiler read-a-precompiled-header option for precompiled header filename
|
||||||
|
VK_PCH_I_FAST = $(CFG_CXXFLAGS_PCH_I) $(VM_PREFIX)__pch.h.fast$(CFG_GCH_IF_CLANG)
|
||||||
|
VK_PCH_I_SLOW = $(CFG_CXXFLAGS_PCH_I) $(VM_PREFIX)__pch.h.slow$(CFG_GCH_IF_CLANG)
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
### Overall Objects Linking
|
### Overall Objects Linking
|
||||||
|
|
||||||
VK_FAST_OBJS = $(addsuffix .o, $(VM_FAST))
|
VK_OBJS_FAST = $(addsuffix .o, $(VM_FAST))
|
||||||
VK_SLOW_OBJS = $(addsuffix .o, $(VM_SLOW))
|
VK_OBJS_SLOW = $(addsuffix .o, $(VM_SLOW))
|
||||||
|
|
||||||
VK_USER_OBJS = $(addsuffix .o, $(VM_USER_CLASSES))
|
VK_USER_OBJS = $(addsuffix .o, $(VM_USER_CLASSES))
|
||||||
|
|
||||||
@@ -193,7 +212,7 @@ else
|
|||||||
# Parallel build: Each .cpp file by itself. This can be somewhat slower for
|
# Parallel build: Each .cpp file by itself. This can be somewhat slower for
|
||||||
# very small designs and examples, but is a lot faster for large designs.
|
# very small designs and examples, but is a lot faster for large designs.
|
||||||
|
|
||||||
VK_OBJS += $(VK_FAST_OBJS) $(VK_SLOW_OBJS)
|
VK_OBJS += $(VK_OBJS_FAST) $(VK_OBJS_SLOW)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# When archiving just objects (.o), use single $(AR) run
|
# When archiving just objects (.o), use single $(AR) run
|
||||||
@@ -237,18 +256,32 @@ $(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS)
|
|||||||
### Compile rules
|
### Compile rules
|
||||||
|
|
||||||
ifneq ($(VM_DEFAULT_RULES),0)
|
ifneq ($(VM_DEFAULT_RULES),0)
|
||||||
# Anything not in $(VK_SLOW_OBJS) or $(VK_GLOBAL_OBJS), including verilated.o
|
# Compilation rule for anything not in $(VK_OBJS_FAST), $(VK_OBJS_SLOW), or
|
||||||
# and user files passed on the Verilator command line use this rule.
|
# $(VK_GLOBAL_OBJS) including verilated.o. This typically means user files
|
||||||
# We put OPT_FAST/OPT_SLOW/OPT_GLOBAL before the other flags to
|
# passed on the Verilator command line.
|
||||||
|
#
|
||||||
|
# These rules put OPT_FAST/OPT_SLOW/OPT_GLOBAL before the other flags to
|
||||||
# allow USER_CPPFLAGS to override them
|
# allow USER_CPPFLAGS to override them
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
$(VK_SLOW_OBJS): %.o: %.cpp
|
$(VK_OBJS_FAST): %.o: %.cpp $(VK_PCH_H).fast.gch
|
||||||
$(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) $(VK_PCH_I_FAST) -c -o $@ $<
|
||||||
|
|
||||||
|
$(VK_OBJS_SLOW): %.o: %.cpp $(VK_PCH_H).slow.gch
|
||||||
|
$(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) $(VK_PCH_I_SLOW) -c -o $@ $<
|
||||||
|
|
||||||
$(VK_GLOBAL_OBJS): %.o: %.cpp
|
$(VK_GLOBAL_OBJS): %.o: %.cpp
|
||||||
$(OBJCACHE) $(CXX) $(OPT_GLOBAL) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
$(OBJCACHE) $(CXX) $(OPT_GLOBAL) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
# Precompile a header file
|
||||||
|
# PCH's compiler flags must match exactly the rules' above FAST/SLOW
|
||||||
|
# arguments used for the .cpp files, or the PCH file won't be used.
|
||||||
|
%.fast.gch: %
|
||||||
|
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) $(CFG_CXXFLAGS_PCH) $< -o $@
|
||||||
|
%.slow.gch: %
|
||||||
|
$(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) $(CFG_CXXFLAGS_PCH) $< -o $@
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#Default rule embedded in make:
|
#Default rule embedded in make:
|
||||||
@@ -296,19 +329,21 @@ endif
|
|||||||
|
|
||||||
debug-make::
|
debug-make::
|
||||||
@echo
|
@echo
|
||||||
@echo CXXFLAGS: $(CXXFLAGS)
|
|
||||||
@echo CPPFLAGS: $(CPPFLAGS)
|
@echo CPPFLAGS: $(CPPFLAGS)
|
||||||
|
@echo CXXFLAGS: $(CXXFLAGS)
|
||||||
@echo OPT_FAST: $(OPT_FAST)
|
@echo OPT_FAST: $(OPT_FAST)
|
||||||
@echo OPT_SLOW: $(OPT_SLOW)
|
@echo OPT_SLOW: $(OPT_SLOW)
|
||||||
@echo VM_PREFIX: $(VM_PREFIX)
|
@echo VK_OBJS: $(VK_OBJS)
|
||||||
@echo VM_PARALLEL_BUILDS: $(VM_PARALLEL_BUILDS)
|
@echo VK_OBJS_FAST: $(VK_OBJS_FAST)
|
||||||
|
@echo VK_OBJS_SLOW: $(VK_OBJS_SLOW)
|
||||||
@echo VM_CLASSES_FAST: $(VM_CLASSES_FAST)
|
@echo VM_CLASSES_FAST: $(VM_CLASSES_FAST)
|
||||||
@echo VM_CLASSES_SLOW: $(VM_CLASSES_SLOW)
|
@echo VM_CLASSES_SLOW: $(VM_CLASSES_SLOW)
|
||||||
@echo VM_SUPPORT_FAST: $(VM_SUPPORT_FAST)
|
|
||||||
@echo VM_SUPPORT_SLOW: $(VM_SUPPORT_SLOW)
|
|
||||||
@echo VM_GLOBAL_FAST: $(VM_GLOBAL_FAST)
|
@echo VM_GLOBAL_FAST: $(VM_GLOBAL_FAST)
|
||||||
@echo VM_GLOBAL_SLOW: $(VM_GLOBAL_SLOW)
|
@echo VM_GLOBAL_SLOW: $(VM_GLOBAL_SLOW)
|
||||||
@echo VK_OBJS: $(VK_OBJS)
|
@echo VM_PARALLEL_BUILDS: $(VM_PARALLEL_BUILDS)
|
||||||
|
@echo VM_PREFIX: $(VM_PREFIX)
|
||||||
|
@echo VM_SUPPORT_FAST: $(VM_SUPPORT_FAST)
|
||||||
|
@echo VM_SUPPORT_SLOW: $(VM_SUPPORT_SLOW)
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Code available from: https://verilator.org
|
// Code available from: https://verilator.org
|
||||||
//
|
//
|
||||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2024 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Code available from: https://verilator.org
|
// Code available from: https://verilator.org
|
||||||
//
|
//
|
||||||
// Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
|
// Copyright 2003-2024 by Wilson Snyder. This program is free software; you can
|
||||||
// redistribute it and/or modify it under the terms of either the GNU
|
// redistribute it and/or modify it under the terms of either the GNU
|
||||||
// Lesser General Public License Version 3 or the Perl Artistic License
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
|
|||||||
+20
-14
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Code available from: https://verilator.org
|
// Code available from: https://verilator.org
|
||||||
//
|
//
|
||||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
// Copyright 2001-2024 by Wilson Snyder. This program is free software; you
|
||||||
// can redistribute it and/or modify it under the terms of either the GNU
|
// 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
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
@@ -106,6 +106,7 @@ private:
|
|||||||
using ItemList = std::deque<VerilatedCovImpItem*>;
|
using ItemList = std::deque<VerilatedCovImpItem*>;
|
||||||
|
|
||||||
// MEMBERS
|
// MEMBERS
|
||||||
|
VerilatedContext* const m_contextp; // Context VerilatedCovImp is pointed-to by
|
||||||
mutable VerilatedMutex m_mutex; // Protects all members
|
mutable VerilatedMutex m_mutex; // Protects all members
|
||||||
ValueIndexMap m_valueIndexes VL_GUARDED_BY(m_mutex); // Unique arbitrary value for values
|
ValueIndexMap m_valueIndexes VL_GUARDED_BY(m_mutex); // Unique arbitrary value for values
|
||||||
IndexValueMap m_indexValues VL_GUARDED_BY(m_mutex); // Unique arbitrary value for keys
|
IndexValueMap m_indexValues VL_GUARDED_BY(m_mutex); // Unique arbitrary value for keys
|
||||||
@@ -120,7 +121,8 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
VerilatedCovImp() = default;
|
explicit VerilatedCovImp(VerilatedContext* contextp)
|
||||||
|
: m_contextp{contextp} {}
|
||||||
VL_UNCOPYABLE(VerilatedCovImp);
|
VL_UNCOPYABLE(VerilatedCovImp);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -166,11 +168,11 @@ private:
|
|||||||
const std::string& value) VL_PURE {
|
const std::string& value) VL_PURE {
|
||||||
std::string name;
|
std::string name;
|
||||||
if (key.length() == 1 && std::isalpha(key[0])) {
|
if (key.length() == 1 && std::isalpha(key[0])) {
|
||||||
name += std::string{"\001"} + key;
|
name += "\001"s + key;
|
||||||
} else {
|
} else {
|
||||||
name += std::string{"\001"} + dequote(key);
|
name += "\001"s + dequote(key);
|
||||||
}
|
}
|
||||||
name += std::string{"\002"} + dequote(value);
|
name += "\002"s + dequote(value);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
static std::string combineHier(const std::string& old, const std::string& add) VL_PURE {
|
static std::string combineHier(const std::string& old, const std::string& add) VL_PURE {
|
||||||
@@ -211,7 +213,7 @@ private:
|
|||||||
std::string result = prefix + "*" + suffix;
|
std::string result = prefix + "*" + suffix;
|
||||||
|
|
||||||
// std::cout << "\nch pre=" << prefix << " s=" << suffix << "\nch a="
|
// std::cout << "\nch pre=" << prefix << " s=" << suffix << "\nch a="
|
||||||
// << old << "\nch b=" << add << "\ncho=" << result << std::endl;
|
// << old << "\nch b=" << add << "\ncho=" << result << "\n";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
bool itemMatchesString(VerilatedCovImpItem* itemp, const std::string& match)
|
bool itemMatchesString(VerilatedCovImpItem* itemp, const std::string& match)
|
||||||
@@ -253,6 +255,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// PUBLIC METHODS
|
// PUBLIC METHODS
|
||||||
|
std::string defaultFilename() VL_MT_SAFE { return m_contextp->coverageFilename(); }
|
||||||
void forcePerInstance(const bool flag) VL_MT_SAFE_EXCLUDES(m_mutex) {
|
void forcePerInstance(const bool flag) VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
Verilated::quiesce();
|
Verilated::quiesce();
|
||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
@@ -302,7 +305,7 @@ public:
|
|||||||
// First two key/vals are filename
|
// First two key/vals are filename
|
||||||
ckeyps[0] = "filename";
|
ckeyps[0] = "filename";
|
||||||
valps[0] = m_insertFilenamep;
|
valps[0] = m_insertFilenamep;
|
||||||
const std::string linestr = vlCovCvtToStr(m_insertLineno);
|
const std::string linestr = std::to_string(m_insertLineno);
|
||||||
ckeyps[1] = "lineno";
|
ckeyps[1] = "lineno";
|
||||||
valps[1] = linestr.c_str();
|
valps[1] = linestr.c_str();
|
||||||
// Default page if not specified
|
// Default page if not specified
|
||||||
@@ -337,7 +340,7 @@ public:
|
|||||||
const std::string key = keys[i];
|
const std::string key = keys[i];
|
||||||
if (!keys[i].empty()) {
|
if (!keys[i].empty()) {
|
||||||
const std::string val = valps[i];
|
const std::string val = valps[i];
|
||||||
// std::cout << " " << __FUNCTION__ << " " << key << " = " << val << std::endl;
|
// std::cout << " " << __FUNCTION__ << " " << key << " = " << val << "\n";
|
||||||
m_insertp->m_keys[addKeynum] = valueIndex(key);
|
m_insertp->m_keys[addKeynum] = valueIndex(key);
|
||||||
m_insertp->m_vals[addKeynum] = valueIndex(val);
|
m_insertp->m_vals[addKeynum] = valueIndex(val);
|
||||||
++addKeynum;
|
++addKeynum;
|
||||||
@@ -354,14 +357,14 @@ public:
|
|||||||
m_insertp = nullptr;
|
m_insertp = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const char* filename) VL_MT_SAFE_EXCLUDES(m_mutex) {
|
void write(const std::string& filename) VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
Verilated::quiesce();
|
Verilated::quiesce();
|
||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
selftest();
|
selftest();
|
||||||
|
|
||||||
std::ofstream os{filename};
|
std::ofstream os{filename};
|
||||||
if (os.fail()) {
|
if (os.fail()) {
|
||||||
const std::string msg = std::string{"%Error: Can't write '"} + filename + "'";
|
const std::string msg = "%Error: Can't write '"s + filename + "'";
|
||||||
VL_FATAL_MT("", 0, "", msg.c_str());
|
VL_FATAL_MT("", 0, "", msg.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -426,6 +429,7 @@ public:
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
// VerilatedCovContext
|
// VerilatedCovContext
|
||||||
|
|
||||||
|
std::string VerilatedCovContext::defaultFilename() VL_MT_SAFE { return impp()->defaultFilename(); }
|
||||||
void VerilatedCovContext::forcePerInstance(bool flag) VL_MT_SAFE {
|
void VerilatedCovContext::forcePerInstance(bool flag) VL_MT_SAFE {
|
||||||
impp()->forcePerInstance(flag);
|
impp()->forcePerInstance(flag);
|
||||||
}
|
}
|
||||||
@@ -434,7 +438,9 @@ void VerilatedCovContext::clearNonMatch(const char* matchp) VL_MT_SAFE {
|
|||||||
impp()->clearNonMatch(matchp);
|
impp()->clearNonMatch(matchp);
|
||||||
}
|
}
|
||||||
void VerilatedCovContext::zero() VL_MT_SAFE { impp()->zero(); }
|
void VerilatedCovContext::zero() VL_MT_SAFE { impp()->zero(); }
|
||||||
void VerilatedCovContext::write(const char* filenamep) VL_MT_SAFE { impp()->write(filenamep); }
|
void VerilatedCovContext::write(const std::string& filename) VL_MT_SAFE {
|
||||||
|
impp()->write(filename);
|
||||||
|
}
|
||||||
void VerilatedCovContext::_inserti(uint32_t* itemp) VL_MT_SAFE {
|
void VerilatedCovContext::_inserti(uint32_t* itemp) VL_MT_SAFE {
|
||||||
impp()->inserti(new VerilatedCoverItemSpec<uint32_t>{itemp});
|
impp()->inserti(new VerilatedCoverItemSpec<uint32_t>{itemp});
|
||||||
}
|
}
|
||||||
@@ -484,8 +490,8 @@ void VerilatedCovContext::_insertp(A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7
|
|||||||
// Backward compatibility for Verilator
|
// Backward compatibility for Verilator
|
||||||
void VerilatedCovContext::_insertp(A(0), A(1), K(2), int val2, K(3), int val3, K(4),
|
void VerilatedCovContext::_insertp(A(0), A(1), K(2), int val2, K(3), int val3, K(4),
|
||||||
const std::string& val4, A(5), A(6), A(7)) VL_MT_SAFE {
|
const std::string& val4, A(5), A(6), A(7)) VL_MT_SAFE {
|
||||||
std::string val2str = vlCovCvtToStr(val2);
|
const std::string val2str = std::to_string(val2);
|
||||||
std::string val3str = vlCovCvtToStr(val3);
|
const std::string val3str = std::to_string(val3);
|
||||||
_insertp(C(0), C(1), key2, val2str.c_str(), key3, val3str.c_str(), key4, val4.c_str(), C(5),
|
_insertp(C(0), C(1), key2, val2str.c_str(), key3, val3str.c_str(), key4, val4.c_str(), C(5),
|
||||||
C(6), C(7), N(8), N(9), N(10), N(11), N(12), N(13), N(14), N(15), N(16), N(17), N(18),
|
C(6), C(7), N(8), N(9), N(10), N(11), N(12), N(13), N(14), N(15), N(16), N(17), N(18),
|
||||||
N(19), N(20), N(21), N(22), N(23), N(24), N(25), N(26), N(27), N(28), N(29));
|
N(19), N(20), N(21), N(22), N(23), N(24), N(25), N(26), N(27), N(28), N(29));
|
||||||
@@ -516,7 +522,7 @@ VerilatedCovContext* VerilatedContext::coveragep() VL_MT_SAFE {
|
|||||||
const VerilatedLockGuard lock{s_mutex};
|
const VerilatedLockGuard lock{s_mutex};
|
||||||
// cppcheck-suppress identicalInnerCondition
|
// cppcheck-suppress identicalInnerCondition
|
||||||
if (VL_LIKELY(!m_coveragep)) { // LCOV_EXCL_LINE // Not redundant, prevents race
|
if (VL_LIKELY(!m_coveragep)) { // LCOV_EXCL_LINE // Not redundant, prevents race
|
||||||
m_coveragep.reset(new VerilatedCovImp);
|
m_coveragep.reset(new VerilatedCovImp{this});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return reinterpret_cast<VerilatedCovContext*>(m_coveragep.get());
|
return reinterpret_cast<VerilatedCovContext*>(m_coveragep.get());
|
||||||
|
|||||||
+15
-23
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Code available from: https://verilator.org
|
// Code available from: https://verilator.org
|
||||||
//
|
//
|
||||||
// Copyright 2001-2023 by Wilson Snyder. This program is free software; you
|
// Copyright 2001-2024 by Wilson Snyder. This program is free software; you
|
||||||
// can redistribute it and/or modify it under the terms of either the GNU
|
// 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
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
@@ -63,26 +63,18 @@ class VerilatedCovImp;
|
|||||||
/// for (int i = 0; i < 10; ++i) m_cases[i] = 0;
|
/// for (int i = 0; i < 10; ++i) m_cases[i] = 0;
|
||||||
/// // Insert
|
/// // Insert
|
||||||
/// for (int i = 0; i < 10; ++i)
|
/// for (int i = 0; i < 10; ++i)
|
||||||
/// VL_COVER_INSERT(&m_cases[i], "comment", "Coverage Case", "i", cvtToNumStr(i));
|
/// VL_COVER_INSERT(covp, name(), &m_cases[i], "comment", "Coverage Case",
|
||||||
|
/// "i", cvtToNumStr(i));
|
||||||
/// }
|
/// }
|
||||||
|
|
||||||
#define VL_COVER_INSERT(covcontextp, countp, ...) \
|
#define VL_COVER_INSERT(covcontextp, name, countp, ...) \
|
||||||
do { \
|
do { \
|
||||||
covcontextp->_inserti(countp); \
|
auto const ccontextp = covcontextp; \
|
||||||
covcontextp->_insertf(__FILE__, __LINE__); \
|
ccontextp->_inserti(countp); \
|
||||||
covcontextp->_insertp("hier", name(), __VA_ARGS__); \
|
ccontextp->_insertf(__FILE__, __LINE__); \
|
||||||
|
ccontextp->_insertp("hier", name, __VA_ARGS__); \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
//=============================================================================
|
|
||||||
// Convert VL_COVER_INSERT value arguments to strings, is \internal
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
std::string vlCovCvtToStr(const T& t) VL_PURE {
|
|
||||||
std::ostringstream os;
|
|
||||||
os << t;
|
|
||||||
return os.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// VerilatedCov
|
// VerilatedCov
|
||||||
/// Per-VerilatedContext coverage data class.
|
/// Per-VerilatedContext coverage data class.
|
||||||
@@ -96,12 +88,13 @@ class VerilatedCovContext VL_NOT_FINAL : public VerilatedVirtualBase {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// METHODS
|
// METHODS
|
||||||
/// Return default filename
|
/// Return default filename, may override with +verilator+coverage+file
|
||||||
static const char* defaultFilename() VL_PURE { return "coverage.dat"; }
|
std::string defaultFilename() VL_MT_SAFE;
|
||||||
/// Make all data per_instance, overriding point's per_instance
|
/// Make all data per_instance, overriding point's per_instance
|
||||||
void forcePerInstance(bool flag) VL_MT_SAFE;
|
void forcePerInstance(bool flag) VL_MT_SAFE;
|
||||||
/// Write all coverage data to a file
|
/// Write all coverage data to a file
|
||||||
void write(const char* filenamep = defaultFilename()) VL_MT_SAFE;
|
void write(const std::string& filename) VL_MT_SAFE;
|
||||||
|
void write() VL_MT_SAFE { write(defaultFilename()); }
|
||||||
/// Clear coverage points (and call delete on all items)
|
/// Clear coverage points (and call delete on all items)
|
||||||
void clear() VL_MT_SAFE;
|
void clear() VL_MT_SAFE;
|
||||||
/// Clear items not matching the provided string
|
/// Clear items not matching the provided string
|
||||||
@@ -170,11 +163,10 @@ class VerilatedCov final {
|
|||||||
public:
|
public:
|
||||||
// METHODS
|
// METHODS
|
||||||
/// Return default filename for the current thread
|
/// Return default filename for the current thread
|
||||||
static const char* defaultFilename() VL_PURE { return VerilatedCovContext::defaultFilename(); }
|
static std::string defaultFilename() VL_MT_SAFE { return threadCovp()->defaultFilename(); }
|
||||||
/// Write all coverage data to a file for the current thread
|
/// Write all coverage data to a file for the current thread
|
||||||
static void write(const char* filenamep = defaultFilename()) VL_MT_SAFE {
|
static void write(const std::string& filename) VL_MT_SAFE { threadCovp()->write(filename); }
|
||||||
threadCovp()->write(filenamep);
|
static void write() VL_MT_SAFE { write(defaultFilename()); }
|
||||||
}
|
|
||||||
/// Clear coverage points (and call delete on all items) for the current thread
|
/// Clear coverage points (and call delete on all items) for the current thread
|
||||||
static void clear() VL_MT_SAFE { threadCovp()->clear(); }
|
static void clear() VL_MT_SAFE { threadCovp()->clear(); }
|
||||||
/// Clear items not matching the provided string for the current thread
|
/// Clear items not matching the provided string for the current thread
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user