mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-23 22:36:54 +02:00
Compare commits
1218
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
105521b547 | ||
|
|
fd3086f0a9 | ||
|
|
77ebfcacb9 | ||
|
|
d62a307c34 | ||
|
|
011519cb5b | ||
|
|
8a0b9acadc | ||
|
|
77d1671d8f | ||
|
|
561564065d | ||
|
|
409f8c5823 | ||
|
|
03198356a5 | ||
|
|
b1d2393789 | ||
|
|
0f740289e9 | ||
|
|
46ce236cfb | ||
|
|
86139c855d | ||
|
|
eb070b061b | ||
|
|
2b1393e7b9 | ||
|
|
85c7b07a9b | ||
|
|
0c5ed2b60f | ||
|
|
8fd1ead082 | ||
|
|
3bd307db85 | ||
|
|
35db02d35d | ||
|
|
f287546f49 | ||
|
|
1645e682f4 | ||
|
|
a57e0a1e3f | ||
|
|
b83144c552 | ||
|
|
58fb80aec4 | ||
|
|
38f277d81b | ||
|
|
f3ba335493 | ||
|
|
fb5ae48b18 | ||
|
|
68258f244e | ||
|
|
ee34ccec70 | ||
|
|
1834d470cb | ||
|
|
9bc463aac0 | ||
|
|
7c77097f71 | ||
|
|
cc4c5f4998 | ||
|
|
230c435ae7 | ||
|
|
4ddef32631 | ||
|
|
a236c274f3 | ||
|
|
21a8cb71ee | ||
|
|
b4ccaa1b0c | ||
|
|
a8d43fa743 | ||
|
|
ca2ef5c956 | ||
|
|
6015aceda2 | ||
|
|
9538501b54 | ||
|
|
ea7fa24f9e | ||
|
|
48d3701c02 | ||
|
|
c1164dcc33 | ||
|
|
1166cd932a | ||
|
|
c3a318f14e | ||
|
|
b2deae7ba9 | ||
|
|
675dd91403 | ||
|
|
b12e00d875 | ||
|
|
103828577b | ||
|
|
21c8b8ca5a | ||
|
|
25c588252f | ||
|
|
89d1125979 | ||
|
|
43c6a0bacd | ||
|
|
610ca95cbe | ||
|
|
daa59a95ad | ||
|
|
13f861a963 | ||
|
|
82ca4cf641 | ||
|
|
ac2e8dd6cd | ||
|
|
cd992b4d5a | ||
|
|
679021a1b5 | ||
|
|
f3392561ed | ||
|
|
7a9a022744 | ||
|
|
c222b3b6a4 | ||
|
|
663c79d4af | ||
|
|
bea03db25d | ||
|
|
b96f04ccce | ||
|
|
a9db765f98 | ||
|
|
c71ab5869a | ||
|
|
04bdfbccee | ||
|
|
2acc9fbdee | ||
|
|
725ed869ba | ||
|
|
301edf69d3 | ||
|
|
1612c6d638 | ||
|
|
aadd67cd3b | ||
|
|
c2ca9c3b73 | ||
|
|
0601b4e43b | ||
|
|
8aca66b109 | ||
|
|
2aeb3871ed | ||
|
|
ea21fb856e | ||
|
|
754899c99e | ||
|
|
4e94b81a4b | ||
|
|
6948c27c2d | ||
|
|
2e9c4cde55 | ||
|
|
2e8c4e3dbc | ||
|
|
cc9fcfd13d | ||
|
|
4660e0bf2f | ||
|
|
1e7509a021 | ||
|
|
c2e53f0d63 | ||
|
|
f171161822 | ||
|
|
0237297e93 | ||
|
|
e38b5d9fb7 | ||
|
|
d5123011b3 | ||
|
|
9a471bd81c | ||
|
|
632e15a55c | ||
|
|
d4313dad75 | ||
|
|
c25538d750 | ||
|
|
871d447ff7 | ||
|
|
b286b76134 | ||
|
|
4f62a0d1f2 | ||
|
|
e7df9774aa | ||
|
|
08afbde08d | ||
|
|
7ab0824adf | ||
|
|
7fad4779c5 | ||
|
|
8ac06fb63f | ||
|
|
4e727adc25 | ||
|
|
3e9c14060f | ||
|
|
702a8c3a05 | ||
|
|
48d3972299 | ||
|
|
62fce50f8c | ||
|
|
e4b862f3d1 | ||
|
|
09d3a5de59 | ||
|
|
97bde47c31 | ||
|
|
1c80c6e37a | ||
|
|
4588f7c615 | ||
|
|
006aef93d0 | ||
|
|
24b8752475 | ||
|
|
3ddcf03764 | ||
|
|
35f5d51028 | ||
|
|
87c019c65c | ||
|
|
69a1fecd2e | ||
|
|
9964d67e5e | ||
|
|
a98f21aa65 | ||
|
|
a63ca15735 | ||
|
|
d139142c29 | ||
|
|
af85d44d9f | ||
|
|
c5e0507941 | ||
|
|
c55a013162 | ||
|
|
dfbca0b186 | ||
|
|
4a779f43bd | ||
|
|
97df6183a9 | ||
|
|
95faed8e9d | ||
|
|
76aab15798 | ||
|
|
e896f0c8e6 | ||
|
|
f36bebf0e1 | ||
|
|
3fd622e4eb | ||
|
|
da4200c5bd | ||
|
|
712f394224 | ||
|
|
d6685f40a1 | ||
|
|
9ff9cbf4aa | ||
|
|
a992f3ce7c | ||
|
|
1a4edcac48 | ||
|
|
8cac72192f | ||
|
|
7f6100be2a | ||
|
|
4b60d2737e | ||
|
|
c7beef907d | ||
|
|
44da7de651 | ||
|
|
6887c82540 | ||
|
|
1333bc54a2 | ||
|
|
fddb3ec129 | ||
|
|
bfafd175fa | ||
|
|
23238aa7ac | ||
|
|
2397aa1587 | ||
|
|
b4119de9b1 | ||
|
|
338a0eb11a | ||
|
|
fde6525acb | ||
|
|
c5fee8bdb9 | ||
|
|
194a950f8d | ||
|
|
9951521212 | ||
|
|
9e856810b9 | ||
|
|
675b7d8efa | ||
|
|
e352bea476 | ||
|
|
747e656a0e | ||
|
|
7b5470c8a7 | ||
|
|
985a3eb206 | ||
|
|
e1ec27e18c | ||
|
|
d13e488f4c | ||
|
|
f5dd2ac87e | ||
|
|
94abef195a | ||
|
|
54696e0127 | ||
|
|
d85096c56a | ||
|
|
d16a9dcfc6 | ||
|
|
9842035d89 | ||
|
|
480668fee6 | ||
|
|
fa21527e9f | ||
|
|
98799ff7fa | ||
|
|
ea4b000be6 | ||
|
|
e330a0bd6e | ||
|
|
cb03802a17 | ||
|
|
22d18cb28d | ||
|
|
c98c3e5d14 | ||
|
|
a63289c2fc | ||
|
|
251b75003f | ||
|
|
01b4d49d4a | ||
|
|
f851fc6981 | ||
|
|
a25cde3bc7 | ||
|
|
51b121ae7a | ||
|
|
94caa4881e | ||
|
|
ef7ac5ed03 | ||
|
|
acce9fc2a0 | ||
|
|
1cfbd2db63 | ||
|
|
853512868b | ||
|
|
9b1de4b038 | ||
|
|
ec2793c9b0 | ||
|
|
697701a26e | ||
|
|
facc982af4 | ||
|
|
8bb1d3dabe | ||
|
|
88e951418b | ||
|
|
1572dcd3fd | ||
|
|
96d793ed6b | ||
|
|
15ccd8f4c9 | ||
|
|
d1a35d5152 | ||
|
|
3b0dfaadba | ||
|
|
1465fd1570 | ||
|
|
886b6cd349 | ||
|
|
0dc28c0fc3 | ||
|
|
dec4cd5071 | ||
|
|
0cd6fbaf41 | ||
|
|
9fa764285a | ||
|
|
fe8e7a6261 | ||
|
|
a0ea7e17cf | ||
|
|
8c3f7d78b9 | ||
|
|
684c2fe19e | ||
|
|
a67f18f8ef | ||
|
|
931039761a | ||
|
|
3852545f21 | ||
|
|
b4d0c43a96 | ||
|
|
c24c26725e | ||
|
|
1269c12054 | ||
|
|
4fb91ec7c7 | ||
|
|
e5f49baaac | ||
|
|
0f728b9150 | ||
|
|
b0c79d5d1c | ||
|
|
150fe088a6 | ||
|
|
bb66ed8b9d | ||
|
|
447e402d16 | ||
|
|
86bb269d47 | ||
|
|
486dc7abeb | ||
|
|
6765e32ab9 | ||
|
|
b1d15436fd | ||
|
|
c846b2cf3f | ||
|
|
10446df80e | ||
|
|
0a2100c87f | ||
|
|
27730395ca | ||
|
|
8e9c25a23e | ||
|
|
feccae56bf | ||
|
|
5de83906f7 | ||
|
|
8b969202c0 | ||
|
|
ea5789e4d9 | ||
|
|
f602ae84ab | ||
|
|
335db49282 | ||
|
|
8c2d51142b | ||
|
|
5ee253b03b | ||
|
|
c9ff48bd4e | ||
|
|
9b4681918b | ||
|
|
0894bc6409 | ||
|
|
da63ef02d4 | ||
|
|
a730572e37 | ||
|
|
d891285326 | ||
|
|
e8b8fcba57 | ||
|
|
6d052d4ff7 | ||
|
|
72ff9ac00b | ||
|
|
c92dea77fc | ||
|
|
4ea512c4fd | ||
|
|
89f1344288 | ||
|
|
96414af721 | ||
|
|
2d2a720ea8 | ||
|
|
9031f392ba | ||
|
|
4786f80b0b | ||
|
|
0f294cb607 | ||
|
|
f4c88b4a01 | ||
|
|
374948ce1b | ||
|
|
6a2b579fb0 | ||
|
|
d2ad7a4d28 | ||
|
|
5830ecd67e | ||
|
|
69b145e216 | ||
|
|
5ed60a151f | ||
|
|
c7a36722e3 | ||
|
|
66d31b02be | ||
|
|
0a6d75f1db | ||
|
|
6a2956c672 | ||
|
|
cdb1ea6264 | ||
|
|
df1d0a7b47 | ||
|
|
8d9ac35202 | ||
|
|
945584c310 | ||
|
|
d6b6b76015 | ||
|
|
0cbd6d99af | ||
|
|
8e7e3c7493 | ||
|
|
588409389e | ||
|
|
cc9d5f90e0 | ||
|
|
714795709c | ||
|
|
7b10570e11 | ||
|
|
cb381b3ee3 | ||
|
|
f5e01081d1 | ||
|
|
9c5113194d | ||
|
|
6bc3f98e0a | ||
|
|
b99b4b0223 | ||
|
|
fa38a8e08d | ||
|
|
14f597acdd | ||
|
|
b991a991a7 | ||
|
|
515137c8c7 | ||
|
|
d26a081cbc | ||
|
|
dff9953bc2 | ||
|
|
d8f10e7aa2 | ||
|
|
d5fb0f4344 | ||
|
|
c1e533d484 | ||
|
|
58ec35a6af | ||
|
|
ae6743cf69 | ||
|
|
850d8c3ee9 | ||
|
|
467e8afc41 | ||
|
|
f17690ebde | ||
|
|
774d173d69 | ||
|
|
9d99a64bf0 | ||
|
|
00a9c69348 | ||
|
|
8f7277a5ab | ||
|
|
e221a8ced9 | ||
|
|
a575eeb29d | ||
|
|
0dc12676f0 | ||
|
|
6ebb57195b | ||
|
|
78cb0a7876 | ||
|
|
47ddb18d54 | ||
|
|
0611135758 | ||
|
|
0ffd61a835 | ||
|
|
0728690df2 | ||
|
|
e82bafcb84 | ||
|
|
54f4c1147b | ||
|
|
642acb4082 | ||
|
|
6101044bff | ||
|
|
c6e44f2da1 | ||
|
|
3c0a982ab3 | ||
|
|
0f85bf0b9a | ||
|
|
ccce9d9271 | ||
|
|
9c79e321ae | ||
|
|
6d2fa6e579 | ||
|
|
f8dc430fe5 | ||
|
|
26f71f2d94 | ||
|
|
7cd3bdb0d0 | ||
|
|
81947edaa5 | ||
|
|
684e46a6c1 | ||
|
|
2bc9cb90dd | ||
|
|
1e18d43107 | ||
|
|
6a45a0d570 | ||
|
|
529e029abd | ||
|
|
855bf9cfe8 | ||
|
|
35a8485a44 | ||
|
|
12379ed26a | ||
|
|
6323e6a0a5 | ||
|
|
41ff18206a | ||
|
|
f104ffc133 | ||
|
|
ded1bd4949 | ||
|
|
579b59b8eb | ||
|
|
ef79f538d5 | ||
|
|
76883fa18c | ||
|
|
d05abf5ca4 | ||
|
|
ff72782ec6 | ||
|
|
d96e8872c1 | ||
|
|
6547fdee3d | ||
|
|
b7b77b2e75 | ||
|
|
f16c67d45a | ||
|
|
020e280a98 | ||
|
|
109c5d895d | ||
|
|
ce864fc634 | ||
|
|
be0c61051d | ||
|
|
ec0c66ff25 | ||
|
|
5893d13ea3 | ||
|
|
8d9f3a0920 | ||
|
|
17be8e8c7c | ||
|
|
c32610d135 | ||
|
|
be8df11217 | ||
|
|
650cedb516 | ||
|
|
a1d65336d2 | ||
|
|
d6405f86d4 | ||
|
|
8c80193fc5 | ||
|
|
e4476d544f | ||
|
|
c6cbaf3076 | ||
|
|
b687cc5f21 | ||
|
|
4d29df17b8 | ||
|
|
fdcb073c14 | ||
|
|
734d56ce25 | ||
|
|
a5423ce5ce | ||
|
|
e336eca00f | ||
|
|
3a77537ed8 | ||
|
|
c8b20da4be | ||
|
|
97e1151388 | ||
|
|
e6b394f825 | ||
|
|
f752007e9c | ||
|
|
40b36337e2 | ||
|
|
df4889ba3d | ||
|
|
2e2317b7c7 | ||
|
|
e2bad56a5c | ||
|
|
0accab6ec4 | ||
|
|
e55e832ea0 | ||
|
|
fc1f9ac6a5 | ||
|
|
6caa41cc93 | ||
|
|
751f19cc46 | ||
|
|
f8e33b12cd | ||
|
|
aaee9989c2 | ||
|
|
a849249a86 | ||
|
|
849ba64cf7 | ||
|
|
bb182cf3ce | ||
|
|
bc9382eea3 | ||
|
|
88e4938074 | ||
|
|
e932c7a637 | ||
|
|
b5e0099f28 | ||
|
|
1afe7476e3 | ||
|
|
4068570f43 | ||
|
|
3e41a93f3e | ||
|
|
7ceb18fb37 | ||
|
|
d2ff77d56c | ||
|
|
3c660d04f3 | ||
|
|
d0d421ebe2 | ||
|
|
13c1925045 | ||
|
|
c61d2151c1 | ||
|
|
065c48527c | ||
|
|
ed2e339dd6 | ||
|
|
5dcd2e8957 | ||
|
|
1f81d4c081 | ||
|
|
a3450bf856 | ||
|
|
91b7c6ab55 | ||
|
|
ebed793dec | ||
|
|
320f6d008c | ||
|
|
a76be3571d | ||
|
|
345c9cf21c | ||
|
|
5a06602af2 | ||
|
|
830083d99b | ||
|
|
6902bf44e3 | ||
|
|
8f849a9944 | ||
|
|
b1ef0997ed | ||
|
|
ecce1d25bc | ||
|
|
f43080fbcb | ||
|
|
463407572f | ||
|
|
6b6574dd8a | ||
|
|
4e81939eda | ||
|
|
66bdbb77ec | ||
|
|
5853f7d867 | ||
|
|
68f8de28af | ||
|
|
ac3aee0172 | ||
|
|
8135f369a5 | ||
|
|
be5bfeb172 | ||
|
|
801e795112 | ||
|
|
e66fc7e5cc | ||
|
|
1d63875e5d | ||
|
|
be1130ddbf | ||
|
|
9f2b7d6553 | ||
|
|
f5041e6c09 | ||
|
|
959ac3229e | ||
|
|
554fb7ebdd | ||
|
|
c9e8392dc7 | ||
|
|
60d37e1f53 | ||
|
|
e0ac4893f0 | ||
|
|
401fccdf6e | ||
|
|
f5564a195f | ||
|
|
c7e61f3aa4 | ||
|
|
a012406ca4 | ||
|
|
52a9fdde8a | ||
|
|
4f1c43b690 | ||
|
|
7f59c51ca2 | ||
|
|
0be577cc44 | ||
|
|
49cf5556a2 | ||
|
|
1805598eae | ||
|
|
0eca210722 | ||
|
|
3e95966d70 | ||
|
|
fdc9e8590d | ||
|
|
f76d56beb8 | ||
|
|
be17bfc0e9 | ||
|
|
77a01f65d0 | ||
|
|
e497f63e29 | ||
|
|
75233a9bca | ||
|
|
11197baf86 | ||
|
|
23ba0bc019 | ||
|
|
9cfb15a302 | ||
|
|
607b63a758 | ||
|
|
8bebe59e20 | ||
|
|
20d415463a | ||
|
|
9c1dcad994 | ||
|
|
0e13726e83 | ||
|
|
54346d7095 | ||
|
|
0121fbc88c | ||
|
|
f1855eed0e | ||
|
|
0f9828f179 | ||
|
|
d2c2d6d8dc | ||
|
|
f94a655121 | ||
|
|
078a3fd409 | ||
|
|
dfaed128c0 | ||
|
|
1fc4093191 | ||
|
|
ae1f8be277 | ||
|
|
d8533104b0 | ||
|
|
c6c697bdb7 | ||
|
|
660d59a7a9 | ||
|
|
92a5e6a698 | ||
|
|
aaa054a932 | ||
|
|
079065ea73 | ||
|
|
1905264061 | ||
|
|
b0a9430e98 | ||
|
|
f906384423 | ||
|
|
fc42f40770 | ||
|
|
6ec31517a9 | ||
|
|
8a4d769b3d | ||
|
|
a3b29dd70b | ||
|
|
b0491b9c54 | ||
|
|
6a93b6a7e4 | ||
|
|
ec6009dd8f | ||
|
|
4820d46353 | ||
|
|
a2845cee70 | ||
|
|
c897ca017c | ||
|
|
aee540d8bb | ||
|
|
19402aeef2 | ||
|
|
fcc0a6a203 | ||
|
|
2165905613 | ||
|
|
e5eb754150 | ||
|
|
d1c9dd554b | ||
|
|
063c6d6065 | ||
|
|
2fc8ce8a16 | ||
|
|
1a3adbe9cd | ||
|
|
63fa44fa4a | ||
|
|
f89dbd48c8 | ||
|
|
9fc3e84e93 | ||
|
|
e708a5b59d | ||
|
|
d55e4c0552 | ||
|
|
ef06bf7589 | ||
|
|
54926840e6 | ||
|
|
5ef077fdf6 | ||
|
|
336b29955d | ||
|
|
7fa2a4ccf3 | ||
|
|
e4fc5806c4 | ||
|
|
4def0110b5 | ||
|
|
503a1bf6d7 | ||
|
|
92e4ca3a92 | ||
|
|
9e25884f12 | ||
|
|
819770a6c4 | ||
|
|
7669a42cfb | ||
|
|
0495d75fcb | ||
|
|
0d6c15e45a | ||
|
|
49756a8e7a | ||
|
|
0b4056817a | ||
|
|
aced587461 | ||
|
|
077bd5b7ef | ||
|
|
bf9781e8fd | ||
|
|
40840368bb | ||
|
|
5946fa46a6 | ||
|
|
196df151aa | ||
|
|
c1566bc02b | ||
|
|
f349197df3 | ||
|
|
7e55babb62 | ||
|
|
5a0f9f4604 | ||
|
|
ae90da9951 | ||
|
|
9544cb516d | ||
|
|
fa8d35ae9c | ||
|
|
37ac1ed474 | ||
|
|
483d0534ae | ||
|
|
be7d763352 | ||
|
|
04bab6b197 | ||
|
|
f47af361cd | ||
|
|
676786a399 | ||
|
|
0692cd54e7 | ||
|
|
68d83383ff | ||
|
|
9bd9c8f301 | ||
|
|
f16fd03dab | ||
|
|
a7d8c983ba | ||
|
|
d192f545ac | ||
|
|
0157a156fb | ||
|
|
9f83882bcc | ||
|
|
bfb14fbbc6 | ||
|
|
be2595085f | ||
|
|
4625e7e2b6 | ||
|
|
bb39d09d5e | ||
|
|
36c91491cc | ||
|
|
d291e2b23d | ||
|
|
1814c24a90 | ||
|
|
92e08fdcd8 | ||
|
|
7875880aa1 | ||
|
|
383708fde8 | ||
|
|
4047ed7976 | ||
|
|
3c7d7a7856 | ||
|
|
d7c2118d10 | ||
|
|
97d06b107f | ||
|
|
61fbfb562e | ||
|
|
7e82a37fa3 | ||
|
|
141a23690e | ||
|
|
a024efb615 | ||
|
|
e60804cf41 | ||
|
|
d5a0f2fc07 | ||
|
|
2464582587 | ||
|
|
82ebf6372c | ||
|
|
3945b9df45 | ||
|
|
96813f76c1 | ||
|
|
2030e06988 | ||
|
|
cd85a42acc | ||
|
|
18c338ad09 | ||
|
|
2355e1ed8e | ||
|
|
5494c9ae09 | ||
|
|
20ad1ff261 | ||
|
|
589bb59268 | ||
|
|
e12d2b2f36 | ||
|
|
c64b8900ca | ||
|
|
1cd72d375c | ||
|
|
aa9a7435dd | ||
|
|
12c588fc35 | ||
|
|
8f0687adb7 | ||
|
|
281556e93d | ||
|
|
a196af8e15 | ||
|
|
7b07fca285 | ||
|
|
095cedb305 | ||
|
|
d5823b3e55 | ||
|
|
51ca2d1243 | ||
|
|
ec8081f983 | ||
|
|
34643d9628 | ||
|
|
68db6c5a65 | ||
|
|
d564e054e5 | ||
|
|
8616e3d6fa | ||
|
|
2c2ab24c8f | ||
|
|
d025c8aa93 | ||
|
|
7534abe325 | ||
|
|
7bc94d7810 | ||
|
|
a9a1c50268 | ||
|
|
5084a23417 | ||
|
|
46f551073e | ||
|
|
d9e1bcf3d0 | ||
|
|
13bb927d8a | ||
|
|
16414f921f | ||
|
|
9a116498a2 | ||
|
|
d8f945be23 | ||
|
|
8412d0d55f | ||
|
|
07cc18284c | ||
|
|
7d6d93e4e2 | ||
|
|
64b2345cf2 | ||
|
|
9b3987bf3c | ||
|
|
15cda5fef2 | ||
|
|
a10e07908e | ||
|
|
c2c9e09a49 | ||
|
|
1b79df810f | ||
|
|
9dde4b705d | ||
|
|
1abf4f1aa1 | ||
|
|
a47447610f | ||
|
|
d209d8ee39 | ||
|
|
8117f4b383 | ||
|
|
6b5ae5e4db | ||
|
|
a40c8f6bca | ||
|
|
a6fb6be8b5 | ||
|
|
ec99faff05 | ||
|
|
1352abfc98 | ||
|
|
687d0a928b | ||
|
|
947d642da7 | ||
|
|
1cbd6c3a80 | ||
|
|
11be93ce55 | ||
|
|
aaf35ca6ab | ||
|
|
4294a47cec | ||
|
|
b983d5546b | ||
|
|
ed9a3c3b10 | ||
|
|
d8f4ff4b57 | ||
|
|
af29735f44 | ||
|
|
638300045c | ||
|
|
71552b7d1a | ||
|
|
7c0a75cf0c | ||
|
|
f054500fe2 | ||
|
|
6684b2db04 | ||
|
|
999a53ab75 | ||
|
|
534d44ba55 | ||
|
|
c7c10613d7 | ||
|
|
dfc44db0ef | ||
|
|
7a6192b5c8 | ||
|
|
05f90bcf55 | ||
|
|
1be59d8ae7 | ||
|
|
b4dbb81af7 | ||
|
|
e709849243 | ||
|
|
1b2fa39cdc | ||
|
|
b4ec36ec78 | ||
|
|
dddaacc6fd | ||
|
|
e0c9efd129 | ||
|
|
01b81e0dbc | ||
|
|
d2034a6458 | ||
|
|
c4edbda969 | ||
|
|
f3917778bc | ||
|
|
032f12af45 | ||
|
|
bb37b74f98 | ||
|
|
817a38494c | ||
|
|
d6fe6ea936 | ||
|
|
af48acca14 | ||
|
|
11696e23d1 | ||
|
|
8b7dde0e41 | ||
|
|
54cb85adfc | ||
|
|
f636ffde48 | ||
|
|
87235b618b | ||
|
|
e4cc12f3b9 | ||
|
|
9d1084d3c0 | ||
|
|
21b24c7725 | ||
|
|
3e75f8e41f | ||
|
|
dec0fa622c | ||
|
|
dbd05557ca | ||
|
|
e30334e527 | ||
|
|
3e76f6d656 | ||
|
|
91ad8a72c6 | ||
|
|
e2361fab29 | ||
|
|
f6b8d613ab | ||
|
|
3a3cd8565d | ||
|
|
b9bcacd803 | ||
|
|
cbd1b948a2 | ||
|
|
d1c1997acf | ||
|
|
fcbb41c391 | ||
|
|
e736c022b1 | ||
|
|
d08e0270e4 | ||
|
|
bb1d26f4f7 | ||
|
|
173577d5f7 | ||
|
|
5326790932 | ||
|
|
4ef3ac5ca6 | ||
|
|
cf47a759d1 | ||
|
|
046535cfbb | ||
|
|
637d43fb5a | ||
|
|
fbc5557a10 | ||
|
|
75b4b94061 | ||
|
|
d346fb098f | ||
|
|
633360a0f9 | ||
|
|
0e8a257ec2 | ||
|
|
7fa4cf5a34 | ||
|
|
eecc3312b7 | ||
|
|
11e5641089 | ||
|
|
f631cb6314 | ||
|
|
a586bfd1ec | ||
|
|
4dbd0442aa | ||
|
|
fa9a439bf1 | ||
|
|
11e394aacf | ||
|
|
9af0811a1c | ||
|
|
503487e9ea | ||
|
|
ca9616dc7b | ||
|
|
24bd630cb2 | ||
|
|
8487cb5616 | ||
|
|
d630e4dfe9 | ||
|
|
3d5765949e | ||
|
|
0fcd2d9db6 | ||
|
|
3446455055 | ||
|
|
af304fea65 | ||
|
|
bcaa6accec | ||
|
|
5c00b96127 | ||
|
|
bfe3998eaa | ||
|
|
096e53dea4 | ||
|
|
bc77a19059 | ||
|
|
1b178d56b7 | ||
|
|
dca6171f5f | ||
|
|
164b5f9348 | ||
|
|
e927960121 | ||
|
|
6394a4d78d | ||
|
|
13be45bd73 | ||
|
|
7f7decde03 | ||
|
|
d9fea802da | ||
|
|
34f6e25b4e | ||
|
|
afe1e79338 | ||
|
|
cbaf36d4b8 | ||
|
|
6f8eede371 | ||
|
|
c693930595 | ||
|
|
6364aba975 | ||
|
|
10ec58703f | ||
|
|
9a69fcff7b | ||
|
|
26dc6d68cd | ||
|
|
0aca19356c | ||
|
|
5e94554d72 | ||
|
|
7d26515bc4 | ||
|
|
71c6193ff1 | ||
|
|
b0b6be0d23 | ||
|
|
7c1638652a | ||
|
|
1b1aa06dee | ||
|
|
51d3c03922 | ||
|
|
431d62185b | ||
|
|
c55eb37148 | ||
|
|
de6c57d661 | ||
|
|
ac78ba588f | ||
|
|
8e559e4e91 | ||
|
|
eff6e7a441 | ||
|
|
8994ef1483 | ||
|
|
20ee350601 | ||
|
|
c4257ecfc9 | ||
|
|
a91840c15d | ||
|
|
a748736d10 | ||
|
|
11682fc7eb | ||
|
|
255922e545 | ||
|
|
98694f15ce | ||
|
|
36b04748d4 | ||
|
|
d2928d500d | ||
|
|
15379f1750 | ||
|
|
0a4d8acefb | ||
|
|
632fd006c5 | ||
|
|
256c0986bb | ||
|
|
db7fbba08e | ||
|
|
f536a43e92 | ||
|
|
283ae6e538 | ||
|
|
fbafb915d2 | ||
|
|
4c52f66f5d | ||
|
|
46f63db746 | ||
|
|
4ad556d464 | ||
|
|
4dffd97d28 | ||
|
|
b1d853bf9b | ||
|
|
eba3d407ca | ||
|
|
44cd9158e8 | ||
|
|
b122ec2a1a | ||
|
|
bae0f1d3a7 | ||
|
|
23dbfabb1e | ||
|
|
6da71fdf56 | ||
|
|
bdfd5b9b55 | ||
|
|
64dffa5745 | ||
|
|
b9011d89ae | ||
|
|
3b3a4d3ddc | ||
|
|
b1613e99e6 | ||
|
|
d0f2a9e961 | ||
|
|
fb23493a98 | ||
|
|
17330a3073 | ||
|
|
fac5cbca43 | ||
|
|
670601bc2a | ||
|
|
25b48fa790 | ||
|
|
dd5fb47c6c | ||
|
|
b80401e1ee | ||
|
|
1bcd3a97ad | ||
|
|
09f90ab4e1 | ||
|
|
5929a00845 | ||
|
|
5d7558b5e0 | ||
|
|
ee71ade720 | ||
|
|
e437321ea7 | ||
|
|
6da610fe1e | ||
|
|
e8d4039175 | ||
|
|
faece5816c | ||
|
|
bc2a4c01c9 | ||
|
|
22769afd20 | ||
|
|
03ebd2f98d | ||
|
|
b378dccbe9 | ||
|
|
1f9489a65d | ||
|
|
f436b5d18e | ||
|
|
64401ab815 | ||
|
|
952169ded9 | ||
|
|
1b36aa5560 | ||
|
|
69705ef32b | ||
|
|
2e86c208d1 | ||
|
|
27b8738d06 | ||
|
|
8fa79ceb30 | ||
|
|
60cb78e4ab | ||
|
|
97f3a01dc5 | ||
|
|
99b8086ad2 | ||
|
|
c4386da666 | ||
|
|
51112131ad | ||
|
|
8808cd9514 | ||
|
|
890589191c | ||
|
|
75c78c7c5b | ||
|
|
69de1da172 | ||
|
|
28bc333cba | ||
|
|
8b4dc05ff8 | ||
|
|
6de80adbe8 | ||
|
|
fdcef3cbc4 | ||
|
|
41c7aa9e83 | ||
|
|
1929cfc4f9 | ||
|
|
8b70fefa59 | ||
|
|
af91920a17 | ||
|
|
89244e0f70 | ||
|
|
5abd939655 | ||
|
|
06ce23d9c2 | ||
|
|
a581e0ef0e | ||
|
|
b6ec138644 | ||
|
|
dc387ad9d1 | ||
|
|
48b186576e | ||
|
|
15b0946fc4 | ||
|
|
5830e65829 | ||
|
|
f3a51fdfd1 | ||
|
|
afd23d13d5 | ||
|
|
11f479e028 | ||
|
|
838f6ce862 | ||
|
|
e99d53b80b | ||
|
|
1d314faf97 | ||
|
|
751587e112 | ||
|
|
673675fecd | ||
|
|
ee58fd749c | ||
|
|
bcc7973792 | ||
|
|
b176a6410d | ||
|
|
d8592b1444 | ||
|
|
4568766cff | ||
|
|
c49b21115a | ||
|
|
106850ca7d | ||
|
|
2ea5919a4a | ||
|
|
0375ff3923 | ||
|
|
59ce217ce2 | ||
|
|
350369f3fc | ||
|
|
d9c400ac0c | ||
|
|
922b74be9e | ||
|
|
cd239a9857 | ||
|
|
8e515a9a64 | ||
|
|
45bb1313e7 | ||
|
|
d04aa4b234 | ||
|
|
074055bc58 | ||
|
|
d6726f62fc | ||
|
|
bc9e31a444 | ||
|
|
f682d9cad1 | ||
|
|
1305d7659c | ||
|
|
502a0708ea | ||
|
|
c64407f7cf | ||
|
|
cdbfe28c4e | ||
|
|
fbd2843cad | ||
|
|
10b5a82904 | ||
|
|
1527b87595 | ||
|
|
4407bc1d50 | ||
|
|
927edf03d6 | ||
|
|
f5717a6e87 | ||
|
|
84a24f2a34 | ||
|
|
60b1ade52d | ||
|
|
81ba40456f | ||
|
|
1b684a4846 | ||
|
|
3b43fcfc21 | ||
|
|
4b3ef8a314 | ||
|
|
679ef3a380 | ||
|
|
367d7bf94b | ||
|
|
a90e264ed7 | ||
|
|
eaa315fc69 | ||
|
|
b098e31cc7 | ||
|
|
c104586760 | ||
|
|
3fa7b3f05a | ||
|
|
3ab3828aaf | ||
|
|
6cc1010281 | ||
|
|
317e53e784 | ||
|
|
4019525580 | ||
|
|
4b28694509 | ||
|
|
26193ea8bd | ||
|
|
9a7155a1fa | ||
|
|
620b00b322 | ||
|
|
860419a346 | ||
|
|
70dff035a2 | ||
|
|
318a4033b8 | ||
|
|
f7033ca19a | ||
|
|
79903ecadd | ||
|
|
e7c6829512 | ||
|
|
a186e5ad31 | ||
|
|
b6eb86d696 | ||
|
|
7a2ad01f2e | ||
|
|
3e7adbeda0 | ||
|
|
6278a5760c | ||
|
|
77d24cd095 | ||
|
|
55bebc8c39 | ||
|
|
80fe66b224 | ||
|
|
cb1d4ab359 | ||
|
|
397054d5fc | ||
|
|
afdc1fa923 | ||
|
|
f01a106c25 | ||
|
|
15fb58f8e4 | ||
|
|
78128dd95d | ||
|
|
bad8ed39c1 | ||
|
|
0ccb1b4990 | ||
|
|
5651e6e001 | ||
|
|
b32e1bcbcb | ||
|
|
e72852d53f | ||
|
|
222b683849 | ||
|
|
559d965681 | ||
|
|
9d3548798c | ||
|
|
a5fd5363b3 | ||
|
|
0339f5ed57 | ||
|
|
62be9c5b46 | ||
|
|
0059fb1ec7 | ||
|
|
d6efece5dd | ||
|
|
1326f9aef1 | ||
|
|
e071bd81ee | ||
|
|
a2d980540d | ||
|
|
1aa21aa9e8 | ||
|
|
914ebeca4a | ||
|
|
4e76912331 | ||
|
|
494dc876a5 | ||
|
|
997274b98f | ||
|
|
92313654ec | ||
|
|
5347217b56 | ||
|
|
f957deeca7 | ||
|
|
e0f82981e7 | ||
|
|
016d64e443 | ||
|
|
6137566385 | ||
|
|
daa12ec2b3 | ||
|
|
c14134aa2e | ||
|
|
f5407824ba | ||
|
|
a3f3f7ae58 | ||
|
|
9cca1378bb | ||
|
|
b8093be42f | ||
|
|
f24d6b055d | ||
|
|
85e000ed0c | ||
|
|
7fad717a1e | ||
|
|
a14b8c517c | ||
|
|
174177d437 | ||
|
|
0bdabab4fb | ||
|
|
b4cc9d14a5 | ||
|
|
3d9ed1f0f8 | ||
|
|
adff837399 | ||
|
|
29ade50cab | ||
|
|
cb9e1ee37e | ||
|
|
4cd295cbba | ||
|
|
1a82287f1e | ||
|
|
882d059c1d | ||
|
|
7adb30f383 | ||
|
|
0278f513c5 | ||
|
|
16d569eb3f | ||
|
|
faf456ee7e | ||
|
|
f5aafc32f9 | ||
|
|
1f152aa838 | ||
|
|
83fff3adf7 | ||
|
|
2989cebaa5 | ||
|
|
4313fbbf1f | ||
|
|
0d61f7384d | ||
|
|
3e9f831026 | ||
|
|
69c5d6f5ce | ||
|
|
3af34263ab | ||
|
|
bc85385f13 | ||
|
|
0f1523e15d | ||
|
|
87ea093b4e | ||
|
|
7ce8a9b01c | ||
|
|
429babf831 | ||
|
|
331c9ef64a | ||
|
|
e26dbfefe7 | ||
|
|
0faaa79bae | ||
|
|
8158153ea4 | ||
|
|
62412700aa | ||
|
|
1749d10966 | ||
|
|
34719c3163 | ||
|
|
4af8b03e9d | ||
|
|
7179274bde | ||
|
|
5aa97b379d | ||
|
|
813f548a4b | ||
|
|
082418d73b | ||
|
|
ebe81f7059 | ||
|
|
c4ff8300d3 | ||
|
|
a5a512758e | ||
|
|
befff82655 | ||
|
|
dd284ee582 | ||
|
|
6836068a16 | ||
|
|
a290c58a2e | ||
|
|
94e217f02b | ||
|
|
fdc92ea464 | ||
|
|
18714e2efd | ||
|
|
d0e6b24ca2 | ||
|
|
14f229de30 | ||
|
|
a337a9388b | ||
|
|
2bef6b8624 | ||
|
|
f77bdf7e38 | ||
|
|
2bd3d9ed5d | ||
|
|
cf1b83b8f0 | ||
|
|
dc39714d65 | ||
|
|
d48362b861 | ||
|
|
ea420d94ac | ||
|
|
a35ca1d70b | ||
|
|
bef59e0b6c | ||
|
|
0d0e6d7845 | ||
|
|
f36faa8ab3 | ||
|
|
c46823e280 | ||
|
|
9b3d20239a | ||
|
|
3354d83391 | ||
|
|
cec68cfc61 | ||
|
|
62b67c1843 | ||
|
|
a5a7050120 | ||
|
|
def9d0ea1d | ||
|
|
d10e4bca4c | ||
|
|
25f72e31d4 | ||
|
|
3b7619b46c | ||
|
|
47ddf5220c | ||
|
|
6a57764e0e | ||
|
|
c0f35cbe62 | ||
|
|
8154ce2a4a | ||
|
|
dfe7beec31 | ||
|
|
580c44c015 | ||
|
|
0833d9e37a | ||
|
|
342646264e | ||
|
|
6e8aef8262 | ||
|
|
ceaa60d2f4 | ||
|
|
621c09105c | ||
|
|
369a0b9eca | ||
|
|
2443884779 | ||
|
|
4748f0cb5e | ||
|
|
315ac4f179 | ||
|
|
039e6014fe | ||
|
|
e7a974347e | ||
|
|
63b7fe059d | ||
|
|
247f6a4ecf | ||
|
|
67af96fee7 | ||
|
|
b7b633b613 | ||
|
|
7e202bb5ca | ||
|
|
c7366e65cd | ||
|
|
71d2401221 | ||
|
|
ae06863db1 | ||
|
|
a5458828cd | ||
|
|
021d944a30 | ||
|
|
7eb89c5548 | ||
|
|
5e7f61ea42 | ||
|
|
78b0b49a4e | ||
|
|
9b816f6478 | ||
|
|
1249b5dd32 | ||
|
|
0775e36a67 | ||
|
|
ed3da959f3 | ||
|
|
79435924f2 | ||
|
|
9ed56a6354 | ||
|
|
f7ba954ef7 | ||
|
|
2d0c786bfb | ||
|
|
84f14dbc81 | ||
|
|
509ec1dcb1 | ||
|
|
5cbdac2a46 | ||
|
|
44c5a37ab8 | ||
|
|
e5f84002b1 | ||
|
|
5d05d97eb0 | ||
|
|
c3f25c3c6c | ||
|
|
2013addd22 | ||
|
|
75b12151a4 | ||
|
|
fb3969b5b8 | ||
|
|
69c10c4722 | ||
|
|
8ea1e49768 | ||
|
|
abf8274e4b | ||
|
|
ae901f3285 | ||
|
|
39ee49b252 | ||
|
|
f926cbcc59 | ||
|
|
568db8c06e | ||
|
|
761a38d0a8 | ||
|
|
e55af496e5 | ||
|
|
13348ba7ac | ||
|
|
bb1036b55c | ||
|
|
2b5c82d141 | ||
|
|
cf0b45702f | ||
|
|
42239a8498 | ||
|
|
09493a198f | ||
|
|
3657b15428 | ||
|
|
c222169608 | ||
|
|
b85e7efca8 | ||
|
|
327194cd40 | ||
|
|
5dbe688296 | ||
|
|
b0d61813b2 | ||
|
|
b80afdf1f1 | ||
|
|
dbc6f0cff2 | ||
|
|
da743c3b2c | ||
|
|
8c2e4a0892 | ||
|
|
0e01dcf2b9 | ||
|
|
31d4aa9a77 | ||
|
|
f749867369 | ||
|
|
64ea328823 | ||
|
|
dbc58838d5 | ||
|
|
68eab8c664 | ||
|
|
f33086fed4 | ||
|
|
ebda9777cc | ||
|
|
481a9dec69 | ||
|
|
410350ae5a | ||
|
|
dd3a7411cd | ||
|
|
d000147392 | ||
|
|
cad7c74680 | ||
|
|
bae02433b7 | ||
|
|
952b84fba3 | ||
|
|
51ef541969 | ||
|
|
f8e346f108 | ||
|
|
6b4251626b | ||
|
|
8456252c0c | ||
|
|
5880a3ad8f | ||
|
|
0aefcf9b48 | ||
|
|
8b9fdbc55b | ||
|
|
fec1c1efde | ||
|
|
77f168cf28 | ||
|
|
391073a750 | ||
|
|
5e067bd651 | ||
|
|
c1b73c83f4 | ||
|
|
6eeef8311f | ||
|
|
4287fc4b50 | ||
|
|
3e4f8b625f | ||
|
|
e5c49022b4 | ||
|
|
ae11010707 | ||
|
|
950e7a632c | ||
|
|
5d35ad8a0d | ||
|
|
764b38bb3b | ||
|
|
42b3e6f268 | ||
|
|
e14628193a | ||
|
|
124314576d | ||
|
|
d2c3ff7999 | ||
|
|
e9e2fb33e9 | ||
|
|
3a2866b57c | ||
|
|
d362c8dba0 | ||
|
|
5677efdfe6 | ||
|
|
c7a54891c4 | ||
|
|
53585c9209 | ||
|
|
289b1d1bce | ||
|
|
e9d68098d5 | ||
|
|
d3df962b2a | ||
|
|
bb58ace6d6 | ||
|
|
2bba7ebbda | ||
|
|
d6fca81058 | ||
|
|
43e11574e1 | ||
|
|
d6dba0456c | ||
|
|
c07c4509e4 | ||
|
|
ac2b68fc1b | ||
|
|
a48c9c3b4a | ||
|
|
a20bac6a66 | ||
|
|
b3ef8171e2 | ||
|
|
e1c0fa5feb | ||
|
|
6662a3f78a | ||
|
|
ea065a674d | ||
|
|
498bfcd24b | ||
|
|
e485ac9981 | ||
|
|
d5b5fbd274 | ||
|
|
8563218cd2 | ||
|
|
62b7c52329 | ||
|
|
fc7e7640ed | ||
|
|
9c99bce054 | ||
|
|
f22b42c2cd | ||
|
|
7f4246a916 | ||
|
|
dab982f39b | ||
|
|
a433fa3fcd | ||
|
|
ba4137d1e8 | ||
|
|
142f661737 | ||
|
|
5451a4830f | ||
|
|
965c77525c | ||
|
|
4b96b63166 | ||
|
|
37017334af | ||
|
|
a95d64b7de | ||
|
|
cd76a504ac | ||
|
|
a57ce2a709 | ||
|
|
9075326bb7 | ||
|
|
9ba6ab49ac | ||
|
|
0553250997 | ||
|
|
aedbda5a75 | ||
|
|
ed13de131d | ||
|
|
d8bdea11c5 | ||
|
|
5d150c3151 | ||
|
|
0dc9ed2b5d | ||
|
|
76c835a00e | ||
|
|
8df745a281 | ||
|
|
d198a57d99 | ||
|
|
831b6d3ad6 | ||
|
|
670efb38d9 | ||
|
|
15a3f8ef2a | ||
|
|
37be84483c | ||
|
|
95e25ad40f | ||
|
|
46af6667dd | ||
|
|
540e0ab2d1 | ||
|
|
eeca366092 | ||
|
|
7a812fbe39 | ||
|
|
3dabb2970d | ||
|
|
21732a58c9 | ||
|
|
cc9bbff78d |
@@ -13,6 +13,7 @@ tags
|
||||
TAGS
|
||||
cscope.*
|
||||
*.patch
|
||||
*.orig
|
||||
|
||||
# Object files and libraries
|
||||
*.[oa]
|
||||
@@ -28,6 +29,11 @@ Makefile
|
||||
|
||||
/_pli_types.h
|
||||
config.h
|
||||
/tgt-pcb/pcb_config.h
|
||||
/tgt-pcb/fp.cc
|
||||
/tgt-pcb/fp.h
|
||||
/tgt-pcb/fp.output
|
||||
/tgt-pcb/fp_lex.cc
|
||||
/tgt-vvp/vvp_config.h
|
||||
/tgt-vhdl/vhdl_config.h
|
||||
/vpi/vpi_config.h
|
||||
@@ -45,6 +51,8 @@ dep
|
||||
*.vpi
|
||||
/cadpli/cadpli.vpl
|
||||
|
||||
/tgt-blif/Makefile
|
||||
|
||||
# lex, yacc and gperf output
|
||||
/driver/cflexor.c
|
||||
/driver/cfparse.c
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef __AStatement_H
|
||||
#define __AStatement_H
|
||||
#ifndef IVL_AStatement_H
|
||||
#define IVL_AStatement_H
|
||||
/*
|
||||
* Copyright (c) 2008 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2008-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <map>
|
||||
@@ -82,4 +82,4 @@ class AProcess : public LineInfo {
|
||||
AProcess& operator= (const AProcess&);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_AStatement_H */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __Attrib_H
|
||||
#define __Attrib_H
|
||||
#ifndef IVL_Attrib_H
|
||||
#define IVL_Attrib_H
|
||||
/*
|
||||
* Copyright (c) 2000-2009 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2000-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "StringHeap.h"
|
||||
@@ -57,4 +57,4 @@ class Attrib {
|
||||
Attrib& operator= (const Attrib&);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_Attrib_H */
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
@@ -225,7 +225,7 @@ impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -22,30 +22,32 @@
|
||||
# include <iostream>
|
||||
# include <cstring>
|
||||
# include <cstdlib>
|
||||
# include <climits>
|
||||
|
||||
using namespace std;
|
||||
|
||||
hname_t::hname_t()
|
||||
{
|
||||
number_ = INT_MIN;
|
||||
}
|
||||
|
||||
hname_t::hname_t(perm_string text)
|
||||
: name_(text)
|
||||
{
|
||||
name_ = text;
|
||||
number_ = INT_MIN;
|
||||
}
|
||||
|
||||
hname_t::hname_t(perm_string text, int num)
|
||||
: name_(text), number_(1)
|
||||
{
|
||||
number_[0] = num;
|
||||
}
|
||||
|
||||
hname_t::hname_t(perm_string text, vector<int>&nums)
|
||||
: name_(text), number_(nums)
|
||||
{
|
||||
name_ = text;
|
||||
number_ = num;
|
||||
}
|
||||
|
||||
hname_t::hname_t(const hname_t&that)
|
||||
: name_(that.name_), number_(that.number_)
|
||||
{
|
||||
name_ = that.name_;
|
||||
number_ = that.number_;
|
||||
}
|
||||
|
||||
hname_t& hname_t::operator = (const hname_t&that)
|
||||
@@ -55,24 +57,50 @@ hname_t& hname_t::operator = (const hname_t&that)
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator < (const hname_t&l, const hname_t&r)
|
||||
bool hname_t::operator < (const hname_t&r) const
|
||||
{
|
||||
int cmp = strcmp(l.peek_name(), r.peek_name());
|
||||
int cmp = strcmp(name_, r.name_);
|
||||
if (cmp < 0) return true;
|
||||
if (cmp > 0) return false;
|
||||
if (l.has_number() && r.has_number())
|
||||
return l.peek_number() < r.peek_number();
|
||||
else
|
||||
return false;
|
||||
|
||||
// The text parts are equal, so compare then number
|
||||
// parts. Finish as soon as we find one to be less or more
|
||||
// than the other.
|
||||
size_t idx = 0;
|
||||
while (number_.size() > idx || r.number_.size() > idx) {
|
||||
|
||||
// Ran out of l numbers, so less.
|
||||
if (number_.size() <= idx)
|
||||
return true;
|
||||
|
||||
// Ran out of r numbers, so greater.
|
||||
if (r.number_.size() <= idx)
|
||||
return false;
|
||||
|
||||
if (number_[idx] < r.number_[idx])
|
||||
return true;
|
||||
|
||||
if (number_[idx] > r.number_[idx])
|
||||
return false;
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
// Fall-through means that we are equal, including all the
|
||||
// number parts, so not less.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator == (const hname_t&l, const hname_t&r)
|
||||
bool hname_t::operator == (const hname_t&r) const
|
||||
{
|
||||
if (l.peek_name() == r.peek_name()) {
|
||||
if (l.has_number() && r.has_number())
|
||||
return l.peek_number() == r.peek_number();
|
||||
else
|
||||
return true;
|
||||
if (name_ == r.name_) {
|
||||
if (number_.size() != r.number_.size())
|
||||
return false;
|
||||
|
||||
for (size_t idx = 0 ; idx < number_.size() ; idx += 1)
|
||||
if (number_[idx] != r.number_[idx]) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -86,8 +114,8 @@ ostream& operator<< (ostream&out, const hname_t&that)
|
||||
}
|
||||
|
||||
out << that.peek_name();
|
||||
if (that.has_number())
|
||||
out << "[" << that.peek_number() << "]";
|
||||
for (size_t idx = 0 ; idx < that.number_.size() ; idx += 1)
|
||||
out << "[" << that.number_[idx] << "]";
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __HName_H
|
||||
#define __HName_H
|
||||
#ifndef IVL_HName_H
|
||||
#define IVL_HName_H
|
||||
/*
|
||||
* Copyright (c) 2001-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,18 +16,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <iostream>
|
||||
# include <list>
|
||||
# include <vector>
|
||||
# include "StringHeap.h"
|
||||
# include <climits>
|
||||
#ifdef __GNUC__
|
||||
#if __GNUC__ > 2
|
||||
using namespace std;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
# include <cassert>
|
||||
|
||||
/*
|
||||
* This class represents a component of a Verilog hierarchical name. A
|
||||
@@ -39,27 +36,33 @@ using namespace std;
|
||||
|
||||
class hname_t {
|
||||
|
||||
friend ostream& operator<< (ostream&out, const hname_t&that);
|
||||
|
||||
public:
|
||||
hname_t ();
|
||||
explicit hname_t (perm_string text);
|
||||
explicit hname_t (perm_string text, int num);
|
||||
explicit hname_t (perm_string text, std::vector<int>&nums);
|
||||
hname_t (const hname_t&that);
|
||||
~hname_t();
|
||||
|
||||
hname_t& operator= (const hname_t&);
|
||||
|
||||
bool operator == (const hname_t&that) const;
|
||||
bool operator < (const hname_t&that) const;
|
||||
|
||||
// Return the string part of the hname_t.
|
||||
perm_string peek_name(void) const;
|
||||
|
||||
bool has_number() const;
|
||||
int peek_number() const;
|
||||
size_t has_numbers() const;
|
||||
int peek_number(size_t idx) const;
|
||||
|
||||
private:
|
||||
perm_string name_;
|
||||
// If the number is anything other than INT_MIN, then this is
|
||||
// the numeric part of the name. Otherwise, it is not part of
|
||||
// the name at all.
|
||||
int number_;
|
||||
std::vector<int> number_;
|
||||
|
||||
private: // not implemented
|
||||
};
|
||||
@@ -73,18 +76,17 @@ inline perm_string hname_t::peek_name(void) const
|
||||
return name_;
|
||||
}
|
||||
|
||||
inline int hname_t::peek_number() const
|
||||
inline int hname_t::peek_number(size_t idx) const
|
||||
{
|
||||
return number_;
|
||||
assert(number_.size() > idx);
|
||||
return number_[idx];
|
||||
}
|
||||
|
||||
inline bool hname_t::has_number() const
|
||||
inline size_t hname_t::has_numbers() const
|
||||
{
|
||||
return number_ != INT_MIN;
|
||||
return number_.size();
|
||||
}
|
||||
|
||||
extern bool operator < (const hname_t&, const hname_t&);
|
||||
extern bool operator == (const hname_t&, const hname_t&);
|
||||
extern ostream& operator<< (ostream&, const hname_t&);
|
||||
|
||||
inline bool operator != (const hname_t&l, const hname_t&r)
|
||||
@@ -102,4 +104,4 @@ inline ostream& operator<< (ostream&out, const list<hname_t>&ll)
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* IVL_HName_H */
|
||||
|
||||
+42
-28
@@ -12,9 +12,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307, USA
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -39,7 +38,7 @@ srcdir = @srcdir@
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
SUBDIRS = ivlpp vhdlpp vvp vpi libveriuser cadpli tgt-null tgt-stub tgt-vvp \
|
||||
tgt-vhdl tgt-vlog95 driver
|
||||
tgt-vhdl tgt-vlog95 tgt-pcb tgt-blif tgt-sizer driver
|
||||
# Only run distclean for these directories.
|
||||
NOTUSED = tgt-fpga tgt-pal tgt-verilog
|
||||
|
||||
@@ -67,9 +66,13 @@ mandir = @mandir@
|
||||
|
||||
dllib=@DLLIB@
|
||||
|
||||
CC = @CC@
|
||||
# For a cross compile these defines will need to be set accordingly.
|
||||
HOSTCC = @CC@
|
||||
HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@
|
||||
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
@@ -83,14 +86,15 @@ GIT = @GIT@
|
||||
ifeq (@srcdir@,.)
|
||||
INCLUDE_PATH = -I. -Ilibmisc
|
||||
else
|
||||
INCLUDE_PATH = -I. -Ilibmisc -I$(srcdir) -I$(srcdir)/libmisc
|
||||
INCLUDE_PATH = -I. -I$(srcdir) -I$(srcdir)/libmisc
|
||||
endif
|
||||
|
||||
CPPFLAGS = @DEFS@ $(INCLUDE_PATH) @CPPFLAGS@
|
||||
CFLAGS = @WARNING_FLAGS@ @CFLAGS@
|
||||
CFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@
|
||||
CXXFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CXX@ @CXXFLAGS@
|
||||
PICFLAGS = @PICFLAG@
|
||||
LDFLAGS = @rdynamic@ @LDFLAGS@
|
||||
CTARGETFLAGS = @CTARGETFLAGS@
|
||||
|
||||
# Source files in the libmisc directory
|
||||
M = LineInfo.o StringHeap.o
|
||||
@@ -100,16 +104,21 @@ FF = cprop.o nodangle.o synth.o synth2.o syn-rules.o
|
||||
|
||||
O = main.o async.o design_dump.o discipline.o dup_expr.o elaborate.o \
|
||||
elab_expr.o elaborate_analog.o elab_lval.o elab_net.o \
|
||||
elab_scope.o elab_sig.o elab_sig_analog.o emit.o eval.o eval_attrib.o \
|
||||
elab_scope.o elab_sig.o elab_sig_analog.o elab_type.o \
|
||||
emit.o eval.o eval_attrib.o \
|
||||
eval_tree.o expr_synth.o functor.o lexor.o lexor_keyword.o link_const.o \
|
||||
load_module.o netlist.o netmisc.o net_analog.o net_assign.o net_design.o \
|
||||
netenum.o net_event.o net_expr.o net_func.o net_link.o net_modulo.o \
|
||||
load_module.o netlist.o netmisc.o nettypes.o net_analog.o net_assign.o \
|
||||
net_design.o netclass.o netdarray.o \
|
||||
netenum.o netparray.o netqueue.o netscalar.o netstruct.o netvector.o \
|
||||
net_event.o net_expr.o net_func.o \
|
||||
net_func_eval.o net_link.o net_modulo.o \
|
||||
net_nex_input.o net_nex_output.o net_proc.o net_scope.o net_tran.o \
|
||||
net_udp.o pad_to_width.o parse.o parse_misc.o pform.o pform_analog.o \
|
||||
pform_disciplines.o pform_dump.o pform_types.o \
|
||||
pform_disciplines.o pform_dump.o pform_package.o pform_pclass.o \
|
||||
pform_class_type.o pform_string_type.o pform_struct_type.o pform_types.o \
|
||||
symbol_search.o sync.o sys_funcs.o verinum.o verireal.o target.o \
|
||||
Attrib.o HName.o Module.o PDelays.o PEvent.o PExpr.o PGate.o \
|
||||
PGenerate.o PScope.o PSpec.o PTask.o PUdp.o PFunction.o PWire.o \
|
||||
Attrib.o HName.o Module.o PClass.o PDelays.o PEvent.o PExpr.o PGate.o \
|
||||
PGenerate.o PPackage.o PScope.o PSpec.o PTask.o PUdp.o PFunction.o PWire.o \
|
||||
Statement.o AStatement.o $M $(FF) $(TT)
|
||||
|
||||
all: dep config.h _pli_types.h version_tag.h ivl@EXEEXT@ version.exe iverilog-vpi.man
|
||||
@@ -120,7 +129,7 @@ all: dep config.h _pli_types.h version_tag.h ivl@EXEEXT@ version.exe iverilog-vp
|
||||
ifeq (@MINGW32@,yes)
|
||||
all: dosify.exe
|
||||
dosify.exe: $(srcdir)/dosify.c
|
||||
$(CC) -o dosify.exe $(srcdir)/dosify.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o dosify.exe $(srcdir)/dosify.c
|
||||
endif
|
||||
|
||||
# This rule rules the compiler in the trivial hello.vl program to make
|
||||
@@ -146,8 +155,8 @@ endif
|
||||
clean:
|
||||
$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@ && ) true
|
||||
rm -f *.o parse.cc parse.h lexor.cc
|
||||
rm -f ivl.exp iverilog-vpi.man iverilog-vpi.pdf iverilog-vpi.ps parse.output
|
||||
rm -f syn-rules.output dosify.exe ivl@EXEEXT@ check.vvp
|
||||
rm -f ivl.exp iverilog-vpi.man iverilog-vpi.pdf iverilog-vpi.ps
|
||||
rm -f parse.output syn-rules.output dosify.exe ivl@EXEEXT@ check.vvp
|
||||
rm -f lexor_keyword.cc libivl.a libvpi.a iverilog-vpi syn-rules.cc
|
||||
rm -rf dep
|
||||
rm -f version.exe
|
||||
@@ -165,8 +174,10 @@ endif
|
||||
rm -rf autom4te.cache
|
||||
|
||||
cppcheck: $(O:.o=.cc) $(srcdir)/dosify.c $(srcdir)/version.c
|
||||
cppcheck --enable=all -f --suppressions $(srcdir)/cppcheck.sup \
|
||||
$(INCLUDE_PATH) $^
|
||||
cppcheck --enable=all -f --suppressions-list=$(srcdir)/cppcheck.sup \
|
||||
-UYYPARSE_PARAM -UYYPRINT -Ushort -Usize_t -Uyyoverflow \
|
||||
-UYYTYPE_INT8 -UYYTYPE_INT16 -UYYTYPE_UINT8 -UYYTYPE_UINT16 \
|
||||
--relative-paths=$(srcdir) $(INCLUDE_PATH) $^
|
||||
|
||||
cppcheck-all:
|
||||
$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) cppcheck && ) true
|
||||
@@ -203,7 +214,7 @@ ifeq (@WIN32@,yes)
|
||||
# that really exports the things that the import library imports.
|
||||
ivl@EXEEXT@: $O $(srcdir)/ivl.def
|
||||
$(CXX) -o ivl@EXEEXT@ $O $(dllib) @EXTRALIBS@
|
||||
dlltool --dllname ivl@EXEEXT@ --def $(srcdir)/ivl.def \
|
||||
$(DLLTOOL) --dllname ivl@EXEEXT@ --def $(srcdir)/ivl.def \
|
||||
--output-lib libivl.a --output-exp ivl.exp
|
||||
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ ivl.exp $O $(dllib) @EXTRALIBS@
|
||||
else
|
||||
@@ -221,13 +232,14 @@ iverilog-vpi: $(srcdir)/iverilog-vpi.sh Makefile
|
||||
-e 's;@IVCXX@;$(CXX);' \
|
||||
-e 's;@IVCFLAGS@;$(CFLAGS);' \
|
||||
-e 's;@IVCXXFLAGS@;$(CXXFLAGS);' \
|
||||
-e 's;@IVCTARGETFLAGS@;$(CTARGETFLAGS);' \
|
||||
-e 's;@INCLUDEDIR@;$(includedir);' \
|
||||
-e 's;@LIBDIR@;@libdir@;' $< > $@
|
||||
chmod +x $@
|
||||
endif
|
||||
|
||||
version.exe: $(srcdir)/version.c $(srcdir)/version_base.h version_tag.h
|
||||
$(HOSTCC) @WARNING_FLAGS@ -o version.exe -I. -I$(srcdir) $(srcdir)/version.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o version.exe -I. -I$(srcdir) $(srcdir)/version.c
|
||||
|
||||
%.o: %.cc config.h
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o
|
||||
@@ -240,20 +252,22 @@ lexor.o: lexor.cc parse.h
|
||||
|
||||
parse.o: parse.cc
|
||||
|
||||
parse.cc parse.h: $(srcdir)/parse.y
|
||||
$(YACC) --verbose -t -p VL -d -o parse.cc $(srcdir)/parse.y
|
||||
mv parse.cc.h parse.h 2>/dev/null || mv parse.hh parse.h
|
||||
# Build this in two steps to avoid parallel build issues (see pr3462585)
|
||||
parse.cc: $(srcdir)/parse.y
|
||||
$(YACC) --verbose -t -p VL -d -o $@ $<
|
||||
parse.h: parse.cc
|
||||
mv parse.cc.h $@ 2>/dev/null || mv parse.hh $@
|
||||
|
||||
syn-rules.cc: $(srcdir)/syn-rules.y
|
||||
$(YACC) --verbose -p syn_ -o syn-rules.cc $(srcdir)/syn-rules.y
|
||||
$(YACC) --verbose -t -p syn_ -o $@ $<
|
||||
|
||||
lexor.cc: $(srcdir)/lexor.lex
|
||||
$(LEX) -s -olexor.cc $(srcdir)/lexor.lex
|
||||
$(LEX) -s -t $< > $@
|
||||
|
||||
lexor_keyword.o: lexor_keyword.cc parse.h
|
||||
|
||||
lexor_keyword.cc: $(srcdir)/lexor_keyword.gperf
|
||||
gperf -o -i 7 -C -k 1-4,6,9,$$ -L ANSI-C -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false)
|
||||
gperf -o -i 7 -C -k 1-4,6,9,$$ -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false)
|
||||
|
||||
iverilog-vpi.man: $(srcdir)/iverilog-vpi.man.in version.exe
|
||||
./version.exe `head -1 $(srcdir)/iverilog-vpi.man.in`'\n' > $@
|
||||
@@ -368,9 +382,9 @@ uninstall:
|
||||
-rmdir "$(DESTDIR)$(libdir)/ivl$(suffix)"
|
||||
for f in verilog$(suffix) iverilog-vpi$(suffix) gverilog$(suffix)@EXEEXT@; \
|
||||
do rm -f "$(DESTDIR)$(bindir)/$$f"; done
|
||||
for f in ivl_target.h vpi_user.h _pli_types.h acc_user.h veriuser.h; \
|
||||
for f in ivl_target.h vpi_user.h _pli_types.h sv_vpi_user.h acc_user.h veriuser.h; \
|
||||
do rm -f "$(DESTDIR)$(includedir)/$$f"; done
|
||||
-test X$(suffix) = X || rmdir "$(DESTDIR)/$(includedir)"
|
||||
-test X$(suffix) = X || rmdir "$(DESTDIR)$(includedir)"
|
||||
rm -f "$(DESTDIR)$(mandir)/man1/iverilog-vpi$(suffix).1" "$(DESTDIR)$(prefix)/iverilog-vpi$(suffix).pdf"
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -27,11 +27,12 @@
|
||||
list<Module::named_expr_t> Module::user_defparms;
|
||||
|
||||
/* n is a permallocated string. */
|
||||
Module::Module(perm_string n)
|
||||
: PScope(n)
|
||||
Module::Module(LexicalScope*parent, perm_string n)
|
||||
: PScopeExtra(n, parent)
|
||||
{
|
||||
library_flag = false;
|
||||
is_cell = false;
|
||||
program_block = false;
|
||||
uc_drive = UCD_NONE;
|
||||
timescale_warn_done = false;
|
||||
time_unit = 0;
|
||||
@@ -89,6 +90,22 @@ unsigned Module::find_port(const char*name) const
|
||||
return ports.size();
|
||||
}
|
||||
|
||||
perm_string Module::get_port_name(unsigned idx) const
|
||||
{
|
||||
|
||||
assert(idx < ports.size());
|
||||
if (ports[idx] == 0) {
|
||||
/* It is possible to have undeclared ports. These
|
||||
are ports that are skipped in the declaration,
|
||||
for example like so: module foo(x ,, y); The
|
||||
port between x and y is unnamed and thus
|
||||
inaccessible to binding by name. */
|
||||
return perm_string::literal("");
|
||||
}
|
||||
return ports[idx]->name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PGate* Module::get_gate(perm_string name)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __Module_H
|
||||
#define __Module_H
|
||||
#ifndef IVL_Module_H
|
||||
#define IVL_Module_H
|
||||
/*
|
||||
* Copyright (c) 1998-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class NetScope;
|
||||
* therefore the handle for grasping the described circuit.
|
||||
*/
|
||||
|
||||
class Module : public PScope, public LineInfo {
|
||||
class Module : public PScopeExtra, public LineInfo {
|
||||
|
||||
/* The module ports are in general a vector of port_t
|
||||
objects. Each port has a name and an ordered list of
|
||||
@@ -65,7 +65,7 @@ class Module : public PScope, public LineInfo {
|
||||
public:
|
||||
/* The name passed here is the module name, not the instance
|
||||
name. This make must be a permallocated string. */
|
||||
explicit Module(perm_string name);
|
||||
explicit Module(LexicalScope*parent, perm_string name);
|
||||
~Module();
|
||||
|
||||
/* Initially false. This is set to true if the module has been
|
||||
@@ -76,13 +76,18 @@ class Module : public PScope, public LineInfo {
|
||||
|
||||
bool is_cell;
|
||||
|
||||
/* This is true if the module represents a program block
|
||||
instead of a module/cell. Program blocks have content
|
||||
restrictions and slightly modify scheduling semantics. */
|
||||
bool program_block;
|
||||
|
||||
enum UCDriveType { UCD_NONE, UCD_PULL0, UCD_PULL1 };
|
||||
UCDriveType uc_drive;
|
||||
|
||||
/* specparams are simpler than other params, in that they have
|
||||
no type information. They are merely constant
|
||||
expressions. */
|
||||
map<perm_string,PExpr*>specparams;
|
||||
/* specparams are simpler than other parameters, in that they
|
||||
can have a range, but not an explicit type. The restrictions
|
||||
are enforced by the parser. */
|
||||
map<perm_string,param_expr_t>specparams;
|
||||
|
||||
/* The module also has defparam assignments which don't create
|
||||
new parameters within the module, but may be used to set
|
||||
@@ -112,14 +117,14 @@ class Module : public PScope, public LineInfo {
|
||||
bool time_from_timescale;
|
||||
bool timescale_warn_done;
|
||||
|
||||
/* Task definitions within this module */
|
||||
map<perm_string,PTask*> tasks;
|
||||
map<perm_string,PFunction*> funcs;
|
||||
|
||||
/* The module has a list of generate schemes that appear in
|
||||
the module definition. These are used at elaboration time. */
|
||||
list<PGenerate*> generate_schemes;
|
||||
|
||||
/* Nested modules are placed here, and are not elaborated
|
||||
unless they are instantiated, implicitly or explicitly. */
|
||||
std::map<perm_string,Module*> nested_modules;
|
||||
|
||||
list<PSpecPath*> specify_paths;
|
||||
|
||||
// The mod_name() is the name of the module type.
|
||||
@@ -131,6 +136,9 @@ class Module : public PScope, public LineInfo {
|
||||
const vector<PEIdent*>& get_port(unsigned idx) const;
|
||||
unsigned find_port(const char*name) const;
|
||||
|
||||
// Return port name ("" for undeclared port)
|
||||
perm_string get_port_name(unsigned idx) const;
|
||||
|
||||
PGate* get_gate(perm_string name);
|
||||
|
||||
const list<PGate*>& get_gates() const;
|
||||
@@ -144,6 +152,7 @@ class Module : public PScope, public LineInfo {
|
||||
bool elaborate_sig(Design*, NetScope*scope) const;
|
||||
|
||||
private:
|
||||
void dump_specparams_(ostream&out, unsigned indent) const;
|
||||
list<PGate*> gates_;
|
||||
|
||||
private: // Not implemented
|
||||
@@ -151,4 +160,4 @@ class Module : public PScope, public LineInfo {
|
||||
Module& operator= (const Module&);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_Module_H */
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
* General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PClass.h"
|
||||
|
||||
PClass::PClass(perm_string name, LexicalScope*parent)
|
||||
: PScopeExtra(name, parent), type(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PClass::~PClass()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
#ifndef IVL_PClass_H
|
||||
#define IVL_PClass_H
|
||||
/*
|
||||
* Copyright (c) 2012-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
* General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PScope.h"
|
||||
# include "LineInfo.h"
|
||||
# include "StringHeap.h"
|
||||
# include <iostream>
|
||||
|
||||
class PChainConstructor;
|
||||
|
||||
/*
|
||||
* SystemVerilog supports class declarations with their own lexical
|
||||
* scope, etc. The parser arranges for these to be created and
|
||||
* collected.
|
||||
*/
|
||||
|
||||
class PClass : public PScopeExtra, public LineInfo {
|
||||
|
||||
public:
|
||||
explicit PClass (perm_string name, LexicalScope*parent);
|
||||
~PClass();
|
||||
|
||||
void dump(std::ostream&out, unsigned indent) const;
|
||||
|
||||
public:
|
||||
class_type_t*type;
|
||||
};
|
||||
|
||||
#endif /* IVL_PClass_H */
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PDelays_H
|
||||
#define __PDelays_H
|
||||
#ifndef IVL_PDelays_H
|
||||
#define IVL_PDelays_H
|
||||
/*
|
||||
* Copyright (c) 1999-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1999-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "svector.h"
|
||||
@@ -72,4 +72,4 @@ class PDelays {
|
||||
|
||||
ostream& operator << (ostream&o, const PDelays&);
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PDelays_H */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PEvent_H
|
||||
#define __PEvent_H
|
||||
#ifndef IVL_PEvent_H
|
||||
#define IVL_PEvent_H
|
||||
/*
|
||||
* Copyright (c) 2000-2004 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2000-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "LineInfo.h"
|
||||
@@ -51,4 +51,4 @@ class PEvent : public LineInfo {
|
||||
PEvent& operator= (const PEvent&);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PEvent_H */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2011 Stephen Williams <[email protected]>
|
||||
* Copyright (c) 1998-2012 Stephen Williams <[email protected]>
|
||||
* Copyright CERN 2013 / Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -76,6 +77,44 @@ bool PExpr::is_collapsible_net(Design*, NetScope*) const
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const char* PExpr::width_mode_name(width_mode_t mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case PExpr::SIZED:
|
||||
return "sized";
|
||||
case PExpr::UNSIZED:
|
||||
return "unsized";
|
||||
case PExpr::EXPAND:
|
||||
return "expand";
|
||||
case PExpr::LOSSLESS:
|
||||
return "lossless";
|
||||
case PExpr::UPSIZE:
|
||||
return "upsize";
|
||||
default:
|
||||
return "??";
|
||||
}
|
||||
}
|
||||
|
||||
PEAssignPattern::PEAssignPattern()
|
||||
{
|
||||
}
|
||||
|
||||
PEAssignPattern::PEAssignPattern(const list<PExpr*>&p)
|
||||
: parms_(p.size())
|
||||
{
|
||||
size_t idx = 0;
|
||||
for (list<PExpr*>::const_iterator cur = p.begin()
|
||||
; cur != p.end() ; ++cur) {
|
||||
parms_[idx] = *cur;
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
|
||||
PEAssignPattern::~PEAssignPattern()
|
||||
{
|
||||
}
|
||||
|
||||
PEBinary::PEBinary(char op, PExpr*l, PExpr*r)
|
||||
: op_(op), left_(l), right_(r)
|
||||
{
|
||||
@@ -107,6 +146,15 @@ PECastSize::~PECastSize()
|
||||
{
|
||||
}
|
||||
|
||||
PECastType::PECastType(data_type_t*t, PExpr*b)
|
||||
: target_(t), base_(b)
|
||||
{
|
||||
}
|
||||
|
||||
PECastType::~PECastType()
|
||||
{
|
||||
}
|
||||
|
||||
PEBComp::PEBComp(char op, PExpr*l, PExpr*r)
|
||||
: PEBinary(op, l, r)
|
||||
{
|
||||
@@ -156,7 +204,12 @@ PEBShift::~PEBShift()
|
||||
}
|
||||
|
||||
PECallFunction::PECallFunction(const pform_name_t&n, const vector<PExpr *> &parms)
|
||||
: path_(n), parms_(parms)
|
||||
: package_(0), path_(n), parms_(parms)
|
||||
{
|
||||
}
|
||||
|
||||
PECallFunction::PECallFunction(PPackage*pkg, const pform_name_t&n, const vector<PExpr *> &parms)
|
||||
: package_(pkg), path_(n), parms_(parms)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -168,19 +221,29 @@ static pform_name_t pn_from_ps(perm_string n)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
PECallFunction::PECallFunction(PPackage*pkg, perm_string n, const list<PExpr *> &parms)
|
||||
: package_(pkg), path_(pn_from_ps(n)), parms_(parms.size())
|
||||
{
|
||||
int tmp_idx = 0;
|
||||
assert(parms_.size() == parms.size());
|
||||
for (list<PExpr*>::const_iterator idx = parms.begin()
|
||||
; idx != parms.end() ; ++idx)
|
||||
parms_[tmp_idx++] = *idx;
|
||||
}
|
||||
|
||||
PECallFunction::PECallFunction(perm_string n, const vector<PExpr*>&parms)
|
||||
: path_(pn_from_ps(n)), parms_(parms)
|
||||
: package_(0), path_(pn_from_ps(n)), parms_(parms)
|
||||
{
|
||||
}
|
||||
|
||||
PECallFunction::PECallFunction(perm_string n)
|
||||
: path_(pn_from_ps(n))
|
||||
: package_(0), path_(pn_from_ps(n))
|
||||
{
|
||||
}
|
||||
|
||||
// NOTE: Anachronism. Try to work all use of svector out.
|
||||
PECallFunction::PECallFunction(const pform_name_t&n, const list<PExpr *> &parms)
|
||||
: path_(n), parms_(parms.size())
|
||||
: package_(0), path_(n), parms_(parms.size())
|
||||
{
|
||||
int tmp_idx = 0;
|
||||
assert(parms_.size() == parms.size());
|
||||
@@ -190,7 +253,7 @@ PECallFunction::PECallFunction(const pform_name_t&n, const list<PExpr *> &parms)
|
||||
}
|
||||
|
||||
PECallFunction::PECallFunction(perm_string n, const list<PExpr*>&parms)
|
||||
: path_(pn_from_ps(n)), parms_(parms.size())
|
||||
: package_(0), path_(pn_from_ps(n)), parms_(parms.size())
|
||||
{
|
||||
int tmp_idx = 0;
|
||||
assert(parms_.size() == parms.size());
|
||||
@@ -281,6 +344,14 @@ PExpr* PEEvent::expr() const
|
||||
return expr_;
|
||||
}
|
||||
|
||||
PENull::PENull(void)
|
||||
{
|
||||
}
|
||||
|
||||
PENull::~PENull()
|
||||
{
|
||||
}
|
||||
|
||||
PEFNumber::PEFNumber(verireal*v)
|
||||
: value_(v)
|
||||
{
|
||||
@@ -297,16 +368,21 @@ const verireal& PEFNumber::value() const
|
||||
}
|
||||
|
||||
PEIdent::PEIdent(const pform_name_t&that)
|
||||
: path_(that), no_implicit_sig_(false)
|
||||
: package_(0), path_(that), no_implicit_sig_(false)
|
||||
{
|
||||
}
|
||||
|
||||
PEIdent::PEIdent(perm_string s, bool no_implicit_sig)
|
||||
: no_implicit_sig_(no_implicit_sig)
|
||||
: package_(0), no_implicit_sig_(no_implicit_sig)
|
||||
{
|
||||
path_.push_back(name_component_t(s));
|
||||
}
|
||||
|
||||
PEIdent::PEIdent(PPackage*pkg, const pform_name_t&that)
|
||||
: package_(pkg), path_(that), no_implicit_sig_(true)
|
||||
{
|
||||
}
|
||||
|
||||
PEIdent::~PEIdent()
|
||||
{
|
||||
}
|
||||
@@ -346,7 +422,7 @@ void PEIdent::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
||||
PWire*net = new PWire(name, type, NetNet::NOT_A_PORT, IVL_VT_LOGIC);
|
||||
net->set_file(get_file());
|
||||
net->set_lineno(get_lineno());
|
||||
net->set_range(0, 0, SR_NET, true);
|
||||
net->set_range_scalar(SR_NET);
|
||||
scope->wires[name] = net;
|
||||
if (warn_implicit) {
|
||||
cerr << get_fileline() << ": warning: implicit "
|
||||
@@ -363,7 +439,7 @@ bool PEIdent::has_aa_term(Design*des, NetScope*scope) const
|
||||
|
||||
const NetExpr*ex1, *ex2;
|
||||
|
||||
scope = symbol_search(0, des, scope, path_, net, par, eve, ex1, ex2);
|
||||
scope = symbol_search(this, des, scope, path_, net, par, eve, ex1, ex2);
|
||||
|
||||
if (scope)
|
||||
return scope->is_auto();
|
||||
@@ -371,6 +447,43 @@ bool PEIdent::has_aa_term(Design*des, NetScope*scope) const
|
||||
return false;
|
||||
}
|
||||
|
||||
PENewArray::PENewArray(PExpr*size_expr, PExpr*init_expr)
|
||||
: size_(size_expr), init_(init_expr)
|
||||
{
|
||||
}
|
||||
|
||||
PENewArray::~PENewArray()
|
||||
{
|
||||
delete size_;
|
||||
}
|
||||
|
||||
PENewClass::PENewClass(void)
|
||||
{
|
||||
}
|
||||
|
||||
PENewClass::PENewClass(const list<PExpr*>&p)
|
||||
: parms_(p.size())
|
||||
{
|
||||
size_t tmp_idx = 0;
|
||||
for (list<PExpr*>::const_iterator cur = p.begin()
|
||||
; cur != p.end() ; ++ cur) {
|
||||
parms_[tmp_idx++] = *cur;
|
||||
}
|
||||
}
|
||||
|
||||
PENewClass::~PENewClass()
|
||||
{
|
||||
}
|
||||
|
||||
PENewCopy::PENewCopy(PExpr*src)
|
||||
: src_(src)
|
||||
{
|
||||
}
|
||||
|
||||
PENewCopy::~PENewCopy()
|
||||
{
|
||||
}
|
||||
|
||||
PENumber::PENumber(verinum*vp)
|
||||
: value_(vp)
|
||||
{
|
||||
@@ -436,6 +549,15 @@ bool PETernary::has_aa_term(Design*des, NetScope*scope) const
|
||||
|| fal_->has_aa_term(des, scope);
|
||||
}
|
||||
|
||||
PETypename::PETypename(data_type_t*dt)
|
||||
: data_type_(dt)
|
||||
{
|
||||
}
|
||||
|
||||
PETypename::~PETypename()
|
||||
{
|
||||
}
|
||||
|
||||
PEUnary::PEUnary(char op, PExpr*ex)
|
||||
: op_(op), expr_(ex)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef __PExpr_H
|
||||
#define __PExpr_H
|
||||
#ifndef IVL_PExpr_H
|
||||
#define IVL_PExpr_H
|
||||
/*
|
||||
* Copyright (c) 1998-2011 Stephen Williams <[email protected]>
|
||||
* Copyright (c) 1998-2014 Stephen Williams <[email protected]>
|
||||
* Copyright CERN 2013 / Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +17,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <string>
|
||||
@@ -33,6 +34,7 @@ class LexicalScope;
|
||||
class NetNet;
|
||||
class NetExpr;
|
||||
class NetScope;
|
||||
class PPackage;
|
||||
|
||||
/*
|
||||
* The PExpr class hierarchy supports the description of
|
||||
@@ -43,12 +45,17 @@ class NetScope;
|
||||
class PExpr : public LineInfo {
|
||||
|
||||
public:
|
||||
enum width_mode_t { SIZED, EXPAND, LOSSLESS, UNSIZED };
|
||||
// Mode values used by test_width() (see below for description).
|
||||
enum width_mode_t { SIZED, UNSIZED, EXPAND, LOSSLESS, UPSIZE };
|
||||
|
||||
// Flag values that can be passed to elaborate_expr.
|
||||
// Flag values that can be passed to elaborate_expr().
|
||||
static const unsigned NO_FLAGS = 0x0;
|
||||
static const unsigned NEED_CONST = 0x1;
|
||||
static const unsigned SYS_TASK_ARG = 0x2;
|
||||
static const unsigned ANNOTATABLE = 0x4;
|
||||
|
||||
// Convert width mode to human-readable form.
|
||||
static const char*width_mode_name(width_mode_t mode);
|
||||
|
||||
PExpr();
|
||||
virtual ~PExpr();
|
||||
@@ -76,33 +83,42 @@ class PExpr : public LineInfo {
|
||||
// without changing the result. This allows the expression width to
|
||||
// be pruned when not all bits of the result are used.
|
||||
//
|
||||
// Normally mode should be initialised to SIZED before starting to
|
||||
// Normally mode should be initialized to SIZED before starting to
|
||||
// test the width of an expression. In SIZED mode the expression
|
||||
// width will be calculated strictly according to the IEEE standard
|
||||
// rules for expression width.
|
||||
// If the expression contains an unsized literal, mode will be
|
||||
// changed to LOSSLESS. In LOSSLESS mode the expression width will
|
||||
// be calculated as the minimum width necessary to avoid arithmetic
|
||||
// overflow or underflow.
|
||||
// If the expression both contains an unsized literal and contains
|
||||
// an operation that coerces a vector operand to a different type
|
||||
// (signed <-> unsigned), mode is changed to UNSIZED. UNSIZED mode
|
||||
// is the same as LOSSLESS, except that the final expression width
|
||||
// will be forced to be at least integer_width. This is necessary
|
||||
// to ensure compatibility with the IEEE standard, which requires
|
||||
// unsized literals to be treated as having the same width as an
|
||||
// integer. The lossless width calculation is inadequate in this
|
||||
// case because coercing an operand to a different type means that
|
||||
// the expression no longer obeys the normal rules of arithmetic.
|
||||
//
|
||||
// If mode is initialised to EXPAND instead of SIZED, the expression
|
||||
// If the expression is found to contain an unsized literal number
|
||||
// and gn_strict_expr_width_flag is set, mode will be changed to
|
||||
// UNSIZED. In UNSIZED mode the expression width will be calculated
|
||||
// exactly as in SIZED mode - the change in mode simply flags that
|
||||
// the expression contains an unsized numbers.
|
||||
//
|
||||
// If the expression is found to contain an unsized literal number
|
||||
// and gn_strict_expr_width_flag is not set, mode will be changed
|
||||
// to LOSSLESS. In LOSSLESS mode the expression width will be
|
||||
// calculated as the minimum width necessary to avoid arithmetic
|
||||
// overflow or underflow.
|
||||
//
|
||||
// Once in LOSSLESS mode, if the expression is found to contain
|
||||
// an operation that coerces a vector operand to a different type
|
||||
// (signed <-> unsigned), mode will be changed to UPSIZE. UPSIZE
|
||||
// mode is the same as LOSSLESS, except that the final expression
|
||||
// width will be forced to be at least integer_width. This is
|
||||
// necessary to ensure compatibility with the IEEE standard, which
|
||||
// requires unsized numbers to be treated as having the same width
|
||||
// as an integer. The lossless width calculation is inadequate in
|
||||
// this case because coercing an operand to a different type means
|
||||
// that the expression no longer obeys the normal rules of arithmetic.
|
||||
//
|
||||
// If mode is initialized to EXPAND instead of SIZED, the expression
|
||||
// width will be calculated as the minimum width necessary to avoid
|
||||
// arithmetic overflow or underflow, even if it contains no unsized
|
||||
// literals. mode will be changed LOSSLESS or UNSIZED as described
|
||||
// literals. mode will be changed LOSSLESS or UPSIZE as described
|
||||
// above. This supports a non-standard mode of expression width
|
||||
// calculation.
|
||||
//
|
||||
// When the final value of mode is UNSIZED, the width returned by
|
||||
// When the final value of mode is UPSIZE, the width returned by
|
||||
// this method is the calculated lossless width, but the width
|
||||
// returned by a subsequent call to the expr_width method will be
|
||||
// the final expression width.
|
||||
@@ -120,6 +136,13 @@ class PExpr : public LineInfo {
|
||||
// to be propagated down to any context-dependant operands.
|
||||
void cast_signed(bool flag) { signed_flag_ = flag; }
|
||||
|
||||
// This is the more generic form of the elaborate_expr method
|
||||
// below. The plan is to replace the simpler elaborate_expr
|
||||
// method with this version, which can handle more advanced
|
||||
// types. But for now, this is only implemented in special cases.
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
// Procedural elaboration of the expression. The expr_width is
|
||||
// the required width of the expression.
|
||||
//
|
||||
@@ -141,11 +164,12 @@ class PExpr : public LineInfo {
|
||||
|
||||
// Expressions that can be in the l-value of procedural
|
||||
// assignments can be elaborated with this method. If the
|
||||
// is_force flag is true, then the set of valid l-value types
|
||||
// is slightly modified to accommodate the Verilog force
|
||||
// statement
|
||||
// is_cassign or is_force flags are true, then the set of
|
||||
// valid l-value types is slightly modified to accommodate
|
||||
// the Verilog procedural continuous assignment statements.
|
||||
virtual NetAssign_* elaborate_lval(Design*des,
|
||||
NetScope*scope,
|
||||
bool is_cassign,
|
||||
bool is_force) const;
|
||||
|
||||
// This attempts to evaluate a constant expression, and return
|
||||
@@ -180,6 +204,29 @@ class PExpr : public LineInfo {
|
||||
|
||||
ostream& operator << (ostream&, const PExpr&);
|
||||
|
||||
class PEAssignPattern : public PExpr {
|
||||
public:
|
||||
explicit PEAssignPattern();
|
||||
explicit PEAssignPattern(const std::list<PExpr*>&p);
|
||||
~PEAssignPattern();
|
||||
|
||||
void dump(std::ostream&) const;
|
||||
|
||||
virtual unsigned test_width(Design*des, NetScope*scope, width_mode_t&mode);
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
private:
|
||||
NetExpr* elaborate_expr_darray_(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
private:
|
||||
std::vector<PExpr*>parms_;
|
||||
};
|
||||
|
||||
class PEConcat : public PExpr {
|
||||
|
||||
public:
|
||||
@@ -198,11 +245,16 @@ class PEConcat : public PExpr {
|
||||
|
||||
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope) const;
|
||||
virtual NetNet* elaborate_bi_net(Design*des, NetScope*scope) const;
|
||||
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
virtual NetAssign_* elaborate_lval(Design*des,
|
||||
NetScope*scope,
|
||||
bool is_cassign,
|
||||
bool is_force) const;
|
||||
virtual bool is_collapsible_net(Design*des, NetScope*scope) const;
|
||||
private:
|
||||
@@ -264,6 +316,8 @@ class PEFNumber : public PExpr {
|
||||
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
@@ -278,6 +332,7 @@ class PEIdent : public PExpr {
|
||||
|
||||
public:
|
||||
explicit PEIdent(perm_string, bool no_implicit_sig=false);
|
||||
explicit PEIdent(PPackage*pkg, const pform_name_t&name);
|
||||
explicit PEIdent(const pform_name_t&);
|
||||
~PEIdent();
|
||||
|
||||
@@ -302,15 +357,23 @@ class PEIdent : public PExpr {
|
||||
// Identifiers are also allowed as procedural assignment l-values.
|
||||
virtual NetAssign_* elaborate_lval(Design*des,
|
||||
NetScope*scope,
|
||||
bool is_cassign,
|
||||
bool is_force) const;
|
||||
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
|
||||
// Elaborate the PEIdent as a port to a module. This method
|
||||
// only applies to Ident expressions.
|
||||
NetNet* elaborate_port(Design*des, NetScope*sc) const;
|
||||
NetNet* elaborate_subport(Design*des, NetScope*sc) const;
|
||||
|
||||
// Elaborate the identifier allowing for unpacked arrays. This
|
||||
// method only applies to Ident expressions because only Ident
|
||||
// expressions can can be unpacked arrays.
|
||||
NetNet* elaborate_unpacked_net(Design*des, NetScope*sc) const;
|
||||
|
||||
verinum* eval_const(Design*des, NetScope*sc) const;
|
||||
|
||||
@@ -319,6 +382,7 @@ class PEIdent : public PExpr {
|
||||
const pform_name_t& path() const { return path_; }
|
||||
|
||||
private:
|
||||
PPackage*package_;
|
||||
pform_name_t path_;
|
||||
bool no_implicit_sig_;
|
||||
|
||||
@@ -328,6 +392,8 @@ class PEIdent : public PExpr {
|
||||
// elaborate/calculate, or false if there is some sort of
|
||||
// source error.
|
||||
|
||||
bool calculate_bits_(Design*, NetScope*, long&msb, bool&defined) const;
|
||||
|
||||
// The calculate_parts_ method calculates the range
|
||||
// expressions of a part select for the current object. The
|
||||
// part select expressions are elaborated and evaluated, and
|
||||
@@ -343,40 +409,71 @@ class PEIdent : public PExpr {
|
||||
|
||||
bool calculate_up_do_width_(Design*, NetScope*, unsigned long&wid) const;
|
||||
|
||||
// Evaluate the prefix indices. All but the final index in a
|
||||
// chain of indices must be a single value and must evaluate
|
||||
// to constants at compile time. For example:
|
||||
// [x] - OK
|
||||
// [1][2][x] - OK
|
||||
// [1][x:y] - OK
|
||||
// [2:0][x] - BAD
|
||||
// [y][x] - BAD
|
||||
// Leave the last index for special handling.
|
||||
bool calculate_packed_indices_(Design*des, NetScope*scope, NetNet*net,
|
||||
std::list<long>&prefix_indices) const;
|
||||
|
||||
private:
|
||||
NetAssign_*elaborate_lval_net_word_(Design*, NetScope*, NetNet*) const;
|
||||
bool elaborate_lval_net_bit_(Design*, NetScope*, NetAssign_*) const;
|
||||
NetAssign_*elaborate_lval_method_class_member_(Design*, NetScope*) const;
|
||||
NetAssign_*elaborate_lval_net_word_(Design*, NetScope*, NetNet*,
|
||||
bool need_const_idx) const;
|
||||
bool elaborate_lval_net_bit_(Design*, NetScope*, NetAssign_*,
|
||||
bool need_const_idx) const;
|
||||
bool elaborate_lval_net_part_(Design*, NetScope*, NetAssign_*) const;
|
||||
bool elaborate_lval_net_idx_(Design*, NetScope*, NetAssign_*,
|
||||
index_component_t::ctype_t) const;
|
||||
index_component_t::ctype_t,
|
||||
bool need_const_idx) const;
|
||||
NetAssign_*elaborate_lval_net_class_member_(Design*, NetScope*,
|
||||
NetNet*,
|
||||
const perm_string&) const;
|
||||
bool elaborate_lval_net_packed_member_(Design*, NetScope*,
|
||||
NetAssign_*,
|
||||
const perm_string&) const;
|
||||
bool elaborate_lval_darray_bit_(Design*, NetScope*,
|
||||
NetAssign_*) const;
|
||||
|
||||
private:
|
||||
NetExpr*elaborate_expr_param_(Design*des,
|
||||
NetScope*scope,
|
||||
const NetExpr*par,
|
||||
NetScope*found,
|
||||
NetScope*found_in,
|
||||
const NetExpr*par_msb,
|
||||
const NetExpr*par_lsb,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
NetExpr*elaborate_expr_param_bit_(Design*des,
|
||||
NetScope*scope,
|
||||
const NetExpr*par,
|
||||
NetScope*found_in,
|
||||
const NetExpr*par_msb,
|
||||
const NetExpr*par_lsb,
|
||||
bool need_const) const;
|
||||
NetExpr*elaborate_expr_param_part_(Design*des,
|
||||
NetScope*scope,
|
||||
const NetExpr*par,
|
||||
NetScope*found,
|
||||
NetScope*found_in,
|
||||
const NetExpr*par_msb,
|
||||
const NetExpr*par_lsb,
|
||||
unsigned expr_wid) const;
|
||||
NetExpr*elaborate_expr_param_idx_up_(Design*des,
|
||||
NetScope*scope,
|
||||
const NetExpr*par,
|
||||
NetScope*found,
|
||||
NetScope*found_in,
|
||||
const NetExpr*par_msb,
|
||||
const NetExpr*par_lsb,
|
||||
bool need_const) const;
|
||||
NetExpr*elaborate_expr_param_idx_do_(Design*des,
|
||||
NetScope*scope,
|
||||
const NetExpr*par,
|
||||
NetScope*found,
|
||||
NetScope*found_in,
|
||||
const NetExpr*par_msb,
|
||||
const NetExpr*par_lsb,
|
||||
bool need_const) const;
|
||||
@@ -412,15 +509,118 @@ class PEIdent : public PExpr {
|
||||
NetESignal*net,
|
||||
NetScope*found,
|
||||
bool need_const) const;
|
||||
NetExpr*elaborate_expr_net_bit_last_(Design*des,
|
||||
NetScope*scope,
|
||||
NetESignal*net,
|
||||
NetScope*found,
|
||||
bool need_const) const;
|
||||
|
||||
NetExpr*elaborate_expr_class_member_(Design*des,
|
||||
NetScope*scope,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
|
||||
unsigned test_width_method_(Design*des, NetScope*scope, width_mode_t&mode);
|
||||
NetExpr*elaborate_expr_method_(Design*des,
|
||||
NetScope*scope,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
|
||||
private:
|
||||
NetNet* elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
bool bidirectional_flag) const;
|
||||
|
||||
NetAssign_*scan_lname_for_nested_members_(Design*des, NetScope*scope,
|
||||
const pform_name_t&path) const;
|
||||
bool eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
long&midx, long&lidx) const;
|
||||
};
|
||||
|
||||
class PENewArray : public PExpr {
|
||||
|
||||
public:
|
||||
explicit PENewArray (PExpr*s, PExpr*i);
|
||||
~PENewArray();
|
||||
|
||||
virtual void dump(ostream&) const;
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
|
||||
private:
|
||||
PExpr*size_;
|
||||
PExpr*init_;
|
||||
};
|
||||
|
||||
class PENewClass : public PExpr {
|
||||
|
||||
public:
|
||||
// New without (or with default) constructor
|
||||
explicit PENewClass ();
|
||||
// New with constructor arguments
|
||||
explicit PENewClass (const std::list<PExpr*>&p);
|
||||
|
||||
~PENewClass();
|
||||
|
||||
virtual void dump(ostream&) const;
|
||||
// Class objects don't have a useful width, but the expression
|
||||
// is IVL_VT_CLASS.
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
// Note that class (new) expressions only appear in context
|
||||
// that uses this form of the elaborate_expr method. In fact,
|
||||
// the type argument is going to be a netclass_t object.
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
private:
|
||||
NetExpr* elaborate_expr_constructor_(Design*des, NetScope*scope,
|
||||
const netclass_t*ctype,
|
||||
NetExpr*obj, unsigned flags) const;
|
||||
|
||||
private:
|
||||
std::vector<PExpr*>parms_;
|
||||
};
|
||||
|
||||
class PENewCopy : public PExpr {
|
||||
public:
|
||||
explicit PENewCopy(PExpr*src);
|
||||
~PENewCopy();
|
||||
|
||||
virtual void dump(ostream&) const;
|
||||
// Class objects don't have a useful width, but the expression
|
||||
// is IVL_VT_CLASS.
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
// Note that class (new) expressions only appear in context
|
||||
// that uses this form of the elaborate_expr method. In fact,
|
||||
// the type argument is going to be a netclass_t object.
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
private:
|
||||
PExpr*src_;
|
||||
};
|
||||
|
||||
class PENull : public PExpr {
|
||||
public:
|
||||
explicit PENull();
|
||||
~PENull();
|
||||
|
||||
virtual void dump(ostream&) const;
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
};
|
||||
|
||||
class PENumber : public PExpr {
|
||||
|
||||
public:
|
||||
@@ -433,10 +633,13 @@ class PENumber : public PExpr {
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
|
||||
virtual NetExpr *elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
virtual NetEConst*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid, unsigned) const;
|
||||
virtual NetAssign_* elaborate_lval(Design*des,
|
||||
NetScope*scope,
|
||||
bool is_cassign,
|
||||
bool is_force) const;
|
||||
|
||||
virtual verinum* eval_const(Design*des, NetScope*sc) const;
|
||||
@@ -466,6 +669,9 @@ class PEString : public PExpr {
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
|
||||
virtual NetEConst*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
virtual NetEConst*elaborate_expr(Design*des, NetScope*,
|
||||
unsigned expr_wid, unsigned) const;
|
||||
verinum* eval_const(Design*, NetScope*) const;
|
||||
@@ -474,6 +680,23 @@ class PEString : public PExpr {
|
||||
char*text_;
|
||||
};
|
||||
|
||||
class PETypename : public PExpr {
|
||||
public:
|
||||
explicit PETypename(data_type_t*data_type);
|
||||
~PETypename();
|
||||
|
||||
virtual void dump(ostream&) const;
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
ivl_type_t type, unsigned flags) const;
|
||||
|
||||
inline data_type_t* get_type() const { return data_type_; }
|
||||
|
||||
private:
|
||||
data_type_t*data_type_;
|
||||
};
|
||||
|
||||
class PEUnary : public PExpr {
|
||||
|
||||
public:
|
||||
@@ -494,6 +717,10 @@ class PEUnary : public PExpr {
|
||||
unsigned flags) const;
|
||||
virtual verinum* eval_const(Design*des, NetScope*sc) const;
|
||||
|
||||
public:
|
||||
inline char get_op() const { return op_; }
|
||||
inline PExpr*get_expr() const { return expr_; }
|
||||
|
||||
private:
|
||||
NetExpr* elaborate_expr_bits_(NetExpr*operand, unsigned expr_wid) const;
|
||||
|
||||
@@ -650,7 +877,7 @@ class PETernary : public PExpr {
|
||||
private:
|
||||
NetExpr* elab_and_eval_alternative_(Design*des, NetScope*scope,
|
||||
PExpr*expr, unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
unsigned flags, bool short_cct) const;
|
||||
|
||||
private:
|
||||
PExpr*expr_;
|
||||
@@ -666,11 +893,18 @@ class PETernary : public PExpr {
|
||||
class PECallFunction : public PExpr {
|
||||
public:
|
||||
explicit PECallFunction(const pform_name_t&n, const vector<PExpr *> &parms);
|
||||
// Call function defined in package.
|
||||
explicit PECallFunction(PPackage*pkg, perm_string n, const std::vector<PExpr *> &parms);
|
||||
explicit PECallFunction(PPackage*pkg, perm_string n, const std::list<PExpr *> &parms);
|
||||
|
||||
// Used to convert a user function called as a task
|
||||
explicit PECallFunction(PPackage*pkg, const pform_name_t&n, const std::vector<PExpr *> &parms);
|
||||
|
||||
// Call of system function (name is not hierarchical)
|
||||
explicit PECallFunction(perm_string n, const vector<PExpr *> &parms);
|
||||
explicit PECallFunction(perm_string n);
|
||||
|
||||
// svector versions. Should be removed!
|
||||
// std::list versions. Should be removed!
|
||||
explicit PECallFunction(const pform_name_t&n, const list<PExpr *> &parms);
|
||||
explicit PECallFunction(perm_string n, const list<PExpr *> &parms);
|
||||
|
||||
@@ -690,13 +924,26 @@ class PECallFunction : public PExpr {
|
||||
width_mode_t&mode);
|
||||
|
||||
private:
|
||||
PPackage*package_;
|
||||
pform_name_t path_;
|
||||
vector<PExpr *> parms_;
|
||||
std::vector<PExpr *> parms_;
|
||||
|
||||
bool check_call_matches_definition_(Design*des, NetScope*dscope) const;
|
||||
|
||||
|
||||
NetExpr* cast_to_width_(NetExpr*expr, unsigned wid) const;
|
||||
|
||||
NetExpr*elaborate_expr_pkg_(Design*des, NetScope*scope,
|
||||
unsigned expr_wid, unsigned flags)const;
|
||||
NetExpr*elaborate_expr_method_(Design*des, NetScope*scope,
|
||||
unsigned expr_wid,
|
||||
bool add_this_flag = false) const;
|
||||
#if 0
|
||||
NetExpr*elaborate_expr_string_method_(Design*des, NetScope*scope) const;
|
||||
NetExpr*elaborate_expr_enum_method_(Design*des, NetScope*scope,
|
||||
unsigned expr_wid) const;
|
||||
#endif
|
||||
|
||||
NetExpr* elaborate_sfunc_(Design*des, NetScope*scope,
|
||||
unsigned expr_wid,
|
||||
unsigned flags) const;
|
||||
@@ -704,6 +951,16 @@ class PECallFunction : public PExpr {
|
||||
unsigned expr_wid) const;
|
||||
unsigned test_width_sfunc_(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
unsigned test_width_method_(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
|
||||
NetExpr*elaborate_base_(Design*des, NetScope*scope, NetScope*dscope,
|
||||
unsigned expr_wid, unsigned flags) const;
|
||||
|
||||
unsigned elaborate_arguments_(Design*des, NetScope*scope,
|
||||
NetFuncDef*def, bool need_const,
|
||||
std::vector<NetExpr*>&parms,
|
||||
unsigned parm_off) const;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -729,6 +986,28 @@ class PECastSize : public PExpr {
|
||||
PExpr* base_;
|
||||
};
|
||||
|
||||
/*
|
||||
* Support the SystemVerilog cast to a different type.
|
||||
*/
|
||||
class PECastType : public PExpr {
|
||||
|
||||
public:
|
||||
explicit PECastType(data_type_t*target, PExpr*base);
|
||||
~PECastType();
|
||||
|
||||
void dump(ostream &out) const;
|
||||
|
||||
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
|
||||
unsigned expr_wid, unsigned flags) const;
|
||||
|
||||
virtual unsigned test_width(Design*des, NetScope*scope,
|
||||
width_mode_t&mode);
|
||||
|
||||
private:
|
||||
data_type_t* target_;
|
||||
PExpr* base_;
|
||||
};
|
||||
|
||||
/*
|
||||
* This class is used for error recovery. All methods do nothing and return
|
||||
* null or default values.
|
||||
@@ -744,4 +1023,4 @@ class PEVoid : public PExpr {
|
||||
unsigned flags) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PExpr_H */
|
||||
|
||||
+47
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2008,2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1999-2013 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,30 +14,26 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
#include "PTask.h"
|
||||
# include "PTask.h"
|
||||
# include "Statement.h"
|
||||
# include <cassert>
|
||||
# include "ivl_assert.h"
|
||||
|
||||
PFunction::PFunction(perm_string name, LexicalScope*parent, bool is_auto__)
|
||||
: PScope(name, parent), ports_(0), statement_(0)
|
||||
: PTaskFunc(name, parent), statement_(0)
|
||||
{
|
||||
is_auto_ = is_auto__;
|
||||
return_type_.type = PTF_NONE;
|
||||
return_type_ = 0;
|
||||
}
|
||||
|
||||
PFunction::~PFunction()
|
||||
{
|
||||
}
|
||||
|
||||
void PFunction::set_ports(svector<PWire *>*p)
|
||||
{
|
||||
assert(ports_ == 0);
|
||||
ports_ = p;
|
||||
}
|
||||
|
||||
void PFunction::set_statement(Statement*s)
|
||||
{
|
||||
assert(s != 0);
|
||||
@@ -45,7 +41,45 @@ void PFunction::set_statement(Statement*s)
|
||||
statement_ = s;
|
||||
}
|
||||
|
||||
void PFunction::set_return(PTaskFuncArg t)
|
||||
void PFunction::push_statement_front(Statement*stmt)
|
||||
{
|
||||
// This can only happen after the statement is initially set.
|
||||
ivl_assert(*this, statement_);
|
||||
|
||||
// Get the PBlock of the statement. If it is not a PBlock,
|
||||
// then create one to wrap the existing statement and the new
|
||||
// statement that we're pushing.
|
||||
PBlock*blk = dynamic_cast<PBlock*> (statement_);
|
||||
if (blk == 0) {
|
||||
PBlock*tmp = new PBlock(PBlock::BL_SEQ);
|
||||
tmp->set_line(*this);
|
||||
vector<Statement*>tmp_list(1);
|
||||
tmp_list[0] = statement_;
|
||||
tmp->set_statement(tmp_list);
|
||||
|
||||
statement_ = tmp;
|
||||
blk = tmp;
|
||||
}
|
||||
|
||||
// Now do the push.
|
||||
blk->push_statement_front(stmt);
|
||||
}
|
||||
|
||||
void PFunction::set_return(data_type_t*t)
|
||||
{
|
||||
return_type_ = t;
|
||||
}
|
||||
|
||||
PChainConstructor* PFunction::extract_chain_constructor()
|
||||
{
|
||||
PChainConstructor*res = 0;
|
||||
|
||||
if ((res = dynamic_cast<PChainConstructor*> (statement_))) {
|
||||
statement_ = 0;
|
||||
|
||||
} else if (PBlock*blk = dynamic_cast<PBlock*>(statement_)) {
|
||||
res = blk->extract_chain_constructor();
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1999-2013 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -260,18 +260,22 @@ const char* PGBuiltin::gate_name() const
|
||||
}
|
||||
|
||||
PGModule::PGModule(perm_string type, perm_string name, list<PExpr*>*pins)
|
||||
: PGate(name, pins), overrides_(0), pins_(0),
|
||||
: PGate(name, pins), bound_type_(0), type_(type), overrides_(0), pins_(0),
|
||||
npins_(0), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
||||
{
|
||||
type_ = type;
|
||||
}
|
||||
|
||||
PGModule::PGModule(perm_string type, perm_string name,
|
||||
named<PExpr*>*pins, unsigned npins)
|
||||
: PGate(name, 0), overrides_(0), pins_(pins),
|
||||
: PGate(name, 0), bound_type_(0), type_(type), overrides_(0), pins_(pins),
|
||||
npins_(npins), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
||||
{
|
||||
type_ = type;
|
||||
}
|
||||
|
||||
PGModule::PGModule(Module*type, perm_string name)
|
||||
: PGate(name, 0), bound_type_(type), overrides_(0), pins_(0),
|
||||
npins_(0), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
||||
{
|
||||
}
|
||||
|
||||
PGModule::~PGModule()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PGate_H
|
||||
#define __PGate_H
|
||||
#ifndef IVL_PGate_H
|
||||
#define IVL_PGate_H
|
||||
/*
|
||||
* Copyright (c) 1998-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "svector.h"
|
||||
@@ -124,6 +124,7 @@ class PGAssign : public PGate {
|
||||
virtual bool elaborate_sig(Design*des, NetScope*scope) const;
|
||||
|
||||
private:
|
||||
void elaborate_unpacked_array_(Design*des, NetScope*scope, NetNet*lval) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -201,6 +202,9 @@ class PGModule : public PGate {
|
||||
explicit PGModule(perm_string type, perm_string name,
|
||||
named<PExpr*>*pins, unsigned npins);
|
||||
|
||||
// If the module type is known by design, then use this
|
||||
// constructor.
|
||||
explicit PGModule(Module*type, perm_string name);
|
||||
|
||||
~PGModule();
|
||||
|
||||
@@ -223,6 +227,7 @@ class PGModule : public PGate {
|
||||
perm_string get_type() const;
|
||||
|
||||
private:
|
||||
Module*bound_type_;
|
||||
perm_string type_;
|
||||
list<PExpr*>*overrides_;
|
||||
named<PExpr*>*pins_;
|
||||
@@ -255,4 +260,4 @@ class PGModule : public PGate {
|
||||
NetNet::PortType dir, bool as_signed) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PGate_H */
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PGenerate.h"
|
||||
|
||||
+9
-8
@@ -1,7 +1,7 @@
|
||||
#ifndef __PGenerate_H
|
||||
#define __PGenerate_H
|
||||
#ifndef IVL_PGenerate_H
|
||||
#define IVL_PGenerate_H
|
||||
/*
|
||||
* Copyright (c) 2006-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2006-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "LineInfo.h"
|
||||
@@ -80,6 +80,10 @@ class PGenerate : public LineInfo, public LexicalScope {
|
||||
// test value.
|
||||
std::valarray<PExpr*> item_test;
|
||||
|
||||
// defparam assignments found in this scope.
|
||||
typedef pair<pform_name_t,PExpr*> named_expr_t;
|
||||
list<named_expr_t>defparms;
|
||||
|
||||
list<PGate*> gates;
|
||||
void add_gate(PGate*);
|
||||
|
||||
@@ -87,9 +91,6 @@ class PGenerate : public LineInfo, public LexicalScope {
|
||||
map<perm_string,PTask*> tasks;
|
||||
map<perm_string,PFunction*>funcs;
|
||||
|
||||
// genvars declared within this scheme.
|
||||
map<perm_string,LineInfo*> genvars;
|
||||
|
||||
// Generate schemes can contain further generate schemes.
|
||||
list<PGenerate*> generate_schemes;
|
||||
// PGenerate*parent;
|
||||
@@ -138,4 +139,4 @@ class PGenerate : public LineInfo, public LexicalScope {
|
||||
|
||||
extern std::ostream& operator << (std::ostream&, PGenerate::scheme_t);
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PGenerate_H */
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Stephen Williams ([email protected])
|
||||
* Copyright CERN 2013 / Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
* General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PPackage.h"
|
||||
|
||||
PPackage::PPackage(perm_string name, LexicalScope*parent)
|
||||
: PScopeExtra(name, parent)
|
||||
{
|
||||
}
|
||||
|
||||
PPackage::~PPackage()
|
||||
{
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
#ifndef IVL_PPackage_H
|
||||
#define IVL_PPackage_H
|
||||
/*
|
||||
* Copyright (c) 2012-2014 Stephen Williams ([email protected])
|
||||
* Copyright CERN 2013 / Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
* General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PScope.h"
|
||||
# include "LineInfo.h"
|
||||
# include "StringHeap.h"
|
||||
# include <iostream>
|
||||
|
||||
/*
|
||||
* SystemVerilog supports class declarations with their own lexical
|
||||
* scope, etc. The parser arranges for these to be created and
|
||||
* collected.
|
||||
*/
|
||||
|
||||
class PPackage : public PScopeExtra, public LineInfo {
|
||||
|
||||
public:
|
||||
explicit PPackage (perm_string name, LexicalScope*parent);
|
||||
~PPackage();
|
||||
|
||||
bool elaborate_scope(Design*des, NetScope*scope);
|
||||
bool elaborate_sig(Design*des, NetScope*scope) const;
|
||||
bool elaborate(Design*des, NetScope*scope) const;
|
||||
|
||||
void pform_dump(std::ostream&out) const;
|
||||
};
|
||||
|
||||
#endif /* IVL_PPackage_H */
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PScope.h"
|
||||
@@ -31,6 +31,9 @@ PScope::PScope(perm_string n)
|
||||
|
||||
PScope::~PScope()
|
||||
{
|
||||
for(map<perm_string, data_type_t*>::iterator it = typedefs.begin();
|
||||
it != typedefs.end(); ++it)
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
PWire* LexicalScope::wires_find(perm_string name)
|
||||
@@ -41,3 +44,18 @@ PWire* LexicalScope::wires_find(perm_string name)
|
||||
else
|
||||
return (*cur).second;
|
||||
}
|
||||
|
||||
PScopeExtra::PScopeExtra(perm_string n, LexicalScope*parent)
|
||||
: PScope(n, parent)
|
||||
{
|
||||
}
|
||||
|
||||
PScopeExtra::PScopeExtra(perm_string n)
|
||||
: PScope(n)
|
||||
{
|
||||
}
|
||||
|
||||
PScopeExtra::~PScopeExtra()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PScope_H
|
||||
#define __PScope_H
|
||||
#ifndef IVL_PScope_H
|
||||
#define IVL_PScope_H
|
||||
/*
|
||||
* Copyright (c) 2008,2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2008-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "LineInfo.h"
|
||||
@@ -24,11 +24,17 @@
|
||||
# include "pform_types.h"
|
||||
# include "ivl_target.h"
|
||||
# include <map>
|
||||
# include <set>
|
||||
# include <vector>
|
||||
|
||||
class PEvent;
|
||||
class PExpr;
|
||||
class PFunction;
|
||||
class PPackage;
|
||||
class AProcess;
|
||||
class PProcess;
|
||||
class PClass;
|
||||
class PTask;
|
||||
class PWire;
|
||||
|
||||
class Design;
|
||||
@@ -83,9 +89,16 @@ class LexicalScope {
|
||||
map<perm_string,param_expr_t>parameters;
|
||||
map<perm_string,param_expr_t>localparams;
|
||||
|
||||
// Defined types in the scope.
|
||||
map<perm_string,data_type_t*>typedefs;
|
||||
|
||||
// Named events in the scope.
|
||||
map<perm_string,PEvent*>events;
|
||||
|
||||
// Symbols that are imported. Bind the imported name to the
|
||||
// package from which the name is imported.
|
||||
std::map<perm_string,PPackage*>imports;
|
||||
|
||||
// Nets and variables (wires) in the scope
|
||||
map<perm_string,PWire*>wires;
|
||||
PWire* wires_find(perm_string name);
|
||||
@@ -100,11 +113,13 @@ class LexicalScope {
|
||||
list<AProcess*> analog_behaviors;
|
||||
|
||||
// Enumeration sets.
|
||||
list<enum_type_t*> enum_sets;
|
||||
std::set<enum_type_t*> enum_sets;
|
||||
|
||||
LexicalScope* parent_scope() const { return parent_; }
|
||||
|
||||
protected:
|
||||
void dump_typedefs_(ostream&out, unsigned indent) const;
|
||||
|
||||
void dump_parameters_(ostream&out, unsigned indent) const;
|
||||
|
||||
void dump_localparams_(ostream&out, unsigned indent) const;
|
||||
@@ -145,4 +160,31 @@ class PScope : public LexicalScope {
|
||||
perm_string name_;
|
||||
};
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Some scopes can carry definitions. These include Modules and PClass
|
||||
* scopes. These derive from PScopeExtra so that they hold the maps of
|
||||
* extra definitions.
|
||||
*/
|
||||
class PScopeExtra : public PScope {
|
||||
|
||||
public:
|
||||
PScopeExtra(perm_string, LexicalScope*parent);
|
||||
PScopeExtra(perm_string);
|
||||
~PScopeExtra();
|
||||
|
||||
/* Task definitions within this module */
|
||||
std::map<perm_string,PTask*> tasks;
|
||||
std::map<perm_string,PFunction*> funcs;
|
||||
/* class definitions within this module. */
|
||||
std::map<perm_string,PClass*> classes;
|
||||
/* This is the lexical order of the classes, and is used by
|
||||
elaboration to choose an elaboration order. */
|
||||
std::vector<PClass*> classes_lexical;
|
||||
|
||||
protected:
|
||||
void dump_classes_(ostream&out, unsigned indent) const;
|
||||
void dump_tasks_(ostream&out, unsigned indent) const;
|
||||
void dump_funcs_(ostream&out, unsigned indent) const;
|
||||
};
|
||||
|
||||
#endif /* IVL_PScope_H */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PSpec.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PSpec_H
|
||||
#define __PSpec_H
|
||||
#ifndef IVL_PSpec_H
|
||||
#define IVL_PSpec_H
|
||||
/*
|
||||
* Copyright (c) 2006-2011 Stephen Williams <[email protected]>
|
||||
* Copyright (c) 2006-2014 Stephen Williams <[email protected]>
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "LineInfo.h"
|
||||
@@ -84,4 +84,4 @@ class PSpecPath : public LineInfo {
|
||||
std::vector<class PExpr*>delays;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PSpec_H */
|
||||
|
||||
@@ -14,15 +14,47 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
# include "PTask.h"
|
||||
# include <cassert>
|
||||
|
||||
PTaskFunc::PTaskFunc(perm_string n, LexicalScope*p)
|
||||
: PScope(n,p), this_type_(0), ports_(0)
|
||||
{
|
||||
}
|
||||
|
||||
PTaskFunc::~PTaskFunc()
|
||||
{
|
||||
}
|
||||
|
||||
void PTaskFunc::set_ports(vector<pform_tf_port_t>*p)
|
||||
{
|
||||
assert(ports_ == 0);
|
||||
ports_ = p;
|
||||
}
|
||||
|
||||
void PTaskFunc::set_this(class_type_t*type, PWire*this_wire)
|
||||
{
|
||||
assert(this_type_ == 0);
|
||||
this_type_ = type;
|
||||
|
||||
// Push a synthethis argument that is the "this" value.
|
||||
if (ports_==0)
|
||||
ports_ = new vector<pform_tf_port_t>;
|
||||
|
||||
size_t use_size = ports_->size();
|
||||
ports_->resize(use_size + 1);
|
||||
for (size_t idx = use_size ; idx > 0 ; idx -= 1)
|
||||
ports_->at(idx) = ports_->at(idx-1);
|
||||
|
||||
ports_->at(0) = pform_tf_port_t(this_wire);
|
||||
}
|
||||
|
||||
PTask::PTask(perm_string name, LexicalScope*parent, bool is_auto__)
|
||||
: PScope(name, parent), ports_(0), statement_(0)
|
||||
: PTaskFunc(name, parent), statement_(0)
|
||||
{
|
||||
is_auto_ = is_auto__;
|
||||
}
|
||||
@@ -31,12 +63,6 @@ PTask::~PTask()
|
||||
{
|
||||
}
|
||||
|
||||
void PTask::set_ports(svector<PWire*>*p)
|
||||
{
|
||||
assert(ports_ == 0);
|
||||
ports_ = p;
|
||||
}
|
||||
|
||||
void PTask::set_statement(Statement*s)
|
||||
{
|
||||
assert(statement_ == 0);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PTask_H
|
||||
#define __PTask_H
|
||||
#ifndef IVL_PTask_H
|
||||
#define IVL_PTask_H
|
||||
/*
|
||||
* Copyright (c) 1999-2008,2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1999-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,49 +16,69 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "LineInfo.h"
|
||||
# include "PScope.h"
|
||||
# include "svector.h"
|
||||
# include "StringHeap.h"
|
||||
# include <string>
|
||||
# include <vector>
|
||||
# include <list>
|
||||
class Design;
|
||||
class NetExpr;
|
||||
class NetNet;
|
||||
class NetScope;
|
||||
class PChainConstructor;
|
||||
class PWire;
|
||||
class Statement;
|
||||
class PExpr;
|
||||
|
||||
enum PTaskFuncEnum {
|
||||
PTF_NONE,
|
||||
PTF_REG,
|
||||
PTF_REG_S,
|
||||
PTF_INTEGER,
|
||||
PTF_REAL,
|
||||
PTF_REALTIME,
|
||||
PTF_TIME,
|
||||
PTF_ATOM2,
|
||||
PTF_ATOM2_S
|
||||
};
|
||||
|
||||
struct PTaskFuncArg {
|
||||
PTaskFuncEnum type;
|
||||
vector<PExpr*>*range;
|
||||
class PTaskFunc : public PScope, public LineInfo {
|
||||
|
||||
public:
|
||||
PTaskFunc(perm_string name, LexicalScope*parent);
|
||||
~PTaskFunc();
|
||||
|
||||
void set_ports(std::vector<pform_tf_port_t>*p);
|
||||
|
||||
void set_this(class_type_t*use_type, PWire*this_wire);
|
||||
|
||||
// If this task is a method of a class, this returns a pointer
|
||||
// to the class type.
|
||||
inline class_type_t* method_of() const { return this_type_; }
|
||||
|
||||
|
||||
virtual void elaborate_sig(Design*des, NetScope*scope) const =0;
|
||||
virtual void elaborate(Design*des, NetScope*scope) const =0;
|
||||
|
||||
virtual void dump(std::ostream&, unsigned) const =0;
|
||||
|
||||
protected:
|
||||
// Elaborate the ports list. Write into the ports vector the
|
||||
// NetNet pointers for the ports, and write into the pdefs the
|
||||
// default value expressions, if any.
|
||||
void elaborate_sig_ports_(Design*des, NetScope*scope,
|
||||
std::vector<NetNet*>&ports,
|
||||
std::vector<NetExpr*>&pdefs) const;
|
||||
|
||||
void dump_ports_(std::ostream&out, unsigned ind) const;
|
||||
|
||||
private:
|
||||
class_type_t*this_type_;
|
||||
std::vector<pform_tf_port_t>*ports_;
|
||||
};
|
||||
|
||||
/*
|
||||
* The PTask holds the parsed definitions of a task.
|
||||
*/
|
||||
class PTask : public PScope, public LineInfo {
|
||||
class PTask : public PTaskFunc {
|
||||
|
||||
public:
|
||||
explicit PTask(perm_string name, LexicalScope*parent, bool is_auto);
|
||||
~PTask();
|
||||
|
||||
void set_ports(svector<PWire *>*p);
|
||||
void set_statement(Statement *s);
|
||||
|
||||
// Tasks introduce scope, to need to be handled during the
|
||||
@@ -78,7 +98,6 @@ class PTask : public PScope, public LineInfo {
|
||||
void dump(ostream&, unsigned) const;
|
||||
|
||||
private:
|
||||
svector<PWire*>*ports_;
|
||||
Statement*statement_;
|
||||
bool is_auto_;
|
||||
|
||||
@@ -94,15 +113,26 @@ class PTask : public PScope, public LineInfo {
|
||||
*
|
||||
* The output value is not elaborated until elaborate_sig.
|
||||
*/
|
||||
class PFunction : public PScope, public LineInfo {
|
||||
class PFunction : public PTaskFunc {
|
||||
|
||||
public:
|
||||
explicit PFunction(perm_string name, LexicalScope*parent, bool is_auto);
|
||||
~PFunction();
|
||||
|
||||
void set_ports(svector<PWire *>*p);
|
||||
void set_statement(Statement *s);
|
||||
void set_return(PTaskFuncArg t);
|
||||
void set_return(data_type_t*t);
|
||||
|
||||
inline Statement* get_statement() { return statement_; }
|
||||
|
||||
// Push this statement to the front of the existing
|
||||
// definition. If the statement is a simple statement, make a
|
||||
// block to contain the statements.
|
||||
void push_statement_front(Statement*stmt);
|
||||
|
||||
// This is only used if this function is a constructor. In
|
||||
// that case, this method looks for a PChainConstructor in the
|
||||
// statement and extracts it if found.
|
||||
PChainConstructor*extract_chain_constructor();
|
||||
|
||||
void elaborate_scope(Design*des, NetScope*scope) const;
|
||||
|
||||
@@ -117,10 +147,9 @@ class PFunction : public PScope, public LineInfo {
|
||||
void dump(ostream&, unsigned) const;
|
||||
|
||||
private:
|
||||
PTaskFuncArg return_type_;
|
||||
svector<PWire *> *ports_;
|
||||
data_type_t* return_type_;
|
||||
Statement *statement_;
|
||||
bool is_auto_;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PTask_H */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "PUdp.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PUdp_H
|
||||
#define __PUdp_H
|
||||
#ifndef IVL_PUdp_H
|
||||
#define IVL_PUdp_H
|
||||
/*
|
||||
* Copyright (c) 1998-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <map>
|
||||
@@ -76,4 +76,4 @@ class PUdp : public LineInfo {
|
||||
PUdp& operator= (const PUdp&);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PUdp_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1999-2012 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -28,9 +28,9 @@ PWire::PWire(perm_string n,
|
||||
ivl_variable_type_t dt)
|
||||
: name_(n), type_(t), port_type_(pt), data_type_(dt),
|
||||
signed_(false), isint_(false),
|
||||
port_msb_(0), port_lsb_(0), port_set_(false),
|
||||
net_msb_(0), net_lsb_(0), net_set_(false), is_scalar_(false),
|
||||
error_cnt_(0), lidx_(0), ridx_(0), enum_type_(0), discipline_(0)
|
||||
port_set_(false), net_set_(false), is_scalar_(false),
|
||||
error_cnt_(0), set_data_type_(0),
|
||||
discipline_(0)
|
||||
{
|
||||
if (t == NetNet::INTEGER) {
|
||||
type_ = NetNet::REG;
|
||||
@@ -120,6 +120,7 @@ bool PWire::set_data_type(ivl_variable_type_t dt)
|
||||
|
||||
assert(data_type_ == IVL_VT_NO_TYPE);
|
||||
data_type_ = dt;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -140,7 +141,14 @@ bool PWire::get_signed() const
|
||||
|
||||
bool PWire::get_isint() const
|
||||
{
|
||||
return isint_;
|
||||
if (isint_)
|
||||
return true;
|
||||
|
||||
if (vector_type_t*tmp = dynamic_cast<vector_type_t*>(set_data_type_)) {
|
||||
return tmp->integer_flag;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PWire::get_scalar() const
|
||||
@@ -148,8 +156,9 @@ bool PWire::get_scalar() const
|
||||
return is_scalar_;
|
||||
}
|
||||
|
||||
void PWire::set_range(PExpr*m, PExpr*l, PWSRType type, bool is_scalar)
|
||||
void PWire::set_range_scalar(PWSRType type)
|
||||
{
|
||||
is_scalar_ = true;
|
||||
switch (type) {
|
||||
case SR_PORT:
|
||||
if (port_set_) {
|
||||
@@ -157,10 +166,7 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type, bool is_scalar)
|
||||
<< "'' has already been declared a port." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
port_msb_ = m;
|
||||
port_lsb_ = l;
|
||||
port_set_ = true;
|
||||
is_scalar_ = is_scalar;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -170,10 +176,7 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type, bool is_scalar)
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
net_msb_ = m;
|
||||
net_lsb_ = l;
|
||||
net_set_ = true;
|
||||
is_scalar_ = is_scalar;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -190,34 +193,83 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type, bool is_scalar)
|
||||
error_cnt_ += 1;
|
||||
}
|
||||
} else {
|
||||
port_msb_ = m;
|
||||
port_lsb_ = l;
|
||||
port_set_ = true;
|
||||
net_msb_ = m;
|
||||
net_lsb_ = l;
|
||||
net_set_ = true;
|
||||
is_scalar_ = is_scalar;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void PWire::set_memory_idx(PExpr*ldx, PExpr*rdx)
|
||||
void PWire::set_range(const list<pform_range_t>&rlist, PWSRType type)
|
||||
{
|
||||
if (lidx_ != 0 || ridx_ != 0) {
|
||||
switch (type) {
|
||||
case SR_PORT:
|
||||
if (port_set_) {
|
||||
cerr << get_fileline() << ": error: Port ``" << name_
|
||||
<< "'' has already been declared a port." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
port_ = rlist;
|
||||
port_set_ = true;
|
||||
is_scalar_ = false;
|
||||
}
|
||||
return;
|
||||
|
||||
case SR_NET:
|
||||
if (net_set_) {
|
||||
cerr << get_fileline() << ": error: Net ``" << name_
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
net_ = rlist;
|
||||
net_set_ = true;
|
||||
is_scalar_ = false;
|
||||
}
|
||||
return;
|
||||
|
||||
case SR_BOTH:
|
||||
if (port_set_ || net_set_) {
|
||||
if (port_set_) {
|
||||
cerr << get_fileline() << ": error: Port ``" << name_
|
||||
<< "'' has already been declared a port." << endl;
|
||||
error_cnt_ += 1;
|
||||
}
|
||||
if (net_set_) {
|
||||
cerr << get_fileline() << ": error: Net ``" << name_
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
}
|
||||
} else {
|
||||
port_ = rlist;
|
||||
port_set_ = true;
|
||||
net_ = rlist;
|
||||
net_set_ = true;
|
||||
is_scalar_ = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void PWire::set_unpacked_idx(const list<pform_range_t>&ranges)
|
||||
{
|
||||
if (! unpacked_.empty()) {
|
||||
cerr << get_fileline() << ": error: Array ``" << name_
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
lidx_ = ldx;
|
||||
ridx_ = rdx;
|
||||
unpacked_ = ranges;
|
||||
}
|
||||
}
|
||||
|
||||
void PWire::set_enumeration(enum_type_t*enum_type)
|
||||
void PWire::set_data_type(data_type_t*type)
|
||||
{
|
||||
assert(enum_type_ == 0);
|
||||
enum_type_ = enum_type;
|
||||
assert(set_data_type_ == 0);
|
||||
set_data_type_ = type;
|
||||
|
||||
if (vector_type_t*tmp = dynamic_cast<vector_type_t*>(type)) {
|
||||
if (tmp->integer_flag)
|
||||
isint_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void PWire::set_discipline(ivl_discipline_t d)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __PWire_H
|
||||
#define __PWire_H
|
||||
#ifndef IVL_PWire_H
|
||||
#define IVL_PWire_H
|
||||
/*
|
||||
* Copyright (c) 1998-2009 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,13 +16,13 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "netlist.h"
|
||||
# include "LineInfo.h"
|
||||
# include <list>
|
||||
# include <map>
|
||||
# include "svector.h"
|
||||
# include "StringHeap.h"
|
||||
|
||||
#ifdef HAVE_IOSFWD
|
||||
@@ -33,6 +33,7 @@ class ostream;
|
||||
|
||||
class PExpr;
|
||||
class Design;
|
||||
class netdarray_t;
|
||||
|
||||
/*
|
||||
* The different type of PWire::set_range() calls.
|
||||
@@ -75,11 +76,12 @@ class PWire : public LineInfo {
|
||||
bool set_data_type(ivl_variable_type_t dt);
|
||||
ivl_variable_type_t get_data_type() const;
|
||||
|
||||
void set_range(PExpr*msb, PExpr*lsb, PWSRType type, bool is_scalar);
|
||||
void set_range_scalar(PWSRType type);
|
||||
void set_range(const std::list<pform_range_t>&ranges, PWSRType type);
|
||||
|
||||
void set_memory_idx(PExpr*ldx, PExpr*rdx);
|
||||
void set_unpacked_idx(const std::list<pform_range_t>&ranges);
|
||||
|
||||
void set_enumeration(enum_type_t*enum_type);
|
||||
void set_data_type(data_type_t*type);
|
||||
|
||||
void set_discipline(ivl_discipline_t);
|
||||
ivl_discipline_t get_discipline(void) const;
|
||||
@@ -100,22 +102,25 @@ class PWire : public LineInfo {
|
||||
bool isint_; // original type of integer
|
||||
|
||||
// These members hold expressions for the bit width of the
|
||||
// wire. If they do not exist, the wire is 1 bit wide.
|
||||
PExpr*port_msb_;
|
||||
PExpr*port_lsb_;
|
||||
// wire. If they do not exist, the wire is 1 bit wide. If they
|
||||
// do exist, they represent the packed dimensions of the
|
||||
// bit. The first item in the list is the first range, and so
|
||||
// on. For example "reg [3:0][7:0] ..." will contains the
|
||||
// range_t object for [3:0] first and [7:0] last.
|
||||
std::list<pform_range_t>port_;
|
||||
bool port_set_;
|
||||
PExpr*net_msb_;
|
||||
PExpr*net_lsb_;
|
||||
std::list<pform_range_t>net_;
|
||||
bool net_set_;
|
||||
bool is_scalar_;
|
||||
unsigned error_cnt_;
|
||||
|
||||
// If this wire is actually a memory, these indices will give
|
||||
// me the size and address range of the memory.
|
||||
PExpr*lidx_;
|
||||
PExpr*ridx_;
|
||||
// me the size and address ranges of the memory.
|
||||
std::list<pform_range_t>unpacked_;
|
||||
|
||||
enum_type_t*enum_type_;
|
||||
// This is the complex type of the wire. the data_type_ may
|
||||
// modify how this is interpreted.
|
||||
data_type_t*set_data_type_;
|
||||
|
||||
ivl_discipline_t discipline_;
|
||||
|
||||
@@ -124,4 +129,4 @@ class PWire : public LineInfo {
|
||||
PWire& operator= (const PWire&);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_PWire_H */
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ Icarus Verilog is intended to compile ALL of the Verilog HDL as
|
||||
described in the IEEE-1364 standard. Of course, it's not quite there
|
||||
yet. It does currently handle a mix of structural and behavioral
|
||||
constructs. For a view of the current state of Icarus Verilog, see its
|
||||
home page at <http://www.icarus.com/eda/verilog>.
|
||||
home page at <http://iverilog.icarus.com/>.
|
||||
|
||||
Icarus Verilog is not aimed at being a simulator in the traditional
|
||||
sense, but a compiler that generates code employed by back-end
|
||||
@@ -64,7 +64,7 @@ on a UNIX-like system:
|
||||
- termcap
|
||||
The readline library in turn uses termcap.
|
||||
|
||||
If you are building from CVS, you will also need software to generate
|
||||
If you are building from git, you will also need software to generate
|
||||
the configure scripts.
|
||||
|
||||
- autoconf 2.53
|
||||
|
||||
+112
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2008,2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2013 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,13 +14,14 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
# include "Statement.h"
|
||||
# include "PExpr.h"
|
||||
# include "ivl_assert.h"
|
||||
|
||||
Statement::~Statement()
|
||||
{
|
||||
@@ -51,22 +52,27 @@ PAssign_::~PAssign_()
|
||||
}
|
||||
|
||||
PAssign::PAssign(PExpr*lval__, PExpr*ex)
|
||||
: PAssign_(lval__, ex, false)
|
||||
: PAssign_(lval__, ex, false), op_(0)
|
||||
{
|
||||
}
|
||||
|
||||
PAssign::PAssign(PExpr*lval__, char op, PExpr*ex)
|
||||
: PAssign_(lval__, ex, false), op_(op)
|
||||
{
|
||||
}
|
||||
|
||||
PAssign::PAssign(PExpr*lval__, PExpr*d, PExpr*ex)
|
||||
: PAssign_(lval__, d, ex)
|
||||
: PAssign_(lval__, d, ex), op_(0)
|
||||
{
|
||||
}
|
||||
|
||||
PAssign::PAssign(PExpr*lval__, PExpr*cnt, PEventStatement*d, PExpr*ex)
|
||||
: PAssign_(lval__, cnt, d, ex)
|
||||
: PAssign_(lval__, cnt, d, ex), op_(0)
|
||||
{
|
||||
}
|
||||
|
||||
PAssign::PAssign(PExpr*lval__, PExpr*ex, bool is_constant)
|
||||
: PAssign_(lval__, ex, is_constant)
|
||||
: PAssign_(lval__, ex, is_constant), op_(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -109,13 +115,57 @@ PBlock::~PBlock()
|
||||
delete list_[idx];
|
||||
}
|
||||
|
||||
PChainConstructor* PBlock::extract_chain_constructor()
|
||||
{
|
||||
if (list_.empty())
|
||||
return 0;
|
||||
|
||||
if (PChainConstructor*res = dynamic_cast<PChainConstructor*> (list_[0])) {
|
||||
for (size_t idx = 0 ; idx < list_.size()-1 ; idx += 1)
|
||||
list_[idx] = list_[idx+1];
|
||||
list_.resize(list_.size()-1);
|
||||
return res;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PBlock::set_join_type(PBlock::BL_TYPE type)
|
||||
{
|
||||
assert(bl_type_ == BL_PAR);
|
||||
assert(type==BL_PAR || type==BL_JOIN_NONE || type==BL_JOIN_ANY);
|
||||
bl_type_ = type;
|
||||
}
|
||||
|
||||
void PBlock::set_statement(const vector<Statement*>&st)
|
||||
{
|
||||
list_ = st;
|
||||
}
|
||||
|
||||
void PBlock::push_statement_front(Statement*that)
|
||||
{
|
||||
ivl_assert(*this, bl_type_==BL_SEQ);
|
||||
|
||||
list_.resize(list_.size()+1);
|
||||
for (size_t idx = list_.size()-1 ; idx > 0 ; idx -= 1)
|
||||
list_[idx] = list_[idx-1];
|
||||
|
||||
list_[0] = that;
|
||||
}
|
||||
|
||||
PCallTask::PCallTask(const pform_name_t&n, const list<PExpr*>&p)
|
||||
: path_(n), parms_(p.size())
|
||||
: package_(0), path_(n), parms_(p.size())
|
||||
{
|
||||
list<PExpr*>::const_iterator cur = p.begin();
|
||||
for (size_t idx = 0 ; idx < parms_.size() ; idx += 1) {
|
||||
parms_[idx] = *cur;
|
||||
++cur;
|
||||
}
|
||||
assert(cur == p.end());
|
||||
}
|
||||
|
||||
PCallTask::PCallTask(PPackage*pkg, const pform_name_t&n, const list<PExpr*>&p)
|
||||
: package_(pkg), path_(n), parms_(p.size())
|
||||
{
|
||||
list<PExpr*>::const_iterator cur = p.begin();
|
||||
for (size_t idx = 0 ; idx < parms_.size() ; idx += 1) {
|
||||
@@ -126,7 +176,7 @@ PCallTask::PCallTask(const pform_name_t&n, const list<PExpr*>&p)
|
||||
}
|
||||
|
||||
PCallTask::PCallTask(perm_string n, const list<PExpr*>&p)
|
||||
: parms_(p.size())
|
||||
: package_(0), parms_(p.size())
|
||||
{
|
||||
list<PExpr*>::const_iterator cur = p.begin();
|
||||
for (size_t idx = 0 ; idx < parms_.size() ; idx += 1) {
|
||||
@@ -171,6 +221,21 @@ PCAssign::~PCAssign()
|
||||
delete expr_;
|
||||
}
|
||||
|
||||
PChainConstructor::PChainConstructor(const list<PExpr*>&parms)
|
||||
: parms_(parms.size())
|
||||
{
|
||||
list<PExpr*>::const_iterator cur = parms.begin();
|
||||
for (size_t idx = 0 ; idx < parms_.size() ; idx += 1) {
|
||||
parms_[idx] = *cur;
|
||||
++cur;
|
||||
}
|
||||
assert(cur == parms.end());
|
||||
}
|
||||
|
||||
PChainConstructor::~PChainConstructor()
|
||||
{
|
||||
}
|
||||
|
||||
PCondit::PCondit(PExpr*ex, Statement*i, Statement*e)
|
||||
: expr_(ex), if_(i), else_(e)
|
||||
{
|
||||
@@ -212,6 +277,17 @@ PDisable::~PDisable()
|
||||
{
|
||||
}
|
||||
|
||||
PDoWhile::PDoWhile(PExpr*ex, Statement*st)
|
||||
: cond_(ex), statement_(st)
|
||||
{
|
||||
}
|
||||
|
||||
PDoWhile::~PDoWhile()
|
||||
{
|
||||
delete cond_;
|
||||
delete statement_;
|
||||
}
|
||||
|
||||
PEventStatement::PEventStatement(const svector<PEEvent*>&ee)
|
||||
: expr_(ee), statement_(0)
|
||||
{
|
||||
@@ -260,6 +336,20 @@ PForce::~PForce()
|
||||
delete expr_;
|
||||
}
|
||||
|
||||
PForeach::PForeach(perm_string av, const list<perm_string>&ix, Statement*s)
|
||||
: array_var_(av), index_vars_(ix.size()), statement_(s)
|
||||
{
|
||||
size_t idx = 0;
|
||||
for (list<perm_string>::const_iterator cur = ix.begin()
|
||||
; cur != ix.end() ; ++cur)
|
||||
index_vars_[idx++] = *cur;
|
||||
}
|
||||
|
||||
PForeach::~PForeach()
|
||||
{
|
||||
delete statement_;
|
||||
}
|
||||
|
||||
PForever::PForever(Statement*s)
|
||||
: statement_(s)
|
||||
{
|
||||
@@ -271,9 +361,8 @@ PForever::~PForever()
|
||||
}
|
||||
|
||||
PForStatement::PForStatement(PExpr*n1, PExpr*e1, PExpr*cond,
|
||||
PExpr*n2, PExpr*e2, Statement*st)
|
||||
: name1_(n1), expr1_(e1), cond_(cond), name2_(n2), expr2_(e2),
|
||||
statement_(st)
|
||||
Statement*step, Statement*st)
|
||||
: name1_(n1), expr1_(e1), cond_(cond), step_(step), statement_(st)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -307,6 +396,16 @@ PRepeat::~PRepeat()
|
||||
delete statement_;
|
||||
}
|
||||
|
||||
PReturn::PReturn(PExpr*e)
|
||||
: expr_(e)
|
||||
{
|
||||
}
|
||||
|
||||
PReturn::~PReturn()
|
||||
{
|
||||
delete expr_;
|
||||
}
|
||||
|
||||
PTrigger::PTrigger(const pform_name_t&e)
|
||||
: event_(e)
|
||||
{
|
||||
@@ -316,8 +415,8 @@ PTrigger::~PTrigger()
|
||||
{
|
||||
}
|
||||
|
||||
PWhile::PWhile(PExpr*e1, Statement*st)
|
||||
: cond_(e1), statement_(st)
|
||||
PWhile::PWhile(PExpr*ex, Statement*st)
|
||||
: cond_(ex), statement_(st)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+123
-25
@@ -1,7 +1,7 @@
|
||||
#ifndef __Statement_H
|
||||
#define __Statement_H
|
||||
#ifndef IVL_Statement_H
|
||||
#define IVL_Statement_H
|
||||
/*
|
||||
* Copyright (c) 1998-2008 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <string>
|
||||
@@ -31,6 +31,8 @@
|
||||
# include "HName.h"
|
||||
# include "LineInfo.h"
|
||||
class PExpr;
|
||||
class PChainConstructor;
|
||||
class PPackage;
|
||||
class Statement;
|
||||
class PEventStatement;
|
||||
class Design;
|
||||
@@ -104,8 +106,13 @@ class PAssign_ : public Statement {
|
||||
|
||||
protected:
|
||||
NetAssign_* elaborate_lval(Design*, NetScope*scope) const;
|
||||
NetExpr* elaborate_rval_(Design*, NetScope*, unsigned lv_width,
|
||||
ivl_variable_type_t type) const;
|
||||
NetExpr* elaborate_rval_(Design*, NetScope*, ivl_type_t lv_net_type,
|
||||
ivl_variable_type_t lv_type,
|
||||
unsigned lv_width) const;
|
||||
NetExpr* elaborate_rval_(Design*, NetScope*, ivl_type_t ntype) const;
|
||||
|
||||
NetExpr* elaborate_rval_obj_(Design*, NetScope*,
|
||||
ivl_variable_type_t type) const;
|
||||
|
||||
PExpr* delay_;
|
||||
PEventStatement*event_;
|
||||
@@ -120,7 +127,12 @@ class PAssign_ : public Statement {
|
||||
class PAssign : public PAssign_ {
|
||||
|
||||
public:
|
||||
// lval - assignment l-value
|
||||
// ex - assignment r-value
|
||||
// op - compressed assignment operator (i.e. '+', '-', ...)
|
||||
// de - delayed assignment delay expression
|
||||
explicit PAssign(PExpr*lval, PExpr*ex);
|
||||
explicit PAssign(PExpr*lval, char op, PExpr*ex);
|
||||
explicit PAssign(PExpr*lval, PExpr*de, PExpr*ex);
|
||||
explicit PAssign(PExpr*lval, PExpr*cnt, PEventStatement*de, PExpr*ex);
|
||||
explicit PAssign(PExpr*lval, PExpr*ex, bool is_constant);
|
||||
@@ -130,6 +142,8 @@ class PAssign : public PAssign_ {
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
|
||||
private:
|
||||
NetProc* elaborate_compressed_(Design*des, NetScope*scope) const;
|
||||
char op_;
|
||||
};
|
||||
|
||||
class PAssignNB : public PAssign_ {
|
||||
@@ -158,7 +172,7 @@ class PAssignNB : public PAssign_ {
|
||||
class PBlock : public PScope, public Statement {
|
||||
|
||||
public:
|
||||
enum BL_TYPE { BL_SEQ, BL_PAR };
|
||||
enum BL_TYPE { BL_SEQ, BL_PAR, BL_JOIN_NONE, BL_JOIN_ANY };
|
||||
|
||||
// If the block has a name, it is a scope and also has a parent.
|
||||
explicit PBlock(perm_string n, LexicalScope*parent, BL_TYPE t);
|
||||
@@ -168,39 +182,41 @@ class PBlock : public PScope, public Statement {
|
||||
|
||||
BL_TYPE bl_type() const { return bl_type_; }
|
||||
|
||||
// This is only used if this block is the statement list for a
|
||||
// constructor. We look for a PChainConstructor as the first
|
||||
// statement, and if it is there, extract it.
|
||||
PChainConstructor*extract_chain_constructor();
|
||||
|
||||
// If the bl_type() is BL_PAR, it is possible to replace it
|
||||
// with JOIN_NONE or JOIN_ANY. This is to help the parser.
|
||||
void set_join_type(BL_TYPE);
|
||||
|
||||
void set_statement(const std::vector<Statement*>&st);
|
||||
|
||||
// Copy the statement from that block to the front of this
|
||||
// block.
|
||||
void push_statement_front(Statement*that);
|
||||
|
||||
virtual void dump(ostream&out, unsigned ind) const;
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
||||
virtual void elaborate_sig(Design*des, NetScope*scope) const;
|
||||
|
||||
private:
|
||||
const BL_TYPE bl_type_;
|
||||
BL_TYPE bl_type_;
|
||||
std::vector<Statement*>list_;
|
||||
};
|
||||
|
||||
class PCallTask : public Statement {
|
||||
|
||||
public:
|
||||
explicit PCallTask(PPackage*pkg, const pform_name_t&n, const list<PExpr*>&parms);
|
||||
explicit PCallTask(const pform_name_t&n, const list<PExpr*>&parms);
|
||||
explicit PCallTask(perm_string n, const list<PExpr*>&parms);
|
||||
~PCallTask();
|
||||
|
||||
const pform_name_t& path() const;
|
||||
|
||||
unsigned nparms() const { return parms_.size(); }
|
||||
|
||||
PExpr*&parm(unsigned idx)
|
||||
{ assert(idx < parms_.size());
|
||||
return parms_[idx];
|
||||
}
|
||||
|
||||
PExpr* parm(unsigned idx) const
|
||||
{ assert(idx < parms_.size());
|
||||
return parms_[idx];
|
||||
}
|
||||
|
||||
virtual void dump(ostream&out, unsigned ind) const;
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
|
||||
@@ -208,6 +224,19 @@ class PCallTask : public Statement {
|
||||
NetProc* elaborate_sys(Design*des, NetScope*scope) const;
|
||||
NetProc* elaborate_usr(Design*des, NetScope*scope) const;
|
||||
|
||||
NetProc*elaborate_method_(Design*des, NetScope*scope,
|
||||
bool add_this_flag = false) const;
|
||||
NetProc*elaborate_function_(Design*des, NetScope*scope) const;
|
||||
|
||||
NetProc*elaborate_build_call_(Design*des, NetScope*scope,
|
||||
NetScope*task, NetExpr*use_this) const;
|
||||
NetProc*elaborate_sys_task_method_(Design*des, NetScope*scope,
|
||||
NetNet*net,
|
||||
perm_string method_name,
|
||||
const char*sys_task_name) const;
|
||||
bool test_task_calls_ok_(Design*des, NetScope*scope) const;
|
||||
|
||||
PPackage*package_;
|
||||
pform_name_t path_;
|
||||
vector<PExpr*> parms_;
|
||||
};
|
||||
@@ -253,6 +282,26 @@ class PCAssign : public Statement {
|
||||
PExpr*expr_;
|
||||
};
|
||||
|
||||
/*
|
||||
* This represents the syntax "super.new(...)". This is not really an
|
||||
* executable statement, but the elaborator will handle these
|
||||
* specially and will remove them from the statement stream. If any
|
||||
*/
|
||||
class PChainConstructor : public Statement {
|
||||
public:
|
||||
PChainConstructor(const list<PExpr*>&parms);
|
||||
~PChainConstructor();
|
||||
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
virtual void dump(ostream&out, unsigned ind) const;
|
||||
|
||||
inline const std::vector<PExpr*>& chain_args(void) const
|
||||
{ return parms_; }
|
||||
|
||||
private:
|
||||
std::vector<PExpr*> parms_;
|
||||
};
|
||||
|
||||
class PCondit : public Statement {
|
||||
|
||||
public:
|
||||
@@ -320,6 +369,22 @@ class PDisable : public Statement {
|
||||
pform_name_t scope_;
|
||||
};
|
||||
|
||||
class PDoWhile : public Statement {
|
||||
|
||||
public:
|
||||
PDoWhile(PExpr*ex, Statement*st);
|
||||
~PDoWhile();
|
||||
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
||||
virtual void elaborate_sig(Design*des, NetScope*scope) const;
|
||||
virtual void dump(ostream&out, unsigned ind) const;
|
||||
|
||||
private:
|
||||
PExpr*cond_;
|
||||
Statement*statement_;
|
||||
};
|
||||
|
||||
/*
|
||||
* The event statement represents the event delay in behavioral
|
||||
* code. It comes from such things as:
|
||||
@@ -356,6 +421,7 @@ class PEventStatement : public Statement {
|
||||
NetProc* elaborate_st(Design*des, NetScope*scope, NetProc*st) const;
|
||||
|
||||
NetProc* elaborate_wait(Design*des, NetScope*scope, NetProc*st) const;
|
||||
NetProc* elaborate_wait_fork(Design*des, NetScope*scope) const;
|
||||
|
||||
private:
|
||||
svector<PEEvent*>expr_;
|
||||
@@ -378,6 +444,26 @@ class PForce : public Statement {
|
||||
PExpr*expr_;
|
||||
};
|
||||
|
||||
class PForeach : public Statement {
|
||||
public:
|
||||
explicit PForeach(perm_string var, const std::list<perm_string>&ix, Statement*stmt);
|
||||
~PForeach();
|
||||
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
||||
virtual void elaborate_sig(Design*des, NetScope*scope) const;
|
||||
virtual void dump(ostream&out, unsigned ind) const;
|
||||
|
||||
private:
|
||||
NetProc* elaborate_static_array_(Design*des, NetScope*scope,
|
||||
const std::vector<netrange_t>&dims) const;
|
||||
|
||||
private:
|
||||
perm_string array_var_;
|
||||
std::vector<perm_string> index_vars_;
|
||||
Statement*statement_;
|
||||
};
|
||||
|
||||
class PForever : public Statement {
|
||||
public:
|
||||
explicit PForever(Statement*s);
|
||||
@@ -396,7 +482,7 @@ class PForStatement : public Statement {
|
||||
|
||||
public:
|
||||
PForStatement(PExpr*n1, PExpr*e1, PExpr*cond,
|
||||
PExpr*n2, PExpr*e2, Statement*st);
|
||||
Statement*step, Statement*body);
|
||||
~PForStatement();
|
||||
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
@@ -410,8 +496,7 @@ class PForStatement : public Statement {
|
||||
|
||||
PExpr*cond_;
|
||||
|
||||
PExpr* name2_;
|
||||
PExpr* expr2_;
|
||||
Statement*step_;
|
||||
|
||||
Statement*statement_;
|
||||
};
|
||||
@@ -451,6 +536,19 @@ class PRelease : public Statement {
|
||||
PExpr*lval_;
|
||||
};
|
||||
|
||||
class PReturn : public Statement {
|
||||
|
||||
public:
|
||||
explicit PReturn(PExpr*e);
|
||||
~PReturn();
|
||||
|
||||
NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
virtual void dump(std::ostream&out, unsigned ind) const;
|
||||
|
||||
private:
|
||||
PExpr*expr_;
|
||||
};
|
||||
|
||||
/*
|
||||
* The PTrigger statement sends a trigger to a named event. Take the
|
||||
* name here.
|
||||
@@ -471,7 +569,7 @@ class PTrigger : public Statement {
|
||||
class PWhile : public Statement {
|
||||
|
||||
public:
|
||||
PWhile(PExpr*e1, Statement*st);
|
||||
PWhile(PExpr*ex, Statement*st);
|
||||
~PWhile();
|
||||
|
||||
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
||||
@@ -484,4 +582,4 @@ class PWhile : public Statement {
|
||||
Statement*statement_;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_Statement_H */
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef PLI_TYPES
|
||||
#define PLI_TYPES
|
||||
#ifndef PLI_TYPES_H
|
||||
#define PLI_TYPES_H
|
||||
/*
|
||||
* Copyright (c) 2003 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2003-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# undef HAVE_INTTYPES_H
|
||||
@@ -85,4 +85,4 @@ typedef char PLI_BYTE8;
|
||||
typedef unsigned char PLI_UBYTE8;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* PLI_TYPES_H */
|
||||
|
||||
+6
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef __acc_user_H
|
||||
#define __acc_user_H
|
||||
#ifndef ACC_USER_H
|
||||
#define ACC_USER_H
|
||||
/*
|
||||
* Copyright (c) 2002 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2002-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -228,6 +228,7 @@ extern PLI_INT32 acc_fetch_size(handle obj);
|
||||
|
||||
extern PLI_INT32 acc_fetch_type(handle obj);
|
||||
extern PLI_INT32 acc_fetch_fulltype(handle obj);
|
||||
extern PLI_INT32 acc_fetch_paramtype(handle obj);
|
||||
extern PLI_INT32 acc_fetch_range(handle object, int *msb, int *lsb);
|
||||
extern const char* acc_fetch_type_str(PLI_INT32 type);
|
||||
|
||||
@@ -270,4 +271,4 @@ extern char* acc_version(void);
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
#endif
|
||||
#endif /* ACC_USER_H */
|
||||
|
||||
Vendored
-11
@@ -218,17 +218,6 @@ AC_SUBST(strip_dynamic)
|
||||
# AC_MSG_RESULT($strip_dynamic)
|
||||
])# AX_LD_RDYNAMIC
|
||||
|
||||
# AX_CPP_PRECOMP
|
||||
# --------------
|
||||
AC_DEFUN([AX_CPP_PRECOMP],
|
||||
[# Darwin requires -no-cpp-precomp
|
||||
case "${host}" in
|
||||
*-*-darwin*)
|
||||
CPPFLAGS="-no-cpp-precomp $CPPFLAGS"
|
||||
CFLAGS="-no-cpp-precomp $CFLAGS"
|
||||
;;
|
||||
esac
|
||||
])# AX_CPP_PRECOMP
|
||||
|
||||
# AX_C99_STRTOD
|
||||
# -------------
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -50,8 +50,8 @@ bool NetEvWait::is_asynchronous()
|
||||
level sensitive, but the nex_async_ method takes care of
|
||||
that test. */
|
||||
NexusSet*sense = new NexusSet;
|
||||
for (unsigned idx = 0 ; idx < nevents_ ; idx += 1) {
|
||||
NexusSet*tmp = event(idx)->nex_async_();
|
||||
for (unsigned idx = 0 ; idx < events_.size() ; idx += 1) {
|
||||
NexusSet*tmp = events_[idx]->nex_async_();
|
||||
if (tmp == 0) {
|
||||
delete sense;
|
||||
return false;
|
||||
|
||||
+7
-4
@@ -2,12 +2,15 @@
|
||||
|
||||
#
|
||||
# This shell script exists to run autoconf on source distributions
|
||||
# that are pulled from CVS. The configure scripts are not included
|
||||
# in CVS, and there are several configure.in files, so it is easiest
|
||||
# to just run this script to autoconf wherever needed.
|
||||
# that are pulled from git The configure script is not included
|
||||
# in git, so it is easiest to just run this script whenever needed
|
||||
# to generate the configure script.
|
||||
#
|
||||
echo "Autoconf in root..."
|
||||
autoconf -f
|
||||
|
||||
echo "Precompiling lexor_keyword.gperf"
|
||||
gperf -o -i 7 -C -k 1-4,6,9,\$ -L ANSI-C -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc
|
||||
gperf -o -i 7 -C -k 1-4,6,9,\$ -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc
|
||||
|
||||
echo "Precompiling vhdlpp/lexor_keyword.gperf"
|
||||
(cd vhdlpp ; gperf -o -i 7 --ignore-case -C -k 1-4,6,9,\$ -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc )
|
||||
|
||||
+4
-7
@@ -12,9 +12,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307, USA
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -44,11 +43,9 @@ INCLUDE_PATH = -I. -I.. -I$(srcdir) -I$(srcdir)/..
|
||||
endif
|
||||
|
||||
CPPFLAGS = $(INCLUDE_PATH) @CPPFLAGS@ @DEFS@ @PICFLAG@
|
||||
CFLAGS = @WARNING_FLAGS@ @CFLAGS@
|
||||
CFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
SHARED = @shared@
|
||||
|
||||
O = cadpli.o
|
||||
|
||||
all: dep cadpli.vpl $(ALL32)
|
||||
@@ -80,7 +77,7 @@ ifeq (@MINGW32@,yes)
|
||||
endif
|
||||
|
||||
cadpli.vpl: $O ../vvp/libvpi.a ../libveriuser/libveriuser.o
|
||||
$(CC) @shared@ -o $@ $O ../libveriuser/libveriuser.o $(SYSTEM_VPI_LDFLAGS)
|
||||
$(CC) @shared@ $(LDFLAGS) -o $@ $O ../libveriuser/libveriuser.o $(SYSTEM_VPI_LDFLAGS)
|
||||
|
||||
install: all installdirs $(vpidir)/cadpli.vpl
|
||||
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <vpi_user.h>
|
||||
@@ -79,7 +79,7 @@ static void thunker_register(void)
|
||||
}
|
||||
}
|
||||
|
||||
void (*vlog_startup_routines[])() = {
|
||||
void (*vlog_startup_routines[])(void) = {
|
||||
thunker_register,
|
||||
0
|
||||
};
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef __ivl_dlfcn_H
|
||||
#define __ivl_dlfcn_H
|
||||
#ifndef IVL_ivl_dlfcn_H
|
||||
#define IVL_ivl_dlfcn_H
|
||||
/*
|
||||
* Copyright (c) 2001 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
@@ -91,4 +91,4 @@ static __inline__ const char*dlerror(void)
|
||||
{ return strerror( errno ); }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* IVL_ivl_dlfcn_H */
|
||||
|
||||
+42
-7
@@ -1,7 +1,7 @@
|
||||
#ifndef __compiler_H
|
||||
#define __compiler_H
|
||||
#ifndef IVL_compiler_H
|
||||
#define IVL_compiler_H
|
||||
/*
|
||||
* Copyright (c) 1999-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1999-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <list>
|
||||
@@ -36,6 +36,11 @@
|
||||
*/
|
||||
extern unsigned integer_width;
|
||||
|
||||
/*
|
||||
* The width_cap is the width limit for unsized expressions.
|
||||
*/
|
||||
extern unsigned width_cap;
|
||||
|
||||
/*
|
||||
* This is the maximum number of recursive module loops allowed within
|
||||
* a generate block.
|
||||
@@ -92,18 +97,35 @@ extern bool warn_inf_loop;
|
||||
extern bool warn_sens_entire_vec;
|
||||
extern bool warn_sens_entire_arr;
|
||||
|
||||
/* Warn about level-appropriate anachronisms. */
|
||||
extern bool warn_anachronisms;
|
||||
|
||||
/* This is true if verbose output is requested. */
|
||||
extern bool verbose_flag;
|
||||
|
||||
extern bool debug_scopes;
|
||||
extern bool debug_eval_tree;
|
||||
extern bool debug_elaborate;
|
||||
extern bool debug_emit;
|
||||
extern bool debug_synth2;
|
||||
extern bool debug_optimizer;
|
||||
|
||||
/* Control evaluation of functions at compile time:
|
||||
* 0 = only for functions in constant expressions
|
||||
* 1 = only for automatic functions
|
||||
* 2 = for all functions
|
||||
* Level 2 should only be used if the user can guarantee that a
|
||||
* function's local variables are never accessed from outside the
|
||||
* function. */
|
||||
extern unsigned opt_const_func;
|
||||
|
||||
/* Possibly temporary flag to control virtualization of pin arrays */
|
||||
extern bool disable_virtual_pins;
|
||||
|
||||
/* The vlog95 code generator does not want the compiler to generate concat-Z
|
||||
* LPM objects so this flag is used to block them from being generated. */
|
||||
extern bool disable_concatz_generation;
|
||||
|
||||
/* Limit to size of devirtualized arrays */
|
||||
extern unsigned long array_size_limit;
|
||||
|
||||
@@ -124,6 +146,7 @@ enum generation_t {
|
||||
GN_VER2005 = 4,
|
||||
GN_VER2005_SV = 5,
|
||||
GN_VER2009 = 6,
|
||||
GN_VER2012 = 7,
|
||||
GN_DEFAULT = 4
|
||||
};
|
||||
|
||||
@@ -139,6 +162,10 @@ extern bool gn_icarus_misc_flag;
|
||||
is false, then skip elaboration of specify behavior. */
|
||||
extern bool gn_specify_blocks_flag;
|
||||
|
||||
/* If this flag is true, then elaborate assertions. If this flag is
|
||||
false, then stub out assertion statements. */
|
||||
extern bool gn_assertions_flag;
|
||||
|
||||
/* If this flag is true, then support/elaborate Verilog-AMS. */
|
||||
extern bool gn_verilog_ams_flag;
|
||||
|
||||
@@ -161,7 +188,8 @@ extern bool gn_strict_expr_width_flag;
|
||||
static inline bool gn_var_can_be_uwire(void)
|
||||
{
|
||||
if (generation_flag == GN_VER2005_SV ||
|
||||
generation_flag == GN_VER2009)
|
||||
generation_flag == GN_VER2009 ||
|
||||
generation_flag == GN_VER2012)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -169,11 +197,17 @@ static inline bool gn_var_can_be_uwire(void)
|
||||
static inline bool gn_system_verilog(void)
|
||||
{
|
||||
if (generation_flag == GN_VER2005_SV ||
|
||||
generation_flag == GN_VER2009)
|
||||
generation_flag == GN_VER2009 ||
|
||||
generation_flag == GN_VER2012)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool gn_modules_nest(void)
|
||||
{
|
||||
return gn_system_verilog();
|
||||
}
|
||||
|
||||
/* The bits of these GN_KEYWORDS_* constants define non-intersecting
|
||||
sets of keywords. The compiler enables groups of keywords by setting
|
||||
lexor_keyword_mask with the OR of the bits for the keywords to be
|
||||
@@ -185,6 +219,7 @@ enum { GN_KEYWORDS_1364_1995 = 0x0001,
|
||||
GN_KEYWORDS_VAMS_2_3 = 0x0010,
|
||||
GN_KEYWORDS_1800_2005 = 0x0020,
|
||||
GN_KEYWORDS_1800_2009 = 0x0040,
|
||||
GN_KEYWORDS_1800_2012 = 0x0080,
|
||||
GN_KEYWORDS_ICARUS = 0x8000
|
||||
};
|
||||
extern int lexor_keyword_mask;
|
||||
@@ -248,4 +283,4 @@ extern void cleanup_sys_func_table();
|
||||
*/
|
||||
extern ivl_sfunc_as_task_t def_sfunc_as_task;
|
||||
|
||||
#endif
|
||||
#endif /* IVL_compiler_H */
|
||||
|
||||
+7
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef __config_H /* -*- c++ -*- */
|
||||
#define __config_H
|
||||
#ifndef IVL_config_H /* -*- c++ -*- */
|
||||
#define IVL_config_H
|
||||
/*
|
||||
* Copyright (c) 2001-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
@@ -53,6 +53,8 @@
|
||||
/* These two are needed by the lxt and lxt2 files (copied from GTKWave). */
|
||||
# undef HAVE_ALLOCA_H
|
||||
# undef HAVE_FSEEKO
|
||||
/* And this is needed by the fst files (copied from GTKWave). */
|
||||
# undef HAVE_LIBPTHREAD
|
||||
|
||||
/*
|
||||
* Define this if you want to compile vvp with memory freeing and
|
||||
@@ -60,4 +62,4 @@
|
||||
*/
|
||||
# undef CHECK_WITH_VALGRIND
|
||||
|
||||
#endif /* __config_H */
|
||||
#endif /* IVL_config_H */
|
||||
|
||||
+33
-13
@@ -8,20 +8,21 @@ AC_CONFIG_HEADER(vpi/vpi_config.h)
|
||||
AC_CONFIG_HEADER(libveriuser/config.h)
|
||||
AC_CONFIG_HEADER(tgt-vvp/vvp_config.h)
|
||||
AC_CONFIG_HEADER(tgt-vhdl/vhdl_config.h)
|
||||
AC_CONFIG_HEADER(tgt-pcb/pcb_config.h)
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
# AC_PROG_CC_C99 is only available in autoconf version 2.60 and later.
|
||||
# If you must use an older version then comment out the following two
|
||||
# lines, but be warned that there could be issues with finding the
|
||||
# nan(), etc. functions. It is really best to upgrade to a supported
|
||||
# version of autoconf.
|
||||
AC_PREREQ([2.60])
|
||||
AC_PROG_CC_C99
|
||||
AC_PROG_CXX
|
||||
AC_PROG_RANLIB
|
||||
AC_CHECK_TOOL(LD, ld, false)
|
||||
AC_CHECK_TOOL(AR, ar, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(STRIP, strip, true)
|
||||
AC_CHECK_TOOL(WINDRES,windres,false)
|
||||
AC_CHECK_PROGS(XGPERF,gperf,none)
|
||||
AC_CHECK_PROGS(MAN,man,none)
|
||||
AC_CHECK_PROGS(PS2PDF,ps2pdf,none)
|
||||
@@ -31,7 +32,7 @@ then
|
||||
echo ""
|
||||
echo "*** Warning: No suitable gperf found. ***"
|
||||
echo " The gperf package is essential for building ivl from"
|
||||
echo " CVS sources, or modifying the parse engine of ivl itself."
|
||||
echo " git sources, or modifying the parse engine of ivl itself."
|
||||
echo " You can get away without it when simply building from"
|
||||
echo " snapshots or major releases."
|
||||
echo ""
|
||||
@@ -80,12 +81,27 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
CFLAGS="$iverilog_temp_cflags"
|
||||
|
||||
AC_SUBST(DEPENDENCY_FLAG, [-MD])
|
||||
AC_SUBST(WARNING_FLAGS, ["-Wall -Wshadow"])
|
||||
AC_SUBST(WARNING_FLAGS_CXX, ["$iverilog_wextra_flag"])
|
||||
AC_SUBST(WARNING_FLAGS, ["-Wall $iverilog_wextra_flag -Wshadow"])
|
||||
AC_SUBST(WARNING_FLAGS_CC, [""])
|
||||
AC_SUBST(WARNING_FLAGS_CXX, [""])
|
||||
fi
|
||||
|
||||
AC_LANG(C++)
|
||||
|
||||
AC_ARG_WITH([m32], [AC_HELP_STRING([--with-m32], [Compile 32-bit on x86_64])],
|
||||
[ with_m32=yes ],[ with_m32=no ])
|
||||
|
||||
AS_IF( [test "x$with_m32" = xyes],
|
||||
[ AC_MSG_NOTICE([Compiling for 32-bit environment - needs gcc on x86_64])
|
||||
LDTARGETFLAGS="-m elf_i386"
|
||||
CTARGETFLAGS="-m32"
|
||||
],
|
||||
[])
|
||||
|
||||
CFLAGS="$CTARGETFLAGS $CFLAGS"
|
||||
CXXFLAGS="$CTARGETFLAGS $CXXFLAGS"
|
||||
LDFLAGS="$CTARGETFLAGS $LDFLAGS"
|
||||
|
||||
# Check that we are using either the GNU compilers or the Sun compilers
|
||||
# but not a mixture of the two (not currently supported).
|
||||
AC_CHECK_DECL(__SUNPRO_CC, using_sunpro_cc=1, using_sunpro_cc=0)
|
||||
@@ -106,7 +122,11 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
iverilog_temp_cxxflags="$CXXFLAGS"
|
||||
CXXFLAGS="-DHAVE_DECL_BASENAME $CXXFLAGS"
|
||||
|
||||
AC_CHECK_HEADERS(getopt.h inttypes.h libiberty.h iosfwd sys/wait.h)
|
||||
CXXFLAGS="$iverilog_temp_cxxflags"
|
||||
|
||||
AC_CHECK_SIZEOF(unsigned long long)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
@@ -173,6 +193,11 @@ if test -z "$DLLIB" ; then
|
||||
AC_CHECK_LIB(dld,shl_load,[DLLIB=-ldld])
|
||||
fi
|
||||
AC_SUBST(DLLIB)
|
||||
AC_SUBST(LDRELOCFLAGS)
|
||||
|
||||
AC_SUBST(CTARGETFLAGS)
|
||||
AC_SUBST(LDTARGETFLAGS)
|
||||
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
@@ -189,9 +214,6 @@ AX_LD_EXTRALIBS
|
||||
# CFLAGS inherited by cadpli/Makefile?
|
||||
AX_C_PICFLAG
|
||||
|
||||
# may modify CPPFLAGS and CFLAGS
|
||||
AX_CPP_PRECOMP
|
||||
|
||||
# may modify LDFLAGS
|
||||
AX_C99_STRTOD
|
||||
|
||||
@@ -297,6 +319,4 @@ AC_MSG_ERROR(cannot configure white space in libdir: $libdir)
|
||||
fi
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
# XXX disable tgt-fpga for the moment
|
||||
|
||||
AC_OUTPUT(Makefile ivlpp/Makefile vhdlpp/Makefile vvp/Makefile vpi/Makefile driver/Makefile driver-vpi/Makefile cadpli/Makefile libveriuser/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-vvp/Makefile tgt-vhdl/Makefile tgt-fpga/Makefile tgt-verilog/Makefile tgt-pal/Makefile tgt-vlog95/Makefile)
|
||||
AC_OUTPUT(Makefile ivlpp/Makefile vhdlpp/Makefile vvp/Makefile vpi/Makefile driver/Makefile driver-vpi/Makefile cadpli/Makefile libveriuser/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-vvp/Makefile tgt-vhdl/Makefile tgt-fpga/Makefile tgt-verilog/Makefile tgt-pal/Makefile tgt-vlog95/Makefile tgt-pcb/Makefile tgt-blif/Makefile tgt-sizer/Makefile)
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
// These are correct and are used to find the base (zero) pin.
|
||||
thisSubtraction:netlist.h:4164
|
||||
thisSubtraction:netlist.h:4173
|
||||
thisSubtraction:netlist.h:4938
|
||||
thisSubtraction:netlist.h:4947
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2013 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,18 +14,19 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
# include <algorithm>
|
||||
# include <vector>
|
||||
# include <cstdlib>
|
||||
# include "netlist.h"
|
||||
# include "netmisc.h"
|
||||
# include "functor.h"
|
||||
# include "compiler.h"
|
||||
# include "ivl_assert.h"
|
||||
# include <vector>
|
||||
|
||||
|
||||
/*
|
||||
@@ -42,11 +43,14 @@ struct cprop_functor : public functor_t {
|
||||
virtual void signal(Design*des, NetNet*obj);
|
||||
virtual void lpm_add_sub(Design*des, NetAddSub*obj);
|
||||
virtual void lpm_compare(Design*des, NetCompare*obj);
|
||||
virtual void lpm_compare_eq_(Design*des, NetCompare*obj);
|
||||
virtual void lpm_concat(Design*des, NetConcat*obj);
|
||||
virtual void lpm_ff(Design*des, NetFF*obj);
|
||||
virtual void lpm_logic(Design*des, NetLogic*obj);
|
||||
virtual void lpm_mux(Design*des, NetMux*obj);
|
||||
};
|
||||
virtual void lpm_part_select(Design*des, NetPartSelect*obj);
|
||||
|
||||
void lpm_compare_eq_(Design*des, NetCompare*obj);
|
||||
};
|
||||
|
||||
void cprop_functor::signal(Design*, NetNet*)
|
||||
{
|
||||
@@ -74,6 +78,50 @@ void cprop_functor::lpm_compare_eq_(Design*, NetCompare*)
|
||||
{
|
||||
}
|
||||
|
||||
void cprop_functor::lpm_concat(Design*des, NetConcat*obj)
|
||||
{
|
||||
// Sorry, I don't know how to constant-propagate through
|
||||
// transparent concatenations.
|
||||
if (obj->transparent())
|
||||
return;
|
||||
|
||||
verinum result (verinum::Vz, obj->width());
|
||||
unsigned off = 0;
|
||||
|
||||
for (unsigned idx = 1 ; idx < obj->pin_count() ; idx += 1) {
|
||||
Nexus*nex = obj->pin(idx).nexus();
|
||||
// If there are non-constant drivers, then give up.
|
||||
if (! nex->drivers_constant())
|
||||
return;
|
||||
|
||||
verinum tmp = nex->driven_vector();
|
||||
result.set(off, tmp);
|
||||
off += tmp.len();
|
||||
}
|
||||
|
||||
if (debug_optimizer)
|
||||
cerr << obj->get_fileline() << ": cprop_functor::lpm_concat: "
|
||||
<< "Replace NetConcat with " << result << "." << endl;
|
||||
|
||||
|
||||
NetScope*scope = obj->scope();
|
||||
|
||||
// Create a NetConst object to carry the result. Give it the
|
||||
// same name as the Concat object that we are replacing, and
|
||||
// link the NetConst to the NetConcat object. Then delete the
|
||||
// concat that is now replaced.
|
||||
NetConst*result_obj = new NetConst(scope, obj->name(), result);
|
||||
result_obj->set_line(*obj);
|
||||
des->add_node(result_obj);
|
||||
connect(obj->pin(0), result_obj->pin(0));
|
||||
|
||||
// Note that this will leave the const inputs to dangle. They
|
||||
// will be reaped by other passes of cprop_functor.
|
||||
delete obj;
|
||||
|
||||
count += 1;
|
||||
}
|
||||
|
||||
void cprop_functor::lpm_ff(Design*, NetFF*obj)
|
||||
{
|
||||
// Look for and count unlinked FF outputs. Note that if the
|
||||
@@ -115,11 +163,6 @@ void cprop_functor::lpm_mux(Design*des, NetMux*obj)
|
||||
if (! sel_nex->drivers_constant())
|
||||
return;
|
||||
|
||||
// If the select input is assigned or forced, then again there
|
||||
// is nothing we can do here.
|
||||
if (sel_nex->assign_lval())
|
||||
return;
|
||||
|
||||
// If the constant select is 'bz or 'bx, then give up.
|
||||
verinum::V sel_val = sel_nex->driven_value();
|
||||
if (sel_val == verinum::Vz || sel_val == verinum::Vx)
|
||||
@@ -150,6 +193,142 @@ void cprop_functor::lpm_mux(Design*des, NetMux*obj)
|
||||
count += 1;
|
||||
}
|
||||
|
||||
static bool compare_base(NetPartSelect*a, NetPartSelect*b)
|
||||
{
|
||||
return a->base() < b->base();
|
||||
}
|
||||
|
||||
/*
|
||||
* This optimization searches for Nexa that are driven only by
|
||||
* NetPartSelect(PV) outputs. These might turn from Verilog input that
|
||||
* looks like this:
|
||||
* wire [7:0] foo
|
||||
* assign foo[7:4] = a;
|
||||
* assign foo[3:0] = b;
|
||||
* The idea is to convert the part selects of the above to a single
|
||||
* concatenation that looks like this:
|
||||
* assign foo = {a, b};
|
||||
*/
|
||||
void cprop_functor::lpm_part_select(Design*des, NetPartSelect*obj)
|
||||
{
|
||||
if (obj->dir() != NetPartSelect::PV)
|
||||
return;
|
||||
|
||||
NetScope*scope = obj->scope();
|
||||
Nexus*nex = obj->pin(1).nexus();
|
||||
vector<NetPartSelect*> obj_set;
|
||||
|
||||
for (Link*cur = nex->first_nlink() ; cur ; cur = cur->next_nlink()) {
|
||||
|
||||
// If this is an input (or passive) then ignore it.
|
||||
if (cur->get_dir() != Link::OUTPUT)
|
||||
continue;
|
||||
|
||||
// Check to see if this is the output of a
|
||||
// NetPartSelect::PV. If not, then give up on the blend.
|
||||
NetPins*tmp_obj = cur->get_obj();
|
||||
unsigned tmp_pin = cur->get_pin();
|
||||
|
||||
NetPartSelect*cur_obj = dynamic_cast<NetPartSelect*> (tmp_obj);
|
||||
if (cur_obj == 0)
|
||||
return;
|
||||
|
||||
if (cur_obj->dir() != NetPartSelect::PV)
|
||||
return;
|
||||
|
||||
if (tmp_pin != 1)
|
||||
return;
|
||||
|
||||
obj_set.push_back(cur_obj);
|
||||
}
|
||||
|
||||
if (obj_set.size() < 2)
|
||||
return;
|
||||
|
||||
if (debug_optimizer)
|
||||
cerr << obj->get_fileline() << ": cprop::lpm_part_select: "
|
||||
<< "Found " << obj_set.size() << " NetPartSelect(PV) objects."
|
||||
<< endl;
|
||||
|
||||
// Sort by increasing base offset.
|
||||
sort(obj_set.begin(), obj_set.end(), compare_base);
|
||||
|
||||
// Check and make sure there are no overlaps. If there are,
|
||||
// then give up on this optimization.
|
||||
for (size_t idx = 1 ; idx < obj_set.size() ; idx += 1) {
|
||||
unsigned top = obj_set[idx-1]->base() + obj_set[idx-1]->width();
|
||||
if (top > obj_set[idx]->base()) {
|
||||
if (debug_optimizer)
|
||||
cerr << obj->get_fileline() << ": cprop::lpm_part_select: "
|
||||
<< "Range [" << obj_set[idx-1]->base()
|
||||
<< " " << top << ") overlaps PV starting at "
|
||||
<< obj_set[idx]->base() << ". Give up." << endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the tail runs off the end of the target. If so it
|
||||
// should be possible to replace it with a bit select to
|
||||
// shorten the object for the target, but for now just give up.
|
||||
unsigned sig_width = nex->vector_width();
|
||||
if (obj_set.back()->base() + obj_set.back()->width() > sig_width) {
|
||||
if (debug_optimizer)
|
||||
cerr << obj->get_fileline() << ": cprop::lpm_part_select: "
|
||||
<< "Range [" << obj_set.back()->base()
|
||||
<< ":" << (obj_set.back()->base() + obj_set.back()->width() - 1)
|
||||
<< "] runs off the end of target." << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Figure out how many components we are going to need.
|
||||
unsigned part_count = 0;
|
||||
unsigned off = 0;
|
||||
for (size_t idx = 0 ; idx < obj_set.size() ; idx += 1) {
|
||||
if (obj_set[idx]->base() > off) {
|
||||
off = obj_set[idx]->base();
|
||||
part_count += 1;
|
||||
}
|
||||
off += obj_set[idx]->width();
|
||||
part_count += 1;
|
||||
}
|
||||
|
||||
if (off < sig_width)
|
||||
part_count += 1;
|
||||
|
||||
NetConcat*concat = new NetConcat(scope, scope->local_symbol(),
|
||||
sig_width, part_count);
|
||||
concat->set_line(*obj);
|
||||
des->add_node(concat);
|
||||
connect(concat->pin(0), obj->pin(1));
|
||||
|
||||
off = 0;
|
||||
size_t concat_pin = 1;
|
||||
for (size_t idx = 0 ; idx < obj_set.size() ; idx += 1) {
|
||||
NetPartSelect*cobj = obj_set[idx];
|
||||
if (cobj->base() > off) {
|
||||
NetNet*zzz = make_const_z(des, scope, cobj->base()-off);
|
||||
connect(concat->pin(concat_pin), zzz->pin(0));
|
||||
concat_pin += 1;
|
||||
off = cobj->base();
|
||||
}
|
||||
connect(concat->pin(concat_pin), cobj->pin(0));
|
||||
concat_pin += 1;
|
||||
off += cobj->width();
|
||||
}
|
||||
if (off < sig_width) {
|
||||
NetNet*zzz = make_const_z(des, scope, sig_width-off);
|
||||
connect(concat->pin(concat_pin), zzz->pin(0));
|
||||
concat_pin += 1;
|
||||
}
|
||||
ivl_assert(*obj, concat_pin == concat->pin_count());
|
||||
|
||||
for (size_t idx = 0 ; idx < obj_set.size() ; idx += 1) {
|
||||
delete obj_set[idx];
|
||||
}
|
||||
|
||||
count += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* This functor looks to see if the constant is connected to nothing
|
||||
* but signals. If that is the case, delete the dangling constant and
|
||||
|
||||
+418
-88
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -28,6 +28,10 @@
|
||||
# include "netlist.h"
|
||||
# include "compiler.h"
|
||||
# include "discipline.h"
|
||||
# include "netclass.h"
|
||||
# include "netdarray.h"
|
||||
# include "netqueue.h"
|
||||
# include "netvector.h"
|
||||
# include "ivl_assert.h"
|
||||
# include "PExpr.h"
|
||||
|
||||
@@ -40,6 +44,12 @@ static ostream& operator<< (ostream&o, NetBlock::Type t)
|
||||
case NetBlock::PARA:
|
||||
o << "fork";
|
||||
break;
|
||||
case NetBlock::PARA_JOIN_NONE:
|
||||
o << "fork-join_none";
|
||||
break;
|
||||
case NetBlock::PARA_JOIN_ANY:
|
||||
o << "fork-join_any";
|
||||
break;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
@@ -98,6 +108,15 @@ ostream& operator << (ostream&o, ivl_variable_type_t val)
|
||||
case IVL_VT_STRING:
|
||||
o << "string";
|
||||
break;
|
||||
case IVL_VT_DARRAY:
|
||||
o << "darray";
|
||||
break;
|
||||
case IVL_VT_CLASS:
|
||||
o << "class";
|
||||
break;
|
||||
case IVL_VT_QUEUE:
|
||||
o << "queue";
|
||||
break;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
@@ -130,6 +149,93 @@ ostream& operator << (ostream&o, ivl_switch_type_t val)
|
||||
return o;
|
||||
}
|
||||
|
||||
ostream& operator << (ostream&fd, PortType::Enum val)
|
||||
{
|
||||
switch (val) {
|
||||
case PortType::NOT_A_PORT:
|
||||
fd << "NOT_A_PORT";
|
||||
break;
|
||||
case PortType::PIMPLICIT:
|
||||
fd << "PIMPLICIT";
|
||||
break;
|
||||
case PortType::PINPUT:
|
||||
fd << "PINPUT";
|
||||
break;
|
||||
case PortType::POUTPUT:
|
||||
fd << "POUTPUT";
|
||||
break;
|
||||
case PortType::PINOUT:
|
||||
fd << "PINOUT";
|
||||
break;
|
||||
case PortType::PREF:
|
||||
fd << "PREF";
|
||||
break;
|
||||
default:
|
||||
fd << "PortType::Enum::?";
|
||||
break;
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
ostream& operator << (ostream&fd, NetCaseCmp::kind_t that)
|
||||
{
|
||||
switch (that) {
|
||||
case NetCaseCmp::EEQ:
|
||||
fd << "===";
|
||||
break;
|
||||
case NetCaseCmp::NEQ:
|
||||
fd << "!==";
|
||||
break;
|
||||
case NetCaseCmp::XEQ:
|
||||
fd << "==?";
|
||||
break;
|
||||
case NetCaseCmp::ZEQ:
|
||||
fd << "==z?";
|
||||
break;
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
ostream& ivl_type_s::debug_dump(ostream&o) const
|
||||
{
|
||||
o << typeid(*this).name();
|
||||
return o;
|
||||
}
|
||||
|
||||
ostream& netclass_t::debug_dump(ostream&fd) const
|
||||
{
|
||||
fd << "class " << name_ << "{";
|
||||
for (size_t idx = 0 ; idx < property_table_.size() ; idx += 1) {
|
||||
if (idx != 0) fd << "; ";
|
||||
if (property_table_[idx].type)
|
||||
property_table_[idx].type->debug_dump(fd);
|
||||
else
|
||||
fd << "NO_TYPE";
|
||||
fd << " " << property_table_[idx].name;
|
||||
}
|
||||
fd << "}";
|
||||
return fd;
|
||||
}
|
||||
|
||||
ostream& netdarray_t::debug_dump(ostream&o) const
|
||||
{
|
||||
o << "dynamic array of " << *element_type();
|
||||
return o;
|
||||
}
|
||||
|
||||
ostream& netqueue_t::debug_dump(ostream&fd) const
|
||||
{
|
||||
fd << "queue of " << *element_type();
|
||||
return fd;
|
||||
}
|
||||
|
||||
ostream& netvector_t::debug_dump(ostream&o) const
|
||||
{
|
||||
o << type_ << (signed_? " signed" : " unsigned") << packed_dims_;
|
||||
return o;
|
||||
}
|
||||
|
||||
static inline void dump_scope_path(ostream&o, const NetScope*scope)
|
||||
{
|
||||
const NetScope*parent = scope->parent();
|
||||
@@ -137,10 +243,7 @@ static inline void dump_scope_path(ostream&o, const NetScope*scope)
|
||||
dump_scope_path(o, parent);
|
||||
o << ".";
|
||||
}
|
||||
const hname_t name = scope->fullname();
|
||||
o << name.peek_name();
|
||||
if (name.has_number())
|
||||
o << "[" << name.peek_number() << "]";
|
||||
o << scope->fullname();
|
||||
}
|
||||
|
||||
ostream& operator <<(ostream&o, struct __ScopePathManip marg)
|
||||
@@ -150,6 +253,77 @@ ostream& operator <<(ostream&o, struct __ScopePathManip marg)
|
||||
return o;
|
||||
}
|
||||
|
||||
ostream& operator <<(ostream&o, struct __ObjectPathManip marg)
|
||||
{
|
||||
if (marg.obj != 0) {
|
||||
dump_scope_path(o, marg.obj->scope());
|
||||
o << "." << marg.obj->name();
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
ostream& operator <<(ostream&fd, Link::DIR dir)
|
||||
{
|
||||
switch (dir) {
|
||||
case Link::PASSIVE:
|
||||
fd << "PASSIVE";
|
||||
break;
|
||||
case Link::INPUT:
|
||||
fd << "INPUT";
|
||||
break;
|
||||
case Link::OUTPUT:
|
||||
fd << "OUTPUT";
|
||||
break;
|
||||
default:
|
||||
fd << "<" << (int)dir << ">";
|
||||
break;
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
void NetPins::show_type(ostream&fd) const
|
||||
{
|
||||
fd << typeid(*this).name();
|
||||
}
|
||||
|
||||
void NetObj::show_type(ostream&fd) const
|
||||
{
|
||||
fd << typeid(*this).name() << "[" << scope_path(scope_) << "." << name_ << "]";
|
||||
}
|
||||
|
||||
struct __ShowTypeManip { const NetPins*pins; };
|
||||
inline __ShowTypeManip show_type(const NetPins*pins)
|
||||
{ __ShowTypeManip tmp; tmp.pins = pins; return tmp; }
|
||||
|
||||
inline ostream& operator << (ostream&fd, __ShowTypeManip man)
|
||||
{
|
||||
if (man.pins == 0)
|
||||
fd << "NexusSet";
|
||||
else
|
||||
man.pins->show_type(fd);
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
||||
void Link::dump_link(ostream&fd, unsigned ind) const
|
||||
{
|
||||
const Link*cur;
|
||||
const Nexus*nex = nexus();
|
||||
|
||||
if (nex == 0) {
|
||||
fd << setw(ind) << "" << "<unlinked>" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
for (cur = nex->first_nlink() ; cur; cur = cur->next_nlink()) {
|
||||
const NetPins*obj = cur->get_obj();
|
||||
unsigned pin = cur->get_pin();
|
||||
fd << setw(ind) << "" << "Pin " << pin
|
||||
<< " of " << show_type(obj)
|
||||
<< ", dir=" << cur->dir_ << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void NetBranch::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
static const char*pin_names[2] = {
|
||||
@@ -187,16 +361,42 @@ void NetDelaySrc::dump(ostream&o, unsigned ind) const
|
||||
dump_node_pins(o, ind+4);
|
||||
}
|
||||
|
||||
static inline ostream&operator<<(ostream&out, const netrange_t&that)
|
||||
{
|
||||
if (that.defined())
|
||||
out << "[" << that.get_msb() << ":" << that.get_lsb() << "]";
|
||||
else
|
||||
out << "[]";
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream&operator<<(ostream&out, const list<netrange_t>&rlist)
|
||||
{
|
||||
for (list<netrange_t>::const_iterator cur = rlist.begin()
|
||||
; cur != rlist.end() ; ++cur) {
|
||||
out << *cur;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream&operator<<(ostream&out, const vector<netrange_t>&rlist)
|
||||
{
|
||||
for (vector<netrange_t>::const_iterator cur = rlist.begin()
|
||||
; cur != rlist.end() ; ++cur) {
|
||||
out << *cur;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/* Dump a net. This can be a wire or register. */
|
||||
void NetNet::dump_net(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << type() << ": " << name()
|
||||
<< "[" << s0_ << ":" << e0_ << " count=" << pin_count() << "]";
|
||||
<< unpacked_dims_ << " unpacked dims=" << unpacked_dimensions();
|
||||
o << " pin_count=" << pin_count();
|
||||
if (local_flag_)
|
||||
o << " (local)";
|
||||
o << " " << data_type_;
|
||||
if (signed_)
|
||||
o << " signed";
|
||||
switch (port_type_) {
|
||||
case NetNet::NOT_A_PORT:
|
||||
break;
|
||||
@@ -212,11 +412,16 @@ void NetNet::dump_net(ostream&o, unsigned ind) const
|
||||
case NetNet::PINOUT:
|
||||
o << " inout";
|
||||
break;
|
||||
case NetNet::PREF:
|
||||
o <<" ref";
|
||||
break;
|
||||
}
|
||||
|
||||
if (ivl_discipline_t dis = get_discipline())
|
||||
o << " discipline=" << dis->name();
|
||||
|
||||
if (net_type_) o << " " << *net_type_;
|
||||
|
||||
o << " (eref=" << peek_eref() << ", lref=" << peek_lref() << ")";
|
||||
if (scope())
|
||||
o << " scope=" << scope_path(scope());
|
||||
@@ -382,8 +587,12 @@ void NetCompare::dump_node(ostream&o, unsigned ind) const
|
||||
|
||||
void NetConcat::dump_node(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "NetConcat: "
|
||||
<< name();
|
||||
if (transparent_)
|
||||
o << setw(ind) << "" << "NetConcat8: ";
|
||||
else
|
||||
o << setw(ind) << "" << "NetConcat: ";
|
||||
o << name();
|
||||
|
||||
if (rise_time())
|
||||
o << " #(" << *rise_time()
|
||||
<< "," << *fall_time() << "," << *decay_time() << ")";
|
||||
@@ -446,19 +655,14 @@ void NetBUFZ::dump_node(ostream&o, unsigned ind) const
|
||||
|
||||
void NetCaseCmp::dump_node(ostream&o, unsigned ind) const
|
||||
{
|
||||
if (eeq_)
|
||||
o << setw(ind) << "" << "case compare === : " << name() << endl;
|
||||
else
|
||||
o << setw(ind) << "" << "case compare !== : " << name() << endl;
|
||||
o << setw(ind) << "" << "case compare " << kind_ << ": " << name() << endl;
|
||||
|
||||
dump_node_pins(o, ind+4);
|
||||
}
|
||||
|
||||
void NetConst::dump_node(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "constant " << width_ << "'b";
|
||||
for (unsigned idx = width_ ; idx > 0 ; idx -= 1)
|
||||
o << value_[idx-1];
|
||||
o << setw(ind) << "" << "constant " << value_;
|
||||
o << ": " << name();
|
||||
if (rise_time())
|
||||
o << " #(" << *rise_time()
|
||||
@@ -599,6 +803,21 @@ void NetPartSelect::dump_node(ostream&o, unsigned ind) const
|
||||
dump_obj_attr(o, ind+4);
|
||||
}
|
||||
|
||||
void NetSubstitute::dump_node(ostream&fd, unsigned ind) const
|
||||
{
|
||||
fd << setw(ind) << "" << "NetSubstitute: "
|
||||
<< name();
|
||||
if (rise_time())
|
||||
fd << " #(" << *rise_time()
|
||||
<< "," << *fall_time()
|
||||
<< "," << *decay_time() << ")";
|
||||
else
|
||||
fd << " #(.,.,.)";
|
||||
fd << " width=" << wid_ << " base=" << off_ <<endl;
|
||||
dump_node_pins(fd, ind+4);
|
||||
dump_obj_attr(fd, ind+4);
|
||||
}
|
||||
|
||||
void NetReplicate::dump_node(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "NetReplicate: "
|
||||
@@ -680,12 +899,13 @@ void NetUserFunc::dump_node(ostream&o, unsigned ind) const
|
||||
|
||||
void NetTaskDef::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "task " << scope_path(scope_) << ";" << endl;
|
||||
o << setw(ind) << "" << "task " << scope_path(scope()) << ";" << endl;
|
||||
|
||||
for (unsigned idx = 0 ; idx < ports_.count() ; idx += 1) {
|
||||
for (unsigned idx = 0 ; idx < port_count() ; idx += 1) {
|
||||
const NetNet*pnet = port(idx);
|
||||
o << setw(ind+4) << "";
|
||||
assert(ports_[idx]);
|
||||
switch (ports_[idx]->port_type()) {
|
||||
assert(pnet);
|
||||
switch (pnet->port_type()) {
|
||||
case NetNet::PINPUT:
|
||||
o << "input ";
|
||||
break;
|
||||
@@ -699,10 +919,13 @@ void NetTaskDef::dump(ostream&o, unsigned ind) const
|
||||
o << "NOT_A_PORT ";
|
||||
break;
|
||||
}
|
||||
o << ports_[idx]->name() << ";" << endl;
|
||||
o << pnet->name() << ";" << endl;
|
||||
}
|
||||
|
||||
proc_->dump(o, ind+4);
|
||||
if (proc_)
|
||||
proc_->dump(o, ind+4);
|
||||
else
|
||||
o << setw(ind+4) << "" << "MISSING PROCEDURAL CODE" << endl;
|
||||
|
||||
o << setw(ind) << "" << "endtask" << endl;
|
||||
}
|
||||
@@ -792,16 +1015,18 @@ void NetAlloc::dump(ostream&o, unsigned ind) const
|
||||
|
||||
void NetAssign_::dump_lval(ostream&o) const
|
||||
{
|
||||
if (sig_) {
|
||||
o << sig_->name();
|
||||
if (word_) {
|
||||
o << "[word=" << *word_ << "]";
|
||||
}
|
||||
if (base_) {
|
||||
o << "[" << *base_ << " +: " << lwid_ << "]";
|
||||
}
|
||||
} else {
|
||||
o << "";
|
||||
if (sig_) o << sig_->name();
|
||||
else if (nest_) nest_->dump_lval(o);
|
||||
else o << "<?>";
|
||||
|
||||
if (! member_.nil()) {
|
||||
o << "." << member_;
|
||||
}
|
||||
if (word_) {
|
||||
o << "[word=" << *word_ << "]";
|
||||
}
|
||||
if (base_) {
|
||||
o << "[" << *base_ << " +: " << lwid_ << "]";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,7 +1049,10 @@ void NetAssign::dump(ostream&o, unsigned ind) const
|
||||
o << setw(ind) << "";
|
||||
dump_lval(o);
|
||||
|
||||
o << " = ";
|
||||
if (op_)
|
||||
o << " " << op_ << "= ";
|
||||
else
|
||||
o << " = ";
|
||||
|
||||
if (const NetExpr*de = get_delay())
|
||||
o << "#(" << *de << ") ";
|
||||
@@ -893,7 +1121,7 @@ void NetCase::dump(ostream&o, unsigned ind) const
|
||||
break;
|
||||
}
|
||||
|
||||
for (unsigned idx = 0 ; idx < nitems_ ; idx += 1) {
|
||||
for (unsigned idx = 0 ; idx < items_.size() ; idx += 1) {
|
||||
o << setw(ind+2) << "";
|
||||
if (items_[idx].guard)
|
||||
o << *items_[idx].guard << ":";
|
||||
@@ -951,8 +1179,17 @@ void NetDeassign::dump(ostream&o, unsigned ind) const
|
||||
|
||||
void NetDisable::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "disable " << scope_path(target_) << "; "
|
||||
<< "/* " << get_fileline() << " */" << endl;
|
||||
o << setw(ind) << "" << "disable ";
|
||||
if (target_) o << scope_path(target_);
|
||||
else o << "fork";
|
||||
o << "; " << "/* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void NetDoWhile::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "do" << endl;
|
||||
proc_->dump(o, ind+3);
|
||||
o << setw(ind) << "" << "while (" << *cond_ << ");" << endl;
|
||||
}
|
||||
|
||||
void NetEvProbe::dump_node(ostream&o, unsigned ind) const
|
||||
@@ -983,7 +1220,15 @@ void NetEvTrig::dump(ostream&o, unsigned ind) const
|
||||
|
||||
void NetEvWait::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) <<"" << "@(";
|
||||
o << setw(ind) << "";
|
||||
|
||||
/* Check for a wait fork. */
|
||||
if ((nevents() == 1) && (event(0) == 0)) {
|
||||
o << "wait fork;";
|
||||
return;
|
||||
}
|
||||
|
||||
o << "@(";
|
||||
|
||||
if (nevents() > 0)
|
||||
o << event(0)->name();
|
||||
@@ -1007,6 +1252,12 @@ ostream& operator << (ostream&out, const NetEvWait&obj)
|
||||
|
||||
void NetEvWait::dump_inline(ostream&o) const
|
||||
{
|
||||
/* Check for a wait fork. */
|
||||
if ((nevents() == 1) && (event(0) == 0)) {
|
||||
o << "wait fork;";
|
||||
return;
|
||||
}
|
||||
|
||||
o << "@(";
|
||||
|
||||
if (nevents() > 0)
|
||||
@@ -1031,6 +1282,13 @@ void NetForever::dump(ostream&o, unsigned ind) const
|
||||
statement_->dump(o, ind+2);
|
||||
}
|
||||
|
||||
void NetForLoop::dump(ostream&fd, unsigned ind) const
|
||||
{
|
||||
fd << setw(ind) << "" << "FOR LOOP index=" << index_->name() << endl;
|
||||
statement_->dump(fd, ind+4);
|
||||
step_statement_->dump(fd, ind+4);
|
||||
}
|
||||
|
||||
void NetFree::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "// free storage : " << scope_path(scope_) << endl;
|
||||
@@ -1038,12 +1296,11 @@ void NetFree::dump(ostream&o, unsigned ind) const
|
||||
|
||||
void NetFuncDef::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "function definition for " << scope_path(scope_) << endl;
|
||||
o << setw(ind) << "" << "function definition for " << scope_path(scope()) << endl;
|
||||
if (result_sig_) {
|
||||
o << setw(ind+2) << "" << "Return signal: ";
|
||||
if (result_sig_->get_signed()) o << "+";
|
||||
o << result_sig_->name() << "[" << result_sig_->msb() << ":"
|
||||
<< result_sig_->lsb() << "]" << endl;
|
||||
o << result_sig_->name() << endl;
|
||||
}
|
||||
o << setw(ind+2) << "" << "Arguments: ";
|
||||
if (port_count() == 0) o << "<none>";
|
||||
@@ -1065,13 +1322,12 @@ void NetFuncDef::dump(ostream&o, unsigned ind) const
|
||||
break;
|
||||
}
|
||||
if (port(idx)->get_signed()) o << "+";
|
||||
o << port(idx)->name() << "[" << port(idx)->msb() << ":"
|
||||
<< port(idx)->lsb() << "]" << endl;
|
||||
o << port(idx)->name() << endl;
|
||||
}
|
||||
if (statement_)
|
||||
statement_->dump(o, ind+2);
|
||||
if (proc_)
|
||||
proc_->dump(o, ind+2);
|
||||
else
|
||||
o << setw(ind+2) << "" << "// NO STATEMENT" << endl;
|
||||
o << setw(ind+2) << "" << "MISSING PROCEDURAL CODE" << endl;
|
||||
}
|
||||
|
||||
void NetPDelay::dump(ostream&o, unsigned ind) const
|
||||
@@ -1104,6 +1360,11 @@ void NetRepeat::dump(ostream&o, unsigned ind) const
|
||||
statement_->dump(o, ind+2);
|
||||
}
|
||||
|
||||
void netclass_t::dump_scope(ostream&fd) const
|
||||
{
|
||||
class_scope_->dump(fd);
|
||||
}
|
||||
|
||||
void NetScope::dump(ostream&o) const
|
||||
{
|
||||
/* This is a constructed hierarchical name. */
|
||||
@@ -1112,7 +1373,10 @@ void NetScope::dump(ostream&o) const
|
||||
print_type(o);
|
||||
if (is_auto()) o << " (automatic)";
|
||||
if (is_cell()) o << " (cell)";
|
||||
o << endl;
|
||||
if (nested_module()) o << " (nested)";
|
||||
if (program_block()) o << " (program)";
|
||||
o << " " << children_.size() << " children, "
|
||||
<< classes_.size() << " classes" << endl;
|
||||
|
||||
for (unsigned idx = 0 ; idx < attr_cnt() ; idx += 1)
|
||||
o << " (* " << attr_key(idx) << " = "
|
||||
@@ -1126,7 +1390,10 @@ void NetScope::dump(ostream&o) const
|
||||
map<perm_string,param_expr_t>::const_iterator pp;
|
||||
for (pp = parameters.begin()
|
||||
; pp != parameters.end() ; ++ pp ) {
|
||||
o << " parameter ";
|
||||
if ((*pp).second.is_annotatable)
|
||||
o << " specparam ";
|
||||
else
|
||||
o << " parameter ";
|
||||
|
||||
o << pp->second.type << " ";
|
||||
|
||||
@@ -1173,12 +1440,6 @@ void NetScope::dump(ostream&o) const
|
||||
|
||||
o << ";" << endl;
|
||||
}
|
||||
|
||||
for (pp = localparams.begin()
|
||||
; pp != localparams.end() ; ++ pp ) {
|
||||
o << " localparam " << (*pp).first << " = " <<
|
||||
*(*pp).second.val << ";" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the saved defparam assignments here. */
|
||||
@@ -1203,9 +1464,9 @@ void NetScope::dump(ostream&o) const
|
||||
o << " enum sets {" << endl;
|
||||
|
||||
/* Dump the enumerations and enum names in this scope. */
|
||||
for (list<netenum_t*>::const_iterator cur = enum_sets_.begin()
|
||||
for (map<const enum_type_t*,netenum_t*>::const_iterator cur = enum_sets_.begin()
|
||||
; cur != enum_sets_.end() ; ++ cur) {
|
||||
o << " " << *cur << endl;
|
||||
o << " " << cur->second << endl;
|
||||
}
|
||||
o << " }" << endl;
|
||||
|
||||
@@ -1230,27 +1491,6 @@ void NetScope::dump(ostream&o) const
|
||||
cur->second->dump_net(o, 4);
|
||||
}
|
||||
|
||||
// Dump specparams
|
||||
typedef map<perm_string,spec_val_t>::const_iterator specparam_it_t;
|
||||
for (specparam_it_t cur = specparams.begin()
|
||||
; cur != specparams.end() ; ++ cur ) {
|
||||
o << " specparam " << (*cur).first
|
||||
<< " = ";
|
||||
spec_val_t value = (*cur).second;
|
||||
switch (value.type) {
|
||||
case IVL_VT_REAL:
|
||||
o << "R:" << value.real_val;
|
||||
break;
|
||||
case IVL_VT_BOOL:
|
||||
o << "I:" << value.integer;
|
||||
break;
|
||||
default:
|
||||
o << "<bad type>";
|
||||
break;
|
||||
}
|
||||
o << endl;
|
||||
}
|
||||
|
||||
switch (type_) {
|
||||
case FUNC:
|
||||
if (func_def())
|
||||
@@ -1272,18 +1512,23 @@ void NetScope::dump(ostream&o) const
|
||||
for (map<hname_t,NetScope*>::const_iterator cur = children_.begin()
|
||||
; cur != children_.end() ; ++ cur )
|
||||
cur->second->dump(o);
|
||||
|
||||
for (map<perm_string,netclass_t*>::const_iterator cur = classes_.begin()
|
||||
; cur != classes_.end() ; ++ cur ) {
|
||||
cur->second->dump_scope(o);
|
||||
}
|
||||
}
|
||||
|
||||
void NetSTask::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << name_;
|
||||
|
||||
if (parms_.count() > 0) {
|
||||
if (! parms_.empty()) {
|
||||
o << "(";
|
||||
if (parms_[0])
|
||||
parms_[0]->dump(o);
|
||||
|
||||
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
|
||||
for (unsigned idx = 1 ; idx < parms_.size() ; idx += 1) {
|
||||
o << ", ";
|
||||
if (parms_[idx])
|
||||
parms_[idx]->dump(o);
|
||||
@@ -1329,6 +1574,19 @@ void NetEAccess::dump(ostream&o) const
|
||||
o << ")";
|
||||
}
|
||||
|
||||
void NetEArrayPattern::dump(ostream&fd) const
|
||||
{
|
||||
fd << "'{";
|
||||
if (items_.size() >= 1) {
|
||||
if (items_[0]) fd << *items_[0];
|
||||
}
|
||||
for (size_t idx = 1 ; idx < items_.size() ; idx += 1) {
|
||||
fd << ", ";
|
||||
if (items_[idx]) fd << *items_[idx];
|
||||
}
|
||||
fd << "}";
|
||||
}
|
||||
|
||||
void NetEBinary::dump(ostream&o) const
|
||||
{
|
||||
if (op_ == 'm' || op_ == 'M') {
|
||||
@@ -1403,6 +1661,16 @@ void NetEBinary::dump(ostream&o) const
|
||||
o << ")";
|
||||
}
|
||||
|
||||
void NetECast::dump(ostream&fd) const
|
||||
{
|
||||
if (op_=='2')
|
||||
fd << "bool<" << expr_width() << ">(" << *expr_ << ")";
|
||||
else if (op_=='4')
|
||||
fd << "logic<" << expr_width() << ">(" << *expr_ << ")";
|
||||
else
|
||||
NetEUnary::dump(fd);
|
||||
}
|
||||
|
||||
void NetEConcat::dump(ostream&o) const
|
||||
{
|
||||
if (repeat_ != 1)
|
||||
@@ -1413,7 +1681,7 @@ void NetEConcat::dump(ostream&o) const
|
||||
else
|
||||
o << "{";
|
||||
|
||||
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
|
||||
for (unsigned idx = 1 ; idx < parms_.size() ; idx += 1) {
|
||||
if (parms_[idx])
|
||||
o << ", " << *parms_[idx];
|
||||
else
|
||||
@@ -1461,11 +1729,40 @@ void NetEEvent::dump(ostream&o) const
|
||||
o << "<event=" << event_->name() << ">";
|
||||
}
|
||||
|
||||
void NetELast::dump(ostream&fd) const
|
||||
{
|
||||
fd << "<last of " << sig_->name() << ">";
|
||||
}
|
||||
|
||||
void NetENetenum::dump(ostream&o) const
|
||||
{
|
||||
o << "<netenum=" << netenum_ << ">";
|
||||
}
|
||||
|
||||
void NetENew::dump(ostream&o) const
|
||||
{
|
||||
o << "new <type> [";
|
||||
if (size_) size_->dump(o);
|
||||
o << "]";
|
||||
if (init_val_) {
|
||||
o << "(";
|
||||
init_val_->dump(o);
|
||||
o << ")";
|
||||
}
|
||||
}
|
||||
|
||||
void NetENull::dump(ostream&o) const
|
||||
{
|
||||
o << "<null>";
|
||||
}
|
||||
|
||||
void NetEProperty::dump(ostream&o) const
|
||||
{
|
||||
o << net_->name() << ".<" << pidx_ << ">";
|
||||
if (index_)
|
||||
o << "[" << *index_ << "]";
|
||||
}
|
||||
|
||||
void NetEScope::dump(ostream&o) const
|
||||
{
|
||||
o << "<scope=" << scope_path(scope_) << ">";
|
||||
@@ -1487,7 +1784,14 @@ void NetESelect::dump(ostream&o) const
|
||||
else
|
||||
o << "(0)";
|
||||
|
||||
o << "+:" << expr_width() << "]>";
|
||||
o << "+:" << expr_width() << "]";
|
||||
if (ivl_type_t nt = net_type()) {
|
||||
o << " net_type=(" << *nt << ")";
|
||||
} else {
|
||||
o << " expr_type=" << expr_type();
|
||||
}
|
||||
|
||||
o << ">";
|
||||
}
|
||||
|
||||
void NetESFunc::dump(ostream&o) const
|
||||
@@ -1500,13 +1804,19 @@ void NetESFunc::dump(ostream&o) const
|
||||
o << ")";
|
||||
}
|
||||
|
||||
void NetEShallowCopy::dump(ostream&o) const
|
||||
{
|
||||
o << "<ShallowCopy, " << *arg1_ << " <-- " << *arg2_ << ">";
|
||||
}
|
||||
|
||||
void NetESignal::dump(ostream&o) const
|
||||
{
|
||||
if (has_sign())
|
||||
o << "+";
|
||||
o << name();
|
||||
if (word_) o << "[word=" << *word_ << "]";
|
||||
o << "[" << msi()<<":"<<lsi() << "]";
|
||||
vector<netrange_t>tmp = net_->net_type()->slice_dimensions();
|
||||
o << tmp;
|
||||
}
|
||||
|
||||
void NetETernary::dump(ostream&o) const
|
||||
@@ -1517,10 +1827,10 @@ void NetETernary::dump(ostream&o) const
|
||||
|
||||
void NetEUFunc::dump(ostream&o) const
|
||||
{
|
||||
o << func_->basename() << "(";
|
||||
if (parms_.count() > 0) {
|
||||
o << scope_path(func_) << "(";
|
||||
if (! parms_.empty()) {
|
||||
parms_[0]->dump(o);
|
||||
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
|
||||
for (unsigned idx = 1 ; idx < parms_.size() ; idx += 1) {
|
||||
o << ", ";
|
||||
parms_[idx]->dump(o);
|
||||
}
|
||||
@@ -1572,10 +1882,30 @@ void NetEUnary::dump(ostream&o) const
|
||||
void Design::dump(ostream&o) const
|
||||
{
|
||||
o << "DESIGN TIME PRECISION: 10e" << get_precision() << endl;
|
||||
|
||||
o << "PACKAGES:" << endl;
|
||||
for (map<perm_string,NetScope*>::const_iterator cur = packages_.begin()
|
||||
; cur != packages_.end() ; ++cur) {
|
||||
cur->second->dump(o);
|
||||
}
|
||||
|
||||
o << "$ROOT CLASSESS:" << endl;
|
||||
for (map<perm_string,netclass_t*>::const_iterator cur = classes_.begin()
|
||||
; cur != classes_.end() ; ++cur) {
|
||||
cur->second->dump_scope(o);
|
||||
}
|
||||
|
||||
o << "$ROOT TASKS/FUNCTIONS:" << endl;
|
||||
for (map<NetScope*,PTaskFunc*>::const_iterator cur = root_tasks_.begin()
|
||||
; cur != root_tasks_.end() ; ++ cur) {
|
||||
cur->first->dump(o);
|
||||
}
|
||||
|
||||
o << "SCOPES:" << endl;
|
||||
for (list<NetScope*>::const_iterator scope = root_scopes_.begin();
|
||||
scope != root_scopes_.end(); ++ scope )
|
||||
scope != root_scopes_.end(); ++ scope ) {
|
||||
(*scope)->dump(o);
|
||||
}
|
||||
|
||||
o << "ELABORATED NODES:" << endl;
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "discipline.h"
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef __discipline_H
|
||||
#define __discipline_H
|
||||
#ifndef IVL_discipline_H
|
||||
#define IVL_discipline_H
|
||||
/*
|
||||
* Copyright (c) 2008-2010 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2008-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -74,4 +74,4 @@ extern map<perm_string,ivl_discipline_t> disciplines;
|
||||
// Map access function name to the nature that it accesses.
|
||||
extern map<perm_string,ivl_nature_t> access_function_nature;
|
||||
|
||||
#endif
|
||||
#endif /* IVL_discipline_H */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307, USA
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -37,6 +36,7 @@ mandir = @mandir@
|
||||
dllib=@DLLIB@
|
||||
|
||||
CC = @CC@
|
||||
WINDRES = @WINDRES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
@@ -48,7 +48,7 @@ INCLUDE_PATH = -I. -I.. -I$(srcdir) -I$(srcdir)/..
|
||||
endif
|
||||
|
||||
CPPFLAGS = $(INCLUDE_PATH) @CPPFLAGS@ @DEFS@
|
||||
CFLAGS = @WARNING_FLAGS@ @CFLAGS@
|
||||
CFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
O = main.o res.o
|
||||
@@ -88,7 +88,7 @@ res.rc: $(srcdir)/res.rc.in ../version.exe
|
||||
$(srcdir)/res.rc.in > $@
|
||||
|
||||
res.o: res.rc
|
||||
windres -i res.rc -o res.o
|
||||
$(WINDRES) -i res.rc -o res.o
|
||||
#
|
||||
|
||||
install: all installdirs $(bindir)/iverilog-vpi$(suffix)@EXEEXT@
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+14
-9
@@ -12,9 +12,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307, USA
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -50,7 +49,7 @@ INCLUDE_PATH = -I. -I.. -I$(srcdir) -I$(srcdir)/..
|
||||
endif
|
||||
|
||||
CPPFLAGS = $(INCLUDE_PATH) @CPPFLAGS@ @DEFS@
|
||||
CFLAGS = @WARNING_FLAGS@ @CFLAGS@
|
||||
CFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
O = main.o substit.o cflexor.o cfparse.o
|
||||
@@ -68,7 +67,11 @@ distclean: clean
|
||||
rm -f Makefile config.log
|
||||
|
||||
cppcheck: $(O:.o=.c)
|
||||
cppcheck --enable=all -f $(INCLUDE_PATH) $^
|
||||
cppcheck --enable=all -f \
|
||||
-UYY_USER_INIT \
|
||||
-UYYPARSE_PARAM -UYYPRINT -Ushort -Uyyoverflow \
|
||||
-UYYTYPE_INT8 -UYYTYPE_INT16 -UYYTYPE_UINT8 -UYYTYPE_UINT16 \
|
||||
$(INCLUDE_PATH) $^
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
cd ..; ./config.status --file=driver/$@
|
||||
@@ -79,11 +82,13 @@ dep:
|
||||
iverilog@EXEEXT@: $O
|
||||
$(CC) $(LDFLAGS) $O -o iverilog@EXEEXT@ @EXTRALIBS@
|
||||
|
||||
cflexor.c: cflexor.lex
|
||||
$(LEX) -s -ocflexor.c $(srcdir)/cflexor.lex
|
||||
cflexor.c: $(srcdir)/cflexor.lex
|
||||
$(LEX) -s -t $< > $@
|
||||
|
||||
cfparse.h cfparse.c: cfparse.y
|
||||
$(YACC) --verbose -t -d -o cfparse.c --name-prefix=cf $(srcdir)/cfparse.y
|
||||
# Build this in two steps to avoid parallel build issues (see pr3462585)
|
||||
cfparse.c: $(srcdir)/cfparse.y
|
||||
$(YACC) --verbose -t -p cf -d -o $@ $<
|
||||
cfparse.h: cfparse.c
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o
|
||||
|
||||
+6
-4
@@ -4,7 +4,7 @@
|
||||
|
||||
%{
|
||||
/*
|
||||
* Copyright (c) 2001-2009 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -19,7 +19,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "cfparse.h"
|
||||
@@ -92,6 +92,8 @@ int cmdfile_stack_ptr = 0;
|
||||
|
||||
"+vhdl-libdir+" { BEGIN(PLUS_ARGS); return TOK_VHDL_LIBDIR; }
|
||||
|
||||
"+width-cap+" { BEGIN(PLUS_ARGS); return TOK_WIDTH_CAP; }
|
||||
|
||||
/* If it is not any known plus-flag, return the generic form. */
|
||||
"+"[^\n \t\b\f\r+]* {
|
||||
cflval.text = strdup(yytext);
|
||||
@@ -195,7 +197,6 @@ int yywrap()
|
||||
void switch_to_command_file(const char *file)
|
||||
{
|
||||
char path[4096];
|
||||
char *cp;
|
||||
|
||||
if (cmdfile_stack_ptr >= MAX_CMDFILE_DEPTH) {
|
||||
fprintf(stderr, "Error: command files nested too deeply (%d) "
|
||||
@@ -213,6 +214,7 @@ void switch_to_command_file(const char *file)
|
||||
* file name.
|
||||
*/
|
||||
if (file[0] != '/') {
|
||||
char *cp;
|
||||
strcpy(path, current_file);
|
||||
cp = strrchr(path, '/');
|
||||
if (cp == 0) strcpy(path, file); /* A base file. */
|
||||
@@ -245,7 +247,7 @@ void cfreset(FILE*fd, const char*path)
|
||||
/*
|
||||
* Modern version of flex (>=2.5.9) can clean up the scanner data.
|
||||
*/
|
||||
void destroy_lexor()
|
||||
void destroy_lexor(void)
|
||||
{
|
||||
# ifdef FLEX_SCANNER
|
||||
# if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5
|
||||
|
||||
+12
-3
@@ -1,6 +1,6 @@
|
||||
%{
|
||||
/*
|
||||
* Copyright (c) 2001-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "globals.h"
|
||||
@@ -61,6 +61,7 @@ static void translate_file_name(char*text)
|
||||
%token TOK_Da TOK_Dc TOK_Dv TOK_Dy
|
||||
%token TOK_DEFINE TOK_INCDIR TOK_INTEGER_WIDTH TOK_LIBDIR TOK_LIBDIR_NOCASE
|
||||
%token TOK_LIBEXT TOK_PARAMETER TOK_TIMESCALE TOK_VHDL_WORK TOK_VHDL_LIBDIR
|
||||
%token TOK_WIDTH_CAP
|
||||
%token <text> TOK_PLUSARG TOK_PLUSWORD TOK_STRING
|
||||
|
||||
%%
|
||||
@@ -191,6 +192,13 @@ item
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
| TOK_WIDTH_CAP TOK_PLUSARG
|
||||
{ char*tmp = substitutions($2);
|
||||
free($2);
|
||||
width_cap = strtoul(tmp,0,10);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
/* The +<word> tokens that are not otherwise matched, are
|
||||
ignored. The skip_args rule arranges for all the argument words
|
||||
to be consumed. */
|
||||
@@ -213,7 +221,7 @@ item
|
||||
}
|
||||
|
||||
| error
|
||||
{ fprintf(stderr, "Error: unable to parse line %d in "
|
||||
{ fprintf(stderr, "Error: unable to parse line %u in "
|
||||
"%s.\n", cflloc.first_line, current_file);
|
||||
return 1;
|
||||
}
|
||||
@@ -262,5 +270,6 @@ skip_arg : TOK_PLUSARG
|
||||
|
||||
int yyerror(const char*msg)
|
||||
{
|
||||
(void)msg; /* Parameter is not used. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __cfparse_misc_H
|
||||
#define __cfparse_misc_H
|
||||
#ifndef IVL_cfparse_misc_H
|
||||
#define IVL_cfparse_misc_H
|
||||
/*
|
||||
* Copyright (c) 2001-2009 Picture Elements, Inc.
|
||||
* Copyright (c) 2001-2014 Picture Elements, Inc.
|
||||
* Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -38,7 +38,7 @@ int cflex(void);
|
||||
int cferror(const char *);
|
||||
int cfparse(void);
|
||||
void switch_to_command_file(const char *);
|
||||
void destroy_lexor();
|
||||
void destroy_lexor(void);
|
||||
char *current_file;
|
||||
|
||||
#endif
|
||||
#endif /* IVL_cfparse_misc_H */
|
||||
|
||||
+8
-5
@@ -1,7 +1,7 @@
|
||||
#ifndef __globals_H
|
||||
#define __globals_H
|
||||
#ifndef IVL_globals_H
|
||||
#define IVL_globals_H
|
||||
/*
|
||||
* Copyright (c) 2000-2009 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2000-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <stddef.h>
|
||||
@@ -24,6 +24,9 @@
|
||||
/* This is the integer-width argument that will be passed to ivl. */
|
||||
extern unsigned integer_width;
|
||||
|
||||
/* This is the width-cap argument that will be passed to ivl. */
|
||||
extern unsigned width_cap;
|
||||
|
||||
extern const char*vhdlpp_work;
|
||||
extern const char**vhdlpp_libdir;
|
||||
extern unsigned vhdlpp_libdir_cnt;
|
||||
@@ -51,4 +54,4 @@ extern void process_parameter(const char*name);
|
||||
/* Set the default timescale for the simulator. */
|
||||
extern void process_timescale(const char*ts_string);
|
||||
|
||||
#endif
|
||||
#endif /* IVL_globals_H */
|
||||
|
||||
+15
-6
@@ -1,4 +1,4 @@
|
||||
.TH iverilog 1 "February 27th, 2011" "" "Version %M.%m.%n %E"
|
||||
.TH iverilog 1 "February 26th, 2014" "" "Version %M.%m.%n %E"
|
||||
.SH NAME
|
||||
iverilog - Icarus Verilog compiler
|
||||
|
||||
@@ -6,7 +6,7 @@ iverilog - Icarus Verilog compiler
|
||||
.B iverilog
|
||||
[\-ESVv] [\-Bpath] [\-ccmdfile|\-fcmdfile] [\-Dmacro[=defn]]
|
||||
[\-Pparameter=value] [\-pflag=value]
|
||||
[\-dname] [\-g1995|\-g2001|\-g2005|\-g2005-sv|\-g2009|\-g<feature>]
|
||||
[\-dname] [\-g1995|\-g2001|\-g2005|\-g2005-sv|\-g2009|\-g2012|\-g<feature>]
|
||||
[\-Iincludedir] [\-mmodule] [\-M[mode=]file] [\-Nfile] [\-ooutputfilename]
|
||||
[\-stopmodule] [\-ttype] [\-Tmin/typ/max] [\-Wclass] [\-ypath] sourcefile
|
||||
|
||||
@@ -61,10 +61,11 @@ is the Verilog input, but with file inclusions and macro references
|
||||
expanded and removed. This is useful, for example, to preprocess
|
||||
Verilog source for use by other compilers.
|
||||
.TP 8
|
||||
.B -g1995\fI|\fP-g2001\fI|\fP-g2001-noconfig\fI|\fP-g2005\fI|\fP-g2005-sv\fI|\fP-g2009
|
||||
.B -g1995\fI|\fP-g2001\fI|\fP-g2001-noconfig\fI|\fP-g2005\fI|\fP-g2005-sv\fI|\fP-g2009\fI|\fP-g2012
|
||||
Select the Verilog language \fIgeneration\fP to support in the compiler.
|
||||
This selects between \fIIEEE1364\-1995\fP, \fIIEEE1364\-2001\fP,
|
||||
\fIIEEE1364\-2005\fP, \fIIEEE1800\-2005\fP, or \fIIEEE1800\-2009\fP.
|
||||
\fIIEEE1364\-2005\fP, \fIIEEE1800\-2005\fP, \fIIEEE1800\-2009\fP, or
|
||||
\fIIEEE1800\-2012\fP.
|
||||
Icarus Verilog currently defaults to the \fIIEEE1364\-2005\fP generation
|
||||
of the language. This flag is used to restrict the language to a set of
|
||||
keywords/features, this allows simulation of older Verilog code that may
|
||||
@@ -128,7 +129,9 @@ standard compliant behavior (with some loss in performance).
|
||||
.B -gstrict-expr-width\fI|\fP-gno-strict-expr-width
|
||||
Enable or disable (default) strict compliance with the standard rules
|
||||
for determining expression bit lengths. When disabled, the RHS of a
|
||||
parameter assignment is evaluated as a lossless expression.
|
||||
parameter assignment is evaluated as a lossless expression, as is any
|
||||
expression containing an unsized constant number, and unsized constant
|
||||
numbers are not truncated to integer width.
|
||||
.TP 8
|
||||
.B -I\fIincludedir\fP
|
||||
Append directory \fIincludedir\fP to list of directories searched
|
||||
@@ -459,6 +462,12 @@ This allows the programmer to select the width for integer variables
|
||||
in the Verilog source. The default is 32, the value can be any desired
|
||||
integer value.
|
||||
|
||||
.TP 8
|
||||
.B +width-cap+\fIvalue\fP
|
||||
This allows the programmer to select the width cap for unsized expressions.
|
||||
If the calculated width for an unsized expression exceeds this value, the
|
||||
compiler will issue a warning and limit the expression width to this value.
|
||||
|
||||
.SH "VARIABLES IN COMMAND FILES"
|
||||
|
||||
In certain cases, iverilog supports variables in command files. These
|
||||
@@ -512,7 +521,7 @@ Tips on using, debugging, and developing the compiler can be found at
|
||||
|
||||
.SH COPYRIGHT
|
||||
.nf
|
||||
Copyright \(co 2002\-2011 Stephen Williams
|
||||
Copyright \(co 2002\-2014 Stephen Williams
|
||||
|
||||
This document can be freely redistributed according to the terms of the
|
||||
GNU General Public License version 2.0
|
||||
|
||||
+46
-18
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2011 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2000-2014 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -39,7 +39,7 @@ const char NOTICE[] =
|
||||
|
||||
const char HELP[] =
|
||||
"Usage: iverilog [-ESvV] [-B base] [-c cmdfile|-f cmdfile]\n"
|
||||
" [-g1995|-g2001|-g2005|-g2005-sv|-g2009] [-g<feature>]\n"
|
||||
" [-g1995|-g2001|-g2005|-g2005-sv|-g2009|-g2012] [-g<feature>]\n"
|
||||
" [-D macro[=defn]] [-I includedir]\n"
|
||||
" [-M [mode=]depfile] [-m module]\n"
|
||||
" [-N file] [-o filename] [-p flag=value]\n"
|
||||
@@ -71,7 +71,7 @@ const char HELP[] =
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
#if HAVE_GETOPT_H
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
@@ -122,6 +122,7 @@ char depmode = 'a';
|
||||
|
||||
const char*generation = "2005";
|
||||
const char*gen_specify = "no-specify";
|
||||
const char*gen_assertions = "assertions";
|
||||
const char*gen_xtypes = "xtypes";
|
||||
const char*gen_icarus = "icarus-misc";
|
||||
const char*gen_io_range_error = "io-range-error";
|
||||
@@ -136,10 +137,12 @@ int gen_std_include = 1;
|
||||
of the include list. */
|
||||
int gen_relative_include = 0;
|
||||
|
||||
char warning_flags[16] = "";
|
||||
char warning_flags[16] = "n";
|
||||
|
||||
unsigned integer_width = 32;
|
||||
|
||||
unsigned width_cap = 65536;
|
||||
|
||||
char*mod_list = 0;
|
||||
char*command_filename = 0;
|
||||
|
||||
@@ -185,7 +188,7 @@ static const char** defparm_base = 0;
|
||||
static int defparm_size = 0;
|
||||
|
||||
/* Function to add a command file name to the FIFO. */
|
||||
void add_cmd_file(const char* filename)
|
||||
static void add_cmd_file(const char* filename)
|
||||
{
|
||||
p_command_file new;
|
||||
|
||||
@@ -202,7 +205,7 @@ void add_cmd_file(const char* filename)
|
||||
}
|
||||
|
||||
/* Function to return the top command file name from the FIFO. */
|
||||
char *get_cmd_file()
|
||||
static char *get_cmd_file(void)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
@@ -399,7 +402,7 @@ static int t_preprocess_only(void)
|
||||
* needed to run the command from the configuration file (which is
|
||||
* already parsed for us) so we can handle must of the generic cases.
|
||||
*/
|
||||
static int t_compile()
|
||||
static int t_compile(void)
|
||||
{
|
||||
unsigned rc;
|
||||
|
||||
@@ -491,11 +494,15 @@ static int t_compile()
|
||||
static void process_warning_switch(const char*name)
|
||||
{
|
||||
if (strcmp(name,"all") == 0) {
|
||||
process_warning_switch("anachronisms");
|
||||
process_warning_switch("implicit");
|
||||
process_warning_switch("portbind");
|
||||
process_warning_switch("select-range");
|
||||
process_warning_switch("timescale");
|
||||
process_warning_switch("sensitivity-entire-array");
|
||||
} else if (strcmp(name,"anachronisms") == 0) {
|
||||
if (! strchr(warning_flags, 'n'))
|
||||
strcat(warning_flags, "n");
|
||||
} else if (strcmp(name,"implicit") == 0) {
|
||||
if (! strchr(warning_flags, 'i'))
|
||||
strcat(warning_flags, "i");
|
||||
@@ -519,6 +526,12 @@ static void process_warning_switch(const char*name)
|
||||
} else if (strcmp(name,"sensitivity-entire-array") == 0) {
|
||||
if (! strchr(warning_flags, 'a'))
|
||||
strcat(warning_flags, "a");
|
||||
} else if (strcmp(name,"no-anachronisms") == 0) {
|
||||
char*cp = strchr(warning_flags, 'n');
|
||||
if (cp) while (*cp) {
|
||||
cp[0] = cp[1];
|
||||
cp += 1;
|
||||
}
|
||||
} else if (strcmp(name,"no-implicit") == 0) {
|
||||
char*cp = strchr(warning_flags, 'i');
|
||||
if (cp) while (*cp) {
|
||||
@@ -612,7 +625,7 @@ void process_file_name(const char*name, int lib_flag)
|
||||
}
|
||||
}
|
||||
|
||||
int process_generation(const char*name)
|
||||
static int process_generation(const char*name)
|
||||
{
|
||||
if (strcmp(name,"1995") == 0)
|
||||
generation = "1995";
|
||||
@@ -632,6 +645,9 @@ int process_generation(const char*name)
|
||||
else if (strcmp(name,"2009") == 0)
|
||||
generation = "2009";
|
||||
|
||||
else if (strcmp(name,"2012") == 0)
|
||||
generation = "2012";
|
||||
|
||||
else if (strcmp(name,"1") == 0) { /* Deprecated: use 1995 */
|
||||
generation = "1995";
|
||||
gen_xtypes = "no-xtypes";
|
||||
@@ -665,6 +681,12 @@ int process_generation(const char*name)
|
||||
else if (strcmp(name,"no-specify") == 0)
|
||||
gen_specify = "no-specify";
|
||||
|
||||
else if (strcmp(name,"assertions") == 0)
|
||||
gen_assertions = "assertions";
|
||||
|
||||
else if (strcmp(name,"no-assertions") == 0)
|
||||
gen_assertions = "no-assertions";
|
||||
|
||||
else if (strcmp(name,"std-include") == 0)
|
||||
gen_std_include = 1;
|
||||
|
||||
@@ -710,6 +732,7 @@ int process_generation(const char*name)
|
||||
" 2005 -- IEEE1364-2005\n"
|
||||
" 2005-sv -- IEEE1800-2005\n"
|
||||
" 2009 -- IEEE1800-2009\n"
|
||||
" 2012 -- IEEE1800-2012\n"
|
||||
"Other generation flags:\n"
|
||||
" specify | no-specify\n"
|
||||
" verilog-ams | no-verilog-ams\n"
|
||||
@@ -727,7 +750,7 @@ int process_generation(const char*name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int process_depfile(const char*name)
|
||||
static int process_depfile(const char*name)
|
||||
{
|
||||
const char*cp = strchr(name, '=');
|
||||
if (cp) {
|
||||
@@ -761,7 +784,7 @@ int process_depfile(const char*name)
|
||||
/*
|
||||
* If it exists add the SFT file for the given module.
|
||||
*/
|
||||
void add_sft_file(const char *module)
|
||||
static void add_sft_file(const char *module)
|
||||
{
|
||||
char *file;
|
||||
|
||||
@@ -776,7 +799,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int e_flag = 0;
|
||||
int version_flag = 0;
|
||||
int opt, idx;
|
||||
int opt;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/* Calculate the ivl_root from the path to the command. This
|
||||
@@ -884,7 +907,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
while ((opt = getopt(argc, argv, "B:c:D:d:Ef:g:hI:M:m:N::o:P:p:Ss:T:t:vVW:y:Y:")) != EOF) {
|
||||
while ((opt = getopt(argc, argv, "B:c:D:d:Ef:g:hI:M:m:N:o:P:p:Ss:T:t:vVW:y:Y:")) != EOF) {
|
||||
|
||||
switch (opt) {
|
||||
case 'B':
|
||||
@@ -1021,7 +1044,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (version_flag || verbose_flag) {
|
||||
printf("Icarus Verilog version " VERSION " (" VERSION_TAG ")\n\n");
|
||||
printf("Copyright 1998-2011 Stephen Williams\n\n");
|
||||
printf("Copyright 1998-2013 Stephen Williams\n\n");
|
||||
puts(NOTICE);
|
||||
}
|
||||
|
||||
@@ -1047,10 +1070,11 @@ int main(int argc, char **argv)
|
||||
fprintf(iconfig_file, "sys_func:%s%csystem.sft\n", base, sep);
|
||||
fprintf(iconfig_file, "sys_func:%s%cvhdl_sys.sft\n", base, sep);
|
||||
|
||||
/* If verilog-2005/9 is enabled or icarus-misc or verilog-ams,
|
||||
/* If verilog-2005/09/12 is enabled or icarus-misc or verilog-ams,
|
||||
* then include the v2005_math library. */
|
||||
if (strcmp(generation, "2005") == 0 ||
|
||||
strcmp(generation, "2009") == 0 ||
|
||||
strcmp(generation, "2012") == 0 ||
|
||||
strcmp(gen_icarus, "icarus-misc") == 0 ||
|
||||
strcmp(gen_verilog_ams, "verilog-ams") == 0) {
|
||||
fprintf(iconfig_file, "sys_func:%s%cv2005_math.sft\n", base, sep);
|
||||
@@ -1066,7 +1090,8 @@ int main(int argc, char **argv)
|
||||
/* If verilog-2009 (SystemVerilog) is enabled, then include the
|
||||
v2009 module. */
|
||||
if (strcmp(generation, "2005-sv") == 0 ||
|
||||
strcmp(generation, "2009") == 0) {
|
||||
strcmp(generation, "2009") == 0 ||
|
||||
strcmp(generation, "2012") == 0) {
|
||||
fprintf(iconfig_file, "sys_func:%s%cv2009.sft\n", base, sep);
|
||||
fprintf(iconfig_file, "module:v2009\n");
|
||||
}
|
||||
@@ -1074,6 +1099,7 @@ int main(int argc, char **argv)
|
||||
if (mtm != 0) fprintf(iconfig_file, "-T:%s\n", mtm);
|
||||
fprintf(iconfig_file, "generation:%s\n", generation);
|
||||
fprintf(iconfig_file, "generation:%s\n", gen_specify);
|
||||
fprintf(iconfig_file, "generation:%s\n", gen_assertions);
|
||||
fprintf(iconfig_file, "generation:%s\n", gen_xtypes);
|
||||
fprintf(iconfig_file, "generation:%s\n", gen_io_range_error);
|
||||
fprintf(iconfig_file, "generation:%s\n", gen_strict_ca_eval);
|
||||
@@ -1116,7 +1142,7 @@ int main(int argc, char **argv)
|
||||
vhdlpp_work = "ivl_vhdl_work";
|
||||
fprintf(defines_file, "vhdlpp:%s%cvhdlpp\n", vhdlpp_dir, sep);
|
||||
fprintf(defines_file, "vhdlpp-work:%s\n", vhdlpp_work);
|
||||
for (idx = 0 ; idx < vhdlpp_libdir_cnt ; idx += 1)
|
||||
for (unsigned idx = 0 ; idx < vhdlpp_libdir_cnt ; idx += 1)
|
||||
fprintf(defines_file, "vhdlpp-libdir:%s\n", vhdlpp_libdir[idx]);
|
||||
|
||||
/* Process parameter definition from command line. The last
|
||||
@@ -1130,7 +1156,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Finally, process all the remaining words on the command
|
||||
line as file names. */
|
||||
for (idx = optind ; idx < argc ; idx += 1)
|
||||
for (int idx = optind ; idx < argc ; idx += 1)
|
||||
process_file_name(argv[idx], 0);
|
||||
|
||||
/* If the use of a default include directory is not
|
||||
@@ -1168,6 +1194,8 @@ int main(int argc, char **argv)
|
||||
|
||||
fprintf(iconfig_file, "iwidth:%u\n", integer_width);
|
||||
|
||||
fprintf(iconfig_file, "widthcap:%u\n", width_cap);
|
||||
|
||||
/* Write the preprocessor command needed to preprocess a
|
||||
single file. This may be used to preprocess library
|
||||
files. */
|
||||
|
||||
+2
-1
@@ -14,13 +14,14 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
# include "ivl_alloc.h"
|
||||
# include "globals.h"
|
||||
|
||||
|
||||
char* substitutions(const char*str)
|
||||
|
||||
+51
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2013 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -32,6 +32,17 @@ NetEAccess* NetEAccess::dup_expr() const
|
||||
return tmp;
|
||||
}
|
||||
|
||||
NetEArrayPattern*NetEArrayPattern::dup_expr() const
|
||||
{
|
||||
vector<NetExpr*>tmp (items_.size());
|
||||
for (size_t idx = 0 ; idx < tmp.size() ; idx += 1)
|
||||
tmp[idx] = items_[idx]->dup_expr();
|
||||
|
||||
NetEArrayPattern*res = new NetEArrayPattern(net_type(), tmp);
|
||||
res->set_line(*this);
|
||||
return res;
|
||||
}
|
||||
|
||||
NetEBinary* NetEBinary::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
@@ -110,10 +121,10 @@ NetEBShift* NetEBShift::dup_expr() const
|
||||
|
||||
NetEConcat* NetEConcat::dup_expr() const
|
||||
{
|
||||
NetEConcat*dup = new NetEConcat(parms_.count(), repeat_);
|
||||
NetEConcat*dup = new NetEConcat(parms_.size(), repeat_, expr_type_);
|
||||
ivl_assert(*this, dup);
|
||||
dup->set_line(*this);
|
||||
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1)
|
||||
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1)
|
||||
if (parms_[idx]) {
|
||||
NetExpr*tmp = parms_[idx]->dup_expr();
|
||||
ivl_assert(*this, tmp);
|
||||
@@ -171,12 +182,38 @@ NetEEvent* NetEEvent::dup_expr() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetELast* NetELast::dup_expr() const
|
||||
{
|
||||
NetELast*tmp = new NetELast(sig_);
|
||||
ivl_assert(*this, tmp);
|
||||
tmp->set_line(*this);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
NetENetenum* NetENetenum::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetENew* NetENew::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetENull* NetENull::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetEProperty* NetEProperty::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetEScope* NetEScope::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
@@ -189,6 +226,7 @@ NetESelect* NetESelect::dup_expr() const
|
||||
base_? base_->dup_expr() : 0,
|
||||
expr_width(), sel_type_);
|
||||
ivl_assert(*this, tmp);
|
||||
tmp->cast_signed(has_sign());
|
||||
tmp->set_line(*this);
|
||||
return tmp;
|
||||
}
|
||||
@@ -208,11 +246,18 @@ NetESFunc* NetESFunc::dup_expr() const
|
||||
return tmp;
|
||||
}
|
||||
|
||||
NetEShallowCopy* NetEShallowCopy::dup_expr() const
|
||||
{
|
||||
ivl_assert(*this, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetESignal* NetESignal::dup_expr() const
|
||||
{
|
||||
NetESignal*tmp = new NetESignal(net_, word_);
|
||||
ivl_assert(*this, tmp);
|
||||
tmp->expr_width(expr_width());
|
||||
tmp->cast_signed(has_sign());
|
||||
tmp->set_line(*this);
|
||||
return tmp;
|
||||
}
|
||||
@@ -232,9 +277,9 @@ NetETernary* NetETernary::dup_expr() const
|
||||
NetEUFunc* NetEUFunc::dup_expr() const
|
||||
{
|
||||
NetEUFunc*tmp;
|
||||
svector<NetExpr*> tmp_parms (parms_.count());
|
||||
vector<NetExpr*> tmp_parms (parms_.size());
|
||||
|
||||
for (unsigned idx = 0 ; idx < tmp_parms.count() ; idx += 1) {
|
||||
for (unsigned idx = 0 ; idx < tmp_parms.size() ; idx += 1) {
|
||||
ivl_assert(*this, parms_[idx]);
|
||||
tmp_parms[idx] = parms_[idx]->dup_expr();
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
+2559
-495
File diff suppressed because it is too large
Load Diff
+863
-119
File diff suppressed because it is too large
Load Diff
+355
-98
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com)
|
||||
* Copyright CERN 2012 / Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -22,6 +23,8 @@
|
||||
# include "PExpr.h"
|
||||
# include "netlist.h"
|
||||
# include "netmisc.h"
|
||||
# include "netstruct.h"
|
||||
# include "netvector.h"
|
||||
# include "compiler.h"
|
||||
|
||||
# include <cstdlib>
|
||||
@@ -96,12 +99,12 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
concat operator from most significant to least significant,
|
||||
which is the order they are given in the concat list. */
|
||||
|
||||
netvector_t*tmp2_vec = new netvector_t(nets[0]->data_type(),width-1,0);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, width);
|
||||
NetNet::IMPLICIT, tmp2_vec);
|
||||
|
||||
/* Assume that the data types of the nets are all the same, so
|
||||
we can take the data type of any, the first will do. */
|
||||
osig->data_type(nets[0]->data_type());
|
||||
osig->local_flag(true);
|
||||
osig->set_line(*this);
|
||||
|
||||
@@ -152,8 +155,6 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
assert(width == 0);
|
||||
}
|
||||
|
||||
osig->data_type(nets[0]->data_type());
|
||||
osig->local_flag(true);
|
||||
return osig;
|
||||
}
|
||||
|
||||
@@ -199,11 +200,15 @@ bool PEConcat::is_collapsible_net(Design*des, NetScope*scope) const
|
||||
bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
long&midx, long&lidx) const
|
||||
{
|
||||
list<long> prefix_indices;
|
||||
bool rc = calculate_packed_indices_(des, scope, sig, prefix_indices);
|
||||
ivl_assert(*this, rc);
|
||||
|
||||
const name_component_t&name_tail = path_.back();
|
||||
// Only treat as part/bit selects any index that is beyond the
|
||||
// word selects for an array. This is not an array, then
|
||||
// dimensions==0 and any index is treated as a select.
|
||||
if (name_tail.index.size() <= sig->array_dimensions()) {
|
||||
if (name_tail.index.size() <= sig->unpacked_dimensions()) {
|
||||
midx = sig->vector_width()-1;
|
||||
lidx = 0;
|
||||
return true;
|
||||
@@ -242,7 +247,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
if (warn_ob_select) {
|
||||
cerr << get_fileline() << ": warning: "
|
||||
<< sig->name();
|
||||
if (sig->array_dimensions() > 0) cerr << "[]";
|
||||
if (sig->unpacked_dimensions() > 0) cerr << "[]";
|
||||
cerr << "['bx";
|
||||
if (index_tail.sel ==
|
||||
index_component_t::SEL_IDX_UP) {
|
||||
@@ -250,20 +255,20 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
} else {
|
||||
cerr << "-:";
|
||||
}
|
||||
cerr << wid << "] is always outside vector."
|
||||
cerr << wid << "] is always outside the vector."
|
||||
<< endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
long midx_val = tmp->value().as_long();
|
||||
midx = sig->sb_to_idx(midx_val);
|
||||
midx = sig->sb_to_idx(prefix_indices, midx_val);
|
||||
delete tmp_ex;
|
||||
|
||||
if (index_tail.sel == index_component_t::SEL_IDX_UP)
|
||||
lidx = sig->sb_to_idx(midx_val+wid-1);
|
||||
lidx = sig->sb_to_idx(prefix_indices, midx_val+wid-1);
|
||||
else
|
||||
lidx = sig->sb_to_idx(midx_val-wid+1);
|
||||
lidx = sig->sb_to_idx(prefix_indices, midx_val-wid+1);
|
||||
|
||||
if (midx < lidx) {
|
||||
long tmpx = midx;
|
||||
@@ -274,7 +279,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
/* Warn about an indexed part select that is out of range. */
|
||||
if (warn_ob_select && (lidx < 0)) {
|
||||
cerr << get_fileline() << ": warning: " << sig->name();
|
||||
if (sig->array_dimensions() > 0) cerr << "[]";
|
||||
if (sig->unpacked_dimensions() > 0) cerr << "[]";
|
||||
cerr << "[" << midx_val;
|
||||
if (index_tail.sel == index_component_t::SEL_IDX_UP) {
|
||||
cerr << "+:";
|
||||
@@ -285,7 +290,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
}
|
||||
if (warn_ob_select && (midx >= (long)sig->vector_width())) {
|
||||
cerr << get_fileline() << ": warning: " << sig->name();
|
||||
if (sig->array_dimensions() > 0) {
|
||||
if (sig->unpacked_dimensions() > 0) {
|
||||
cerr << "[]";
|
||||
}
|
||||
cerr << "[" << midx_val;
|
||||
@@ -310,10 +315,21 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
long msb, lsb;
|
||||
bool part_defined_flag;
|
||||
/* bool flag = */ calculate_parts_(des, scope, msb, lsb, part_defined_flag);
|
||||
ivl_assert(*this, part_defined_flag);
|
||||
|
||||
long lidx_tmp = sig->sb_to_idx(lsb);
|
||||
long midx_tmp = sig->sb_to_idx(msb);
|
||||
/* We have an undefined index and that is out of range. */
|
||||
if (!part_defined_flag) {
|
||||
if (warn_ob_select) {
|
||||
cerr << get_fileline() << ": warning: "
|
||||
<< sig->name();
|
||||
if (sig->unpacked_dimensions() > 0) cerr << "[]";
|
||||
cerr << "['bx] is always outside the vector."
|
||||
<< endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
long lidx_tmp = sig->sb_to_idx(prefix_indices, lsb);
|
||||
long midx_tmp = sig->sb_to_idx(prefix_indices, msb);
|
||||
/* Detect reversed indices of a part select. */
|
||||
if (lidx_tmp > midx_tmp) {
|
||||
cerr << get_fileline() << ": error: Part select "
|
||||
@@ -332,16 +348,11 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
if (midx_tmp >= (long)sig->vector_width() || lidx_tmp < 0) {
|
||||
cerr << get_fileline() << ": warning: Part select "
|
||||
<< sig->name();
|
||||
if (sig->array_dimensions() > 0) {
|
||||
if (sig->unpacked_dimensions() > 0) {
|
||||
cerr << "[]";
|
||||
}
|
||||
cerr << "[" << msb << ":" << lsb
|
||||
<< "] is out of range." << endl;
|
||||
#if 0
|
||||
midx_tmp = sig->vector_width() - 1;
|
||||
lidx_tmp = 0;
|
||||
des->errors += 1;
|
||||
#endif
|
||||
}
|
||||
/* This is completely out side the signal so just skip it. */
|
||||
if (lidx_tmp >= (long)sig->vector_width() || midx_tmp < 0) {
|
||||
@@ -354,30 +365,43 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
||||
}
|
||||
|
||||
case index_component_t::SEL_BIT:
|
||||
if (name_tail.index.size() > sig->array_dimensions()) {
|
||||
verinum*mval = index_tail.msb->eval_const(des, scope);
|
||||
if (mval == 0) {
|
||||
cerr << get_fileline() << ": error: Index of " << path_ <<
|
||||
" needs to be constant in this context." <<
|
||||
endl;
|
||||
cerr << get_fileline() << ": : Index expression is: "
|
||||
<< *index_tail.msb << endl;
|
||||
cerr << get_fileline() << ": : Context scope is: "
|
||||
<< scope_path(scope) << endl;
|
||||
des->errors += 1;
|
||||
if (name_tail.index.size() > sig->unpacked_dimensions()) {
|
||||
long msb;
|
||||
bool bit_defined_flag;
|
||||
/* bool flag = */ calculate_bits_(des, scope, msb, bit_defined_flag);
|
||||
|
||||
/* We have an undefined index and that is out of range. */
|
||||
if (!bit_defined_flag) {
|
||||
if (warn_ob_select) {
|
||||
cerr << get_fileline() << ": warning: "
|
||||
<< sig->name();
|
||||
if (sig->unpacked_dimensions() > 0) cerr << "[]";
|
||||
cerr << "['bx] is always outside the vector."
|
||||
<< endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
assert(mval);
|
||||
|
||||
midx = sig->sb_to_idx(mval->as_long());
|
||||
if (midx >= (long)sig->vector_width()) {
|
||||
cerr << get_fileline() << ": error: Index " << sig->name()
|
||||
<< "[" << mval->as_long() << "] is out of range."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
midx = 0;
|
||||
|
||||
if (prefix_indices.size()+2 <= sig->packed_dims().size()) {
|
||||
long tmp_loff;
|
||||
unsigned long tmp_lwid;
|
||||
bool rcl = sig->sb_to_slice(prefix_indices, msb,
|
||||
tmp_loff, tmp_lwid);
|
||||
ivl_assert(*this, rcl);
|
||||
midx = tmp_loff + tmp_lwid - 1;
|
||||
lidx = tmp_loff;
|
||||
} else {
|
||||
midx = sig->sb_to_idx(prefix_indices, msb);
|
||||
if (midx >= (long)sig->vector_width()) {
|
||||
cerr << get_fileline() << ": error: Index " << sig->name()
|
||||
<< "[" << msb << "] is out of range."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
midx = 0;
|
||||
}
|
||||
lidx = midx;
|
||||
}
|
||||
lidx = midx;
|
||||
|
||||
} else {
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
@@ -405,6 +429,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
NetNet* sig = 0;
|
||||
const NetExpr*par = 0;
|
||||
NetEvent* eve = 0;
|
||||
perm_string method_name;
|
||||
|
||||
symbol_search(this, des, scope, path_, sig, par, eve);
|
||||
|
||||
@@ -416,6 +441,35 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Break the path_ into the tail name and the prefix. For
|
||||
// example, a name "a.b.c" is broken into name_tail="c" and
|
||||
// path_prefix="a.b".
|
||||
const name_component_t&path_tail = path_.back();
|
||||
pform_name_t path_prefix = path_;
|
||||
path_prefix.pop_back();
|
||||
|
||||
/* If the signal is not found, check to see if this is a
|
||||
member of a struct. Take the name of the form "a.b.member",
|
||||
remove the member and store it into method_name, and retry
|
||||
the search with "a.b". */
|
||||
if (sig == 0 && path_.size() >= 2) {
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
"Symbol not found, try again with path_prefix=" << path_prefix
|
||||
<< " and method_name=" << path_tail.name << endl;
|
||||
}
|
||||
method_name = path_tail.name;
|
||||
symbol_search(this, des, scope, path_prefix, sig, par, eve);
|
||||
|
||||
// Whoops, not a struct signal, so give up on this avenue.
|
||||
if (sig && sig->struct_type() == 0) {
|
||||
cerr << get_fileline() << ": XXXXX: sig=" << sig->name()
|
||||
<< " is found, but not a struct with member " << method_name << endl;
|
||||
method_name = perm_string();
|
||||
sig = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (sig == 0) {
|
||||
cerr << get_fileline() << ": error: Net " << path_
|
||||
<< " is not defined in this context." << endl;
|
||||
@@ -430,17 +484,10 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
wire. */
|
||||
if (gn_var_can_be_uwire()
|
||||
&& (sig->type() == NetNet::REG)
|
||||
&& (sig->peek_eref() == 0) ) {
|
||||
&& (sig->peek_lref() == 0) ) {
|
||||
sig->type(NetNet::UNRESOLVED_WIRE);
|
||||
}
|
||||
|
||||
if (sig->type() == NetNet::UNRESOLVED_WIRE && sig->pin(0).is_linked()) {
|
||||
cerr << get_fileline() << ": error: Unresolved net/uwire "
|
||||
<< sig->name() << " cannot have multiple drivers." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Don't allow registers as assign l-values. */
|
||||
if (sig->type() == NetNet::REG) {
|
||||
cerr << get_fileline() << ": error: reg " << sig->name()
|
||||
@@ -454,59 +501,193 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
unsigned midx = sig->vector_width()-1, lidx = 0;
|
||||
// The default word select is the first.
|
||||
long widx = 0;
|
||||
// The widx_val is the word select as entered in the source
|
||||
// code. It's used for error messages.
|
||||
long widx_val = 0;
|
||||
// Set this to true if we calculate the word index. This is
|
||||
// used to distinguish between unpacked array assignment and
|
||||
// array word assignment.
|
||||
bool widx_flag = false;
|
||||
|
||||
const name_component_t&name_tail = path_.back();
|
||||
list<long> unpacked_indices_const;
|
||||
|
||||
if (sig->array_dimensions() > 0) {
|
||||
const netstruct_t*struct_type = 0;
|
||||
if ((struct_type = sig->struct_type()) && !method_name.nil()) {
|
||||
|
||||
if (name_tail.index.empty()) {
|
||||
cerr << get_fileline() << ": error: array " << sig->name()
|
||||
<< " must be used with an index." << endl;
|
||||
// Detect the variable is a structure and there was a
|
||||
// method name detected. We've already found that
|
||||
// the path_ is <>.sig.method_name and signal
|
||||
// (NetNet). We also know that sig is struct_type(), so
|
||||
// look for a method named method_name.
|
||||
if (debug_elaborate)
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
<< "Signal " << sig->name() << " is a structure, "
|
||||
<< "try to match member " << method_name << endl;
|
||||
|
||||
unsigned long member_off = 0;
|
||||
const struct netstruct_t::member_t*member = struct_type->packed_member(method_name, member_off);
|
||||
ivl_assert(*this, member);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
<< "Member " << method_name
|
||||
<< " has type " << *member->net_type << "." << endl;
|
||||
cerr << get_fileline() << ": : "
|
||||
<< "Tail name has " << path_tail.index.size() << " indices." << endl;
|
||||
}
|
||||
|
||||
// Rewrite a member select of a packed structure as a
|
||||
// part select of the base variable.
|
||||
lidx = member_off;
|
||||
midx = lidx + member->net_type->packed_width() - 1;
|
||||
|
||||
// The dimensions of the tail of the prefix must match
|
||||
// the dimensions of the signal at this point. (The sig
|
||||
// has a packed dimension for the packed struct size.)
|
||||
// For example, if the path_=a[<m>][<n>].member, then
|
||||
// sig must have 3 packed dimensions: one for the struct
|
||||
// members and two actual packed dimensions.
|
||||
ivl_assert(*this, path_prefix.back().index.size()+1 == sig->packed_dimensions());
|
||||
|
||||
// Elaborate an expression from the packed indices and
|
||||
// the member offset (into the structure) to get a
|
||||
// canonical expression into the packed signal vector.
|
||||
NetExpr*packed_base = 0;
|
||||
if (sig->packed_dimensions() > 1) {
|
||||
list<index_component_t>tmp_index = path_prefix.back().index;
|
||||
index_component_t member_select;
|
||||
member_select.sel = index_component_t::SEL_BIT;
|
||||
member_select.msb = new PENumber(new verinum(member_off));
|
||||
tmp_index.push_back(member_select);
|
||||
packed_base = collapse_array_indices(des, scope, sig, tmp_index);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
<< "packed_base=" << *packed_base
|
||||
<< ", member_off=" << member_off << endl;
|
||||
}
|
||||
}
|
||||
|
||||
long tmp;
|
||||
if (packed_base && eval_as_long(tmp, packed_base)) {
|
||||
lidx = tmp;
|
||||
midx = lidx + member->net_type->packed_width() - 1;
|
||||
delete packed_base;
|
||||
packed_base = 0;
|
||||
}
|
||||
|
||||
// Currently, only support const dimensions here.
|
||||
ivl_assert(*this, packed_base == 0);
|
||||
|
||||
// Now the lidx/midx values get us to the member. Next
|
||||
// up, deal with bit/part selects from the member
|
||||
// itself.
|
||||
//XXXXivl_assert(*this, member->packed_dims.size() <= 1);
|
||||
ivl_assert(*this, path_tail.index.size() <= 1);
|
||||
if (! path_tail.index.empty()) {
|
||||
long tmp_off;
|
||||
unsigned long tmp_wid;
|
||||
const index_component_t&tail_sel = path_tail.index.back();
|
||||
ivl_assert(*this, tail_sel.sel == index_component_t::SEL_PART || tail_sel.sel == index_component_t::SEL_BIT);
|
||||
bool rc = calculate_part(this, des, scope, tail_sel, tmp_off, tmp_wid);
|
||||
ivl_assert(*this, rc);
|
||||
if (debug_elaborate)
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
<< "tmp_off=" << tmp_off << ", tmp_wid=" << tmp_wid << endl;
|
||||
lidx += tmp_off;
|
||||
midx = lidx + tmp_wid - 1;
|
||||
}
|
||||
|
||||
} else if (gn_system_verilog() && sig->unpacked_dimensions() > 0 && path_tail.index.empty()) {
|
||||
|
||||
// In this case, we are doing a continuous assignment to
|
||||
// an unpacked array. The NetNet representation is a
|
||||
// NetNet with a pin for each array element, so there is
|
||||
// nothing more needed here.
|
||||
//
|
||||
// This can come up from code like this:
|
||||
// logic [...] data [0:3];
|
||||
// assign data = ...;
|
||||
// In this case, "sig" is "data", and sig->pin_count()
|
||||
// is 4 to account for the unpacked size.
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
<< "Net assign to unpacked array \"" << sig->name()
|
||||
<< "\" with " << sig->pin_count() << " elements." << endl;
|
||||
}
|
||||
|
||||
} else if (sig->unpacked_dimensions() > 0) {
|
||||
|
||||
// Make sure there are enough indices to address an array element.
|
||||
if (path_tail.index.size() < sig->unpacked_dimensions()) {
|
||||
cerr << get_fileline() << ": error: Array " << path()
|
||||
<< " needs " << sig->unpacked_dimensions() << " indices,"
|
||||
<< " but got only " << path_tail.index.size() << ". (net)" << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const index_component_t&index_head = name_tail.index.front();
|
||||
if (index_head.sel == index_component_t::SEL_PART) {
|
||||
cerr << get_fileline() << ": error: cannot perform a part "
|
||||
<< "select on array " << sig->name() << "." << endl;
|
||||
// Evaluate all the index expressions into an
|
||||
// "unpacked_indices" array.
|
||||
list<NetExpr*>unpacked_indices;
|
||||
indices_flags flags;
|
||||
indices_to_expressions(des, scope, this,
|
||||
path_tail.index, sig->unpacked_dimensions(),
|
||||
true, sig->unpacked_count(),
|
||||
flags,
|
||||
unpacked_indices,
|
||||
unpacked_indices_const);
|
||||
|
||||
if (flags.invalid) {
|
||||
return 0;
|
||||
|
||||
} else if (flags.variable) {
|
||||
cerr << get_fileline() << ": error: array '" << sig->name()
|
||||
<< "' index must be a constant in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
ivl_assert(*this, index_head.sel == index_component_t::SEL_BIT);
|
||||
|
||||
NetExpr*tmp_ex = elab_and_eval(des, scope, index_head.msb, -1, true);
|
||||
NetEConst*tmp = dynamic_cast<NetEConst*>(tmp_ex);
|
||||
if (!tmp) {
|
||||
cerr << get_fileline() << ": error: array " << sig->name()
|
||||
<< " index must be a constant in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
widx_val = tmp->value().as_long();
|
||||
if (sig->array_index_is_valid(widx_val))
|
||||
widx = sig->array_index_to_address(widx_val);
|
||||
else
|
||||
} else if (flags.undefined) {
|
||||
cerr << get_fileline() << ": warning: "
|
||||
<< "ignoring undefined l-value array access "
|
||||
<< sig->name() << as_indices(unpacked_indices)
|
||||
<< "." << endl;
|
||||
widx = -1;
|
||||
delete tmp_ex;
|
||||
widx_flag = true;
|
||||
|
||||
} else {
|
||||
NetExpr*canon_index = 0;
|
||||
ivl_assert(*this, unpacked_indices_const.size() == sig->unpacked_dimensions());
|
||||
canon_index = normalize_variable_unpacked(sig, unpacked_indices_const);
|
||||
|
||||
if (canon_index == 0) {
|
||||
cerr << get_fileline() << ": warning: "
|
||||
<< "ignoring out of bounds l-value array access "
|
||||
<< sig->name() << as_indices(unpacked_indices_const)
|
||||
<< "." << endl;
|
||||
widx = -1;
|
||||
widx_flag = true;
|
||||
|
||||
} else {
|
||||
NetEConst*canon_const = dynamic_cast<NetEConst*>(canon_index);
|
||||
ivl_assert(*this, canon_const);
|
||||
|
||||
widx = canon_const->value().as_long();
|
||||
widx_flag = true;
|
||||
delete canon_index;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_fileline() << ": debug: Use [" << widx << "]"
|
||||
<< " to index l-value array." << endl;
|
||||
|
||||
/* The array has a part/bit select at the end. */
|
||||
if (name_tail.index.size() > sig->array_dimensions()) {
|
||||
if (path_tail.index.size() > sig->unpacked_dimensions()) {
|
||||
if (sig->get_scalar()) {
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "can not select part of ";
|
||||
if (sig->data_type() == IVL_VT_REAL) cerr << "real";
|
||||
else cerr << "scalar";
|
||||
cerr << " array word: " << sig->name()
|
||||
<< "[" << widx_val << "]" << endl;
|
||||
<< as_indices(unpacked_indices_const) << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -525,7 +706,18 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
midx = midx_tmp;
|
||||
lidx = lidx_tmp;
|
||||
}
|
||||
} else if (!name_tail.index.empty()) {
|
||||
|
||||
} else if (!path_tail.index.empty()) {
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "
|
||||
<< "path_tail.index.size()=" << path_tail.index.size()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// There are index expressions on the name, so this is a
|
||||
// bit/slice select of the name. Calculate a canonical
|
||||
// part select.
|
||||
|
||||
if (sig->get_scalar()) {
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "can not select part of ";
|
||||
@@ -553,21 +745,40 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
|
||||
unsigned subnet_wid = midx-lidx+1;
|
||||
|
||||
if (sig->pin_count() > 1) {
|
||||
if (widx < 0 || widx >= (long) sig->pin_count()) {
|
||||
cerr << get_fileline() << ": warning: ignoring out of "
|
||||
"bounds l-value array access "
|
||||
<< sig->name() << "[" << widx_val << "]." << endl;
|
||||
return 0;
|
||||
/* Check if the l-value bits are double-driven. */
|
||||
if (sig->type() == NetNet::UNRESOLVED_WIRE && sig->test_and_set_part_driver(midx,lidx, widx_flag? widx : 0)) {
|
||||
cerr << get_fileline() << ": error: Unresolved net/uwire "
|
||||
<< sig->name() << " cannot have multiple drivers." << endl;
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": : Overlap in "
|
||||
<< "[" << midx << ":" << lidx << "] (canonical)"
|
||||
<< ", widx=" << (widx_flag? widx : 0)
|
||||
<< ", vector width=" << sig->vector_width()
|
||||
<< endl;
|
||||
}
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sig->pin_count() > 1 && widx_flag) {
|
||||
if (widx < 0 || widx >= (long) sig->pin_count())
|
||||
return 0;
|
||||
|
||||
netvector_t*tmp2_vec = new netvector_t(sig->data_type(),
|
||||
sig->vector_width()-1,0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
sig->type(), sig->vector_width());
|
||||
sig->type(), tmp2_vec);
|
||||
tmp->set_line(*this);
|
||||
tmp->local_flag(true);
|
||||
tmp->data_type( sig->data_type() );
|
||||
connect(sig->pin(widx), tmp->pin(0));
|
||||
sig = tmp;
|
||||
|
||||
} else if (sig->pin_count() > 1) {
|
||||
|
||||
// If this turns out to be an l-value unpacked array,
|
||||
// then let the caller handle it. It will probably be
|
||||
// converted into an array of assignments.
|
||||
return sig;
|
||||
}
|
||||
|
||||
/* If the desired l-value vector is narrower than the
|
||||
@@ -589,10 +800,11 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
||||
<< " wid=" << subnet_wid <<"]"
|
||||
<< endl;
|
||||
|
||||
netvector_t*tmp2_vec = new netvector_t(sig->data_type(),
|
||||
subnet_wid-1,0);
|
||||
NetNet*subsig = new NetNet(sig->scope(),
|
||||
sig->scope()->local_symbol(),
|
||||
NetNet::WIRE, subnet_wid);
|
||||
subsig->data_type( sig->data_type() );
|
||||
NetNet::WIRE, tmp2_vec);
|
||||
subsig->local_flag(true);
|
||||
subsig->set_line(*this);
|
||||
|
||||
@@ -642,9 +854,9 @@ NetNet* PEIdent::elaborate_bi_net(Design*des, NetScope*scope) const
|
||||
* instantiation (PGModule::elaborate_mod_) to get NetNet objects for
|
||||
* the port.
|
||||
*/
|
||||
NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
||||
NetNet* PEIdent::elaborate_subport(Design*des, NetScope*scope) const
|
||||
{
|
||||
assert(scope->type() == NetScope::MODULE);
|
||||
ivl_assert(*this, scope->type() == NetScope::MODULE);
|
||||
NetNet*sig = des->find_signal(scope, path_);
|
||||
if (sig == 0) {
|
||||
cerr << get_fileline() << ": error: no wire/reg " << path_
|
||||
@@ -659,6 +871,7 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
||||
case NetNet::PINPUT:
|
||||
case NetNet::POUTPUT:
|
||||
case NetNet::PINOUT:
|
||||
case NetNet::PREF:
|
||||
break;
|
||||
|
||||
/* If the name matches, but the signal is not a port,
|
||||
@@ -688,6 +901,33 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
||||
long midx;
|
||||
long lidx;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_subport: "
|
||||
<< "path_ = \"" << path_
|
||||
<< "\", unpacked_dimensions=" << sig->unpacked_dimensions()
|
||||
<< ", port_type()=" << sig->port_type() << endl;
|
||||
}
|
||||
|
||||
if (sig->unpacked_dimensions() && !gn_system_verilog()) {
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "Ports cannot be unpacked arrays. Try enabling SystemVerilog support." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// There cannot be parts to an unpacked array, so process this
|
||||
// simply as an unpacked array.
|
||||
if (sig->unpacked_dimensions()) {
|
||||
if (debug_elaborate) {
|
||||
cerr << get_fileline() << ": PEIdent::elaborate_subport: "
|
||||
<< "path_=\"" << path_
|
||||
<< "\" is an unpacked array with " << sig->pin_count()
|
||||
<< " elements." << endl;
|
||||
}
|
||||
scope->add_module_port_net(sig);
|
||||
return sig;
|
||||
}
|
||||
|
||||
/* Evaluate the part/bit select expressions, to get the part
|
||||
select of the signal that attaches to the port. Also handle
|
||||
range and direction checking here. */
|
||||
@@ -698,17 +938,17 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
||||
/* If this is a part select of the entire signal (or no part
|
||||
select at all) then we're done. */
|
||||
if ((lidx == 0) && (midx == (long)sig->vector_width()-1)) {
|
||||
scope->add_module_port(sig);
|
||||
scope->add_module_port_net(sig);
|
||||
return sig;
|
||||
}
|
||||
|
||||
unsigned swid = abs(midx - lidx) + 1;
|
||||
ivl_assert(*this, swid > 0 && swid < sig->vector_width());
|
||||
|
||||
netvector_t*tmp2_vec = new netvector_t(sig->data_type(),swid-1,0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::WIRE, swid);
|
||||
NetNet::WIRE, tmp2_vec);
|
||||
tmp->port_type(sig->port_type());
|
||||
tmp->data_type(sig->data_type());
|
||||
tmp->set_line(*this);
|
||||
tmp->local_flag(true);
|
||||
NetNode*ps = 0;
|
||||
@@ -726,6 +966,9 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
||||
sig = tmp;
|
||||
break;
|
||||
|
||||
case NetNet::PREF:
|
||||
// For the purposes of module ports, treat ref ports
|
||||
// just like inout ports.
|
||||
case NetNet::PINOUT:
|
||||
ps = new NetTran(scope, scope->local_symbol(), sig->vector_width(),
|
||||
swid, lidx);
|
||||
@@ -742,7 +985,21 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
||||
ps->set_line(*this);
|
||||
des->add_node(ps);
|
||||
|
||||
scope->add_module_port(sig);
|
||||
scope->add_module_port_net(sig);
|
||||
return sig;
|
||||
}
|
||||
|
||||
NetNet*PEIdent::elaborate_unpacked_net(Design*des, NetScope*scope) const
|
||||
{
|
||||
NetNet* sig = 0;
|
||||
const NetExpr*par = 0;
|
||||
NetEvent* eve = 0;
|
||||
perm_string method_name;
|
||||
|
||||
symbol_search(this, des, scope, path_, sig, par, eve);
|
||||
|
||||
ivl_assert(*this, sig);
|
||||
|
||||
return sig;
|
||||
}
|
||||
|
||||
|
||||
+577
-91
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com)
|
||||
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -33,16 +34,21 @@
|
||||
*/
|
||||
|
||||
# include "Module.h"
|
||||
# include "PEvent.h"
|
||||
# include "PClass.h"
|
||||
# include "PExpr.h"
|
||||
# include "PEvent.h"
|
||||
# include "PClass.h"
|
||||
# include "PGate.h"
|
||||
# include "PGenerate.h"
|
||||
# include "PPackage.h"
|
||||
# include "PTask.h"
|
||||
# include "PWire.h"
|
||||
# include "Statement.h"
|
||||
# include "AStatement.h"
|
||||
# include "netlist.h"
|
||||
# include "netclass.h"
|
||||
# include "netenum.h"
|
||||
# include "parse_api.h"
|
||||
# include "util.h"
|
||||
# include <typeinfo>
|
||||
# include <cassert>
|
||||
@@ -51,7 +57,9 @@
|
||||
typedef map<perm_string,LexicalScope::param_expr_t>::const_iterator mparm_it_t;
|
||||
|
||||
static void collect_parm_item_(Design*des, NetScope*scope, perm_string name,
|
||||
const LexicalScope::param_expr_t&cur)
|
||||
const LexicalScope::param_expr_t&cur,
|
||||
bool is_annotatable,
|
||||
bool local_flag)
|
||||
{
|
||||
NetScope::range_t*range_list = 0;
|
||||
for (LexicalScope::range_t*range = cur.range ; range ; range = range->next) {
|
||||
@@ -87,8 +95,9 @@ static void collect_parm_item_(Design*des, NetScope*scope, perm_string name,
|
||||
range_list = tmp;
|
||||
}
|
||||
|
||||
scope->set_parameter(name, cur.expr, cur.type, cur.msb, cur.lsb,
|
||||
cur.signed_flag, range_list, cur);
|
||||
|
||||
scope->set_parameter(name, is_annotatable, cur.expr, cur.type, cur.msb,
|
||||
cur.lsb, cur.signed_flag, local_flag, range_list, cur);
|
||||
}
|
||||
|
||||
static void collect_scope_parameters_(Design*des, NetScope*scope,
|
||||
@@ -106,7 +115,7 @@ static void collect_scope_parameters_(Design*des, NetScope*scope,
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
collect_parm_item_(des, scope, (*cur).first, (*cur).second);
|
||||
collect_parm_item_(des, scope, (*cur).first, (*cur).second, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,17 +134,41 @@ static void collect_scope_localparams_(Design*des, NetScope*scope,
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
collect_parm_item_(des, scope, (*cur).first, (*cur).second);
|
||||
collect_parm_item_(des, scope, (*cur).first, (*cur).second, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
static void collect_scope_specparams_(Design*des, NetScope*scope,
|
||||
const map<perm_string,LexicalScope::param_expr_t>&specparams)
|
||||
{
|
||||
for (mparm_it_t cur = specparams.begin()
|
||||
; cur != specparams.end() ; ++ cur ) {
|
||||
|
||||
// A specparam can not have the same name as a genvar.
|
||||
if (scope->find_genvar((*cur).first)) {
|
||||
cerr << cur->second.get_fileline()
|
||||
<< ": error: specparam and genvar in '"
|
||||
<< scope->fullname() << "' have the same name '"
|
||||
<< (*cur).first << "'." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
collect_parm_item_(des, scope, (*cur).first, (*cur).second, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Elaborate the enumeration into the given scope. If scope==0, then
|
||||
* the enumeration goes into $root instead of a scope.
|
||||
*/
|
||||
static void elaborate_scope_enumeration(Design*des, NetScope*scope,
|
||||
enum_type_t*enum_type)
|
||||
{
|
||||
bool rc_flag;
|
||||
assert(enum_type->range->size() == 2);
|
||||
NetExpr*msb_ex = elab_and_eval(des, scope, enum_type->range->front(), -1);
|
||||
NetExpr*lsb_ex = elab_and_eval(des, scope, enum_type->range->back(), -1);
|
||||
assert(enum_type->range->size() == 1);
|
||||
pform_range_t&range = enum_type->range->front();
|
||||
NetExpr*msb_ex = elab_and_eval(des, scope, range.first, -1);
|
||||
NetExpr*lsb_ex = elab_and_eval(des, scope, range.second, -1);
|
||||
|
||||
long msb = 0;
|
||||
rc_flag = eval_as_long(msb, msb_ex);
|
||||
@@ -144,34 +177,44 @@ static void elaborate_scope_enumeration(Design*des, NetScope*scope,
|
||||
rc_flag = eval_as_long(lsb, lsb_ex);
|
||||
assert(rc_flag);
|
||||
|
||||
netenum_t*use_enum = new netenum_t(enum_type->base_type, enum_type->signed_flag,
|
||||
msb, lsb, enum_type->names->size());
|
||||
netenum_t*use_enum = new netenum_t(enum_type->base_type,
|
||||
enum_type->signed_flag,
|
||||
enum_type->integer_flag, msb, lsb,
|
||||
enum_type->names->size(),
|
||||
enum_type);
|
||||
|
||||
use_enum->set_line(enum_type->li);
|
||||
scope->add_enumeration_set(use_enum);
|
||||
if (scope)
|
||||
scope->add_enumeration_set(enum_type, use_enum);
|
||||
else
|
||||
des->add_enumeration_set(enum_type, use_enum);
|
||||
|
||||
verinum cur_value (0);
|
||||
verinum one_value (1);
|
||||
size_t name_idx = 0;
|
||||
// Find the minimum and maximum allowed enumeration values.
|
||||
// Find the enumeration width.
|
||||
long raw_width = use_enum->packed_width();
|
||||
assert(raw_width > 0);
|
||||
unsigned enum_width = (unsigned)raw_width;
|
||||
// Define the default start value and the increment value to be the
|
||||
// correct type for this enumeration.
|
||||
verinum cur_value ((uint64_t)0, enum_width);
|
||||
cur_value.has_sign(enum_type->signed_flag);
|
||||
verinum one_value ((uint64_t)1, enum_width);
|
||||
one_value.has_sign(enum_type->signed_flag);
|
||||
// Find the maximum allowed enumeration value.
|
||||
verinum min_value (0);
|
||||
verinum max_value (0);
|
||||
if (enum_type->signed_flag) {
|
||||
min_value = v_not((pow(verinum(2),
|
||||
verinum(use_enum->base_width()-1)))) +
|
||||
one_value;
|
||||
max_value = pow(verinum(2), verinum(use_enum->base_width()-1)) -
|
||||
one_value;
|
||||
min_value = -pow(verinum(2), verinum(enum_width-1));
|
||||
max_value = pow(verinum(2), verinum(enum_width-1)) - one_value;
|
||||
} else {
|
||||
max_value = pow(verinum(2), verinum(use_enum->base_width())) -
|
||||
one_value;
|
||||
max_value = pow(verinum(2), verinum(enum_width)) - one_value;
|
||||
}
|
||||
min_value.has_sign(true);
|
||||
max_value.has_sign(enum_type->signed_flag);
|
||||
// Process the enumeration definition.
|
||||
for (list<named_pexpr_t>::const_iterator cur = enum_type->names->begin()
|
||||
; cur != enum_type->names->end() ; ++ cur, name_idx += 1) {
|
||||
|
||||
|
||||
// Check to see if the enumeration name has a value given.
|
||||
if (cur->parm) {
|
||||
// There is an explicit value. elaborate/evaluate
|
||||
// the value and assign it to the enumeration name.
|
||||
@@ -179,37 +222,140 @@ static void elaborate_scope_enumeration(Design*des, NetScope*scope,
|
||||
NetEConst*val_const = dynamic_cast<NetEConst*> (val);
|
||||
if (val_const == 0) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration expression is not "
|
||||
"constant." << endl;
|
||||
<< ": error: Enumeration expression for "
|
||||
<< cur->name <<" is not an integer constant."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
}
|
||||
cur_value = val_const->value();
|
||||
|
||||
// A 2-state value can not have a constant with X/Z bits.
|
||||
if (enum_type->base_type==IVL_VT_BOOL &&
|
||||
! cur_value.is_defined()) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name " << cur->name
|
||||
<< " cannot have an undefined value." << endl;
|
||||
<< " can not have an undefined value." << endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
}
|
||||
// If this is a literal constant and it has a defined
|
||||
// width then the width must match the enumeration width.
|
||||
if (PENumber *tmp = dynamic_cast<PENumber*>(cur->parm)) {
|
||||
if (tmp->value().has_len() &&
|
||||
(tmp->value().len() != enum_width)) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name " << cur->name
|
||||
<< " has an incorrectly sized constant."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// If we are padding/truncating a negative value for an
|
||||
// unsigned enumeration that is an error or if the new
|
||||
// value does not have a defined width.
|
||||
if (((cur_value.len() != enum_width) ||
|
||||
! cur_value.has_len()) &&
|
||||
! enum_type->signed_flag && cur_value.is_negative()) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name " << cur->name
|
||||
<< " has a negative value." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
// Narrower values need to be padded to the width of the
|
||||
// enumeration and defined to have the specified width.
|
||||
if (cur_value.len() < enum_width) {
|
||||
cur_value = pad_to_width(cur_value, enum_width);
|
||||
}
|
||||
|
||||
// Some wider values can be truncated.
|
||||
if (cur_value.len() > enum_width) {
|
||||
unsigned check_width = enum_width - 1;
|
||||
// Check that the upper bits match the MSB
|
||||
for (unsigned idx = enum_width;
|
||||
idx < cur_value.len();
|
||||
idx += 1) {
|
||||
if (cur_value[idx] != cur_value[check_width]) {
|
||||
// If this is an unsigned enumeration
|
||||
// then zero padding is okay.
|
||||
if (! enum_type->signed_flag &&
|
||||
(idx == enum_width) &&
|
||||
(cur_value[idx] == verinum::V0)) {
|
||||
check_width += 1;
|
||||
continue;
|
||||
}
|
||||
if (cur_value.is_defined()) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name "
|
||||
<< cur->name
|
||||
<< " has a value that is too "
|
||||
<< ((cur_value > max_value) ?
|
||||
"large" : "small")
|
||||
<< " " << cur_value << "."
|
||||
<< endl;
|
||||
} else {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name "
|
||||
<< cur->name
|
||||
<< " has trimmed bits that do "
|
||||
<< "not match the enumeration "
|
||||
<< "MSB: " << cur_value << "."
|
||||
<< endl;
|
||||
}
|
||||
des->errors += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If this is an unsigned value then make sure
|
||||
// The upper bits are not 1.
|
||||
if (! cur_value.has_sign() &&
|
||||
(cur_value[enum_width] == verinum::V1)) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name "
|
||||
<< cur->name
|
||||
<< " has a value that is too large: "
|
||||
<< cur_value << "." << endl;
|
||||
des->errors += 1;
|
||||
break;
|
||||
}
|
||||
cur_value = verinum(cur_value, enum_width);
|
||||
}
|
||||
|
||||
// At this point the value has the correct size and needs
|
||||
// to have the correct sign attribute set.
|
||||
cur_value.has_len(true);
|
||||
cur_value.has_sign(enum_type->signed_flag);
|
||||
|
||||
} else if (! cur_value.is_defined()) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name " << cur->name
|
||||
<< " cannot have an undefined inferred value." << endl;
|
||||
<< " has an undefined inferred value." << endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Cast any undefined bits to zero so the comparisons below
|
||||
// return just true (1) or false (0).
|
||||
verinum two_state_value = cur_value;
|
||||
two_state_value.cast_to_int2();
|
||||
|
||||
// The enumeration value must fit into the enumeration bits.
|
||||
if ((cur_value > max_value) ||
|
||||
(cur_value.has_sign() && (cur_value < min_value))) {
|
||||
if (!cur_value.is_defined()) {
|
||||
if (cur_value.len() > (unsigned long)use_enum->packed_width()) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name " << cur->name
|
||||
<< " value=" << cur_value
|
||||
<< " is too wide for enumeration base type." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
} else if ((two_state_value > max_value) ||
|
||||
(cur_value.has_sign() && (two_state_value < min_value))) {
|
||||
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Enumeration name " << cur->name
|
||||
<< " cannot have a value equal to " << cur_value
|
||||
<< "." << endl;
|
||||
<< " has an inferred value that overflowed." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
@@ -223,23 +369,12 @@ static void elaborate_scope_enumeration(Design*des, NetScope*scope,
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
// The values are explicitly sized to the width of the
|
||||
// base type of the enumeration.
|
||||
verinum tmp_val (0);
|
||||
if (cur_value.len() < use_enum->base_width()) {
|
||||
// Pad the current value if it is narrower than the final
|
||||
// width of the enum.
|
||||
tmp_val = pad_to_width (cur_value, use_enum->base_width());
|
||||
tmp_val.has_len(true);
|
||||
} else {
|
||||
// Truncate an oversized value. We report out of bound
|
||||
// values above. This may create duplicates.
|
||||
tmp_val = verinum(cur_value, use_enum->base_width());
|
||||
}
|
||||
tmp_val.has_sign(enum_type->signed_flag);
|
||||
rc_flag = use_enum->insert_name(name_idx, cur->name, cur_value);
|
||||
if (scope)
|
||||
rc_flag &= scope->add_enumeration_name(use_enum, cur->name);
|
||||
else
|
||||
rc_flag &= des->add_enumeration_name(use_enum, cur->name);
|
||||
|
||||
rc_flag = use_enum->insert_name(name_idx, cur->name, tmp_val);
|
||||
rc_flag &= scope->add_enumeration_name(use_enum, cur->name);
|
||||
if (! rc_flag) {
|
||||
cerr << use_enum->get_fileline()
|
||||
<< ": error: Duplicate enumeration name "
|
||||
@@ -249,17 +384,238 @@ static void elaborate_scope_enumeration(Design*des, NetScope*scope,
|
||||
|
||||
// In case the next name has an implicit value,
|
||||
// increment the current value by one.
|
||||
if (cur_value.is_defined())
|
||||
if (cur_value.is_defined()) {
|
||||
cur_value = cur_value + one_value;
|
||||
}
|
||||
}
|
||||
|
||||
use_enum->insert_name_close();
|
||||
}
|
||||
|
||||
static void elaborate_scope_enumerations(Design*des, NetScope*scope,
|
||||
const list<enum_type_t*>&enum_types)
|
||||
const set<enum_type_t*>&enum_types)
|
||||
{
|
||||
for (list<enum_type_t*>::const_iterator cur = enum_types.begin()
|
||||
for (set<enum_type_t*>::const_iterator cur = enum_types.begin()
|
||||
; cur != enum_types.end() ; ++ cur) {
|
||||
elaborate_scope_enumeration(des, scope, *cur);
|
||||
enum_type_t*curp = *cur;
|
||||
elaborate_scope_enumeration(des, scope, curp);
|
||||
}
|
||||
}
|
||||
|
||||
void elaborate_rootscope_enumerations(Design*des)
|
||||
{
|
||||
for (set<enum_type_t*>::const_iterator cur = pform_enum_sets.begin()
|
||||
; cur != pform_enum_sets.end() ; ++ cur) {
|
||||
enum_type_t*curp = *cur;
|
||||
elaborate_scope_enumeration(des, 0, curp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If the pclass includes an implicit and explicit constructor, then
|
||||
* merge the implicit constructor into the explicit constructor as
|
||||
* statements in the beginning.
|
||||
*
|
||||
* This is not necessary for proper functionality, it is an
|
||||
* optimization, so we can easily give up if it doesn't seem like it
|
||||
* will obviously work.
|
||||
*/
|
||||
static void blend_class_constructors(PClass*pclass)
|
||||
{
|
||||
perm_string new1 = perm_string::literal("new");
|
||||
perm_string new2 = perm_string::literal("new@");
|
||||
|
||||
PFunction*use_new;
|
||||
PFunction*use_new2;
|
||||
|
||||
// Locate the explicit constructor.
|
||||
map<perm_string,PFunction*>::iterator iter_new = pclass->funcs.find(new1);
|
||||
if (iter_new == pclass->funcs.end())
|
||||
use_new = 0;
|
||||
else
|
||||
use_new = iter_new->second;
|
||||
|
||||
// Locate the implicit constructor.
|
||||
map<perm_string,PFunction*>::iterator iter_new2 = pclass->funcs.find(new2);
|
||||
if (iter_new2 == pclass->funcs.end())
|
||||
use_new2 = 0;
|
||||
else
|
||||
use_new2 = iter_new2->second;
|
||||
|
||||
// If there are no constructors, then we are done.
|
||||
if (use_new==0 && use_new2==0)
|
||||
return;
|
||||
|
||||
// While we're here, look for a super.new() call. If we find
|
||||
// it, strip it out of the constructor and set it aside for
|
||||
// when we actually call the chained constructor.
|
||||
PChainConstructor*chain_new = use_new? use_new->extract_chain_constructor() : 0;
|
||||
|
||||
// If we do not have an explicit constructor chain, but there
|
||||
// is a parent class, then create an implicit chain.
|
||||
if (chain_new==0 && pclass->type->base_type!=0) {
|
||||
chain_new = new PChainConstructor(pclass->type->base_args);
|
||||
chain_new->set_line(*pclass);
|
||||
}
|
||||
|
||||
// If there are both an implicit and explicit constructor,
|
||||
// then blend the implicit constructor into the explicit
|
||||
// constructor. This eases the task for the elaborator later.
|
||||
if (use_new && use_new2) {
|
||||
// These constructors must be methods of the same class.
|
||||
ivl_assert(*use_new, use_new->method_of() == use_new2->method_of());
|
||||
|
||||
Statement*def_new = use_new->get_statement();
|
||||
Statement*def_new2 = use_new2->get_statement();
|
||||
|
||||
// It is possible, i.e. recovering from a parse error,
|
||||
// for the statement from the constructor to be
|
||||
// missing. In that case, create an empty one.
|
||||
if (def_new==0) {
|
||||
def_new = new PBlock(PBlock::BL_SEQ);
|
||||
use_new->set_statement(def_new);
|
||||
}
|
||||
|
||||
if (def_new2) use_new->push_statement_front(def_new2);
|
||||
|
||||
// Now the implicit initializations are all built into
|
||||
// the constructor. Delete the "new@" constructor.
|
||||
pclass->funcs.erase(iter_new2);
|
||||
delete use_new2;
|
||||
use_new2 = 0;
|
||||
}
|
||||
|
||||
if (chain_new) {
|
||||
if (use_new2) {
|
||||
use_new2->push_statement_front(chain_new);
|
||||
} else {
|
||||
use_new->push_statement_front(chain_new);
|
||||
}
|
||||
chain_new = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void elaborate_scope_class(Design*des, NetScope*scope, PClass*pclass)
|
||||
{
|
||||
class_type_t*use_type = pclass->type;
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << pclass->get_fileline() <<": elaborate_scope_class: "
|
||||
<< "Elaborate scope class " << pclass->pscope_name() << endl;
|
||||
}
|
||||
|
||||
class_type_t*base_class = dynamic_cast<class_type_t*> (use_type->base_type);
|
||||
if (use_type->base_type && !base_class) {
|
||||
cerr << pclass->get_fileline() << ": error: "
|
||||
<< "Base type of " << use_type->name
|
||||
<< " is not a class." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
netclass_t*use_base_class = 0;
|
||||
if (base_class) {
|
||||
ivl_assert(*pclass, scope);
|
||||
use_base_class = scope->find_class(base_class->name);
|
||||
if (use_base_class == 0) {
|
||||
cerr << pclass->get_fileline() << ": error: "
|
||||
<< "Base class " << base_class->name
|
||||
<< " not found." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
}
|
||||
|
||||
netclass_t*use_class = new netclass_t(use_type->name, use_base_class);
|
||||
|
||||
ivl_assert(*pclass, use_type->save_elaborated_type == 0);
|
||||
use_type->save_elaborated_type = use_class;
|
||||
|
||||
// Class scopes have no parent scope, because references are
|
||||
// not allowed to escape a class method.
|
||||
NetScope*class_scope = new NetScope(0, hname_t(pclass->pscope_name()),
|
||||
NetScope::CLASS);
|
||||
class_scope->set_line(pclass);
|
||||
class_scope->set_class_def(use_class);
|
||||
use_class->set_class_scope(class_scope);
|
||||
use_class->set_definition_scope(scope);
|
||||
|
||||
// Collect the properties, elaborate them, and add them to the
|
||||
// elaborated class definition.
|
||||
for (map<perm_string, class_type_t::prop_info_t>::iterator cur = use_type->properties.begin()
|
||||
; cur != use_type->properties.end() ; ++ cur) {
|
||||
|
||||
ivl_type_s*tmp = cur->second.type->elaborate_type(des, scope);
|
||||
ivl_assert(*pclass, tmp);
|
||||
if (debug_scopes) {
|
||||
cerr << pclass->get_fileline() << ": elaborate_scope_class: "
|
||||
<< " Property " << cur->first
|
||||
<< " type=" << *tmp << endl;
|
||||
}
|
||||
use_class->set_property(cur->first, cur->second.qual, tmp);
|
||||
|
||||
}
|
||||
|
||||
for (map<perm_string,PTask*>::iterator cur = pclass->tasks.begin()
|
||||
; cur != pclass->tasks.end() ; ++cur) {
|
||||
|
||||
hname_t use_name (cur->first);
|
||||
NetScope*method_scope = new NetScope(class_scope, use_name, NetScope::TASK);
|
||||
// Task methods are always automatic...
|
||||
method_scope->is_auto(true);
|
||||
method_scope->set_line(cur->second);
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << cur->second->get_fileline() << ": elaborate_scope_class: "
|
||||
<< "Elaborate method (task) scope "
|
||||
<< scope_path(method_scope) << endl;
|
||||
}
|
||||
|
||||
cur->second->elaborate_scope(des, method_scope);
|
||||
}
|
||||
|
||||
for (map<perm_string,PFunction*>::iterator cur = pclass->funcs.begin()
|
||||
; cur != pclass->funcs.end() ; ++cur) {
|
||||
|
||||
hname_t use_name (cur->first);
|
||||
NetScope*method_scope = new NetScope(class_scope, use_name, NetScope::FUNC);
|
||||
// Function methods are always automatic...
|
||||
method_scope->is_auto(true);
|
||||
method_scope->set_line(cur->second);
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << cur->second->get_fileline() << ": elaborate_scope_class: "
|
||||
<< "Elaborate method (function) scope "
|
||||
<< scope_path(method_scope) << endl;
|
||||
}
|
||||
|
||||
cur->second->elaborate_scope(des, method_scope);
|
||||
}
|
||||
|
||||
if (scope) {
|
||||
scope->add_class(use_class);
|
||||
|
||||
} else {
|
||||
des->add_class(use_class, pclass);
|
||||
}
|
||||
}
|
||||
|
||||
static void elaborate_scope_classes(Design*des, NetScope*scope,
|
||||
const vector<PClass*>&classes)
|
||||
{
|
||||
for (size_t idx = 0 ; idx < classes.size() ; idx += 1) {
|
||||
blend_class_constructors(classes[idx]);
|
||||
elaborate_scope_class(des, scope, classes[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
void elaborate_rootscope_classes(Design*des)
|
||||
{
|
||||
if (pform_classes.empty())
|
||||
return;
|
||||
|
||||
for (map<perm_string,PClass*>::iterator cur = pform_classes.begin()
|
||||
; cur != pform_classes.end() ; ++ cur) {
|
||||
blend_class_constructors(cur->second);
|
||||
elaborate_scope_class(des, 0, cur->second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,6 +660,25 @@ static void elaborate_scope_events_(Design*des, NetScope*scope,
|
||||
}
|
||||
}
|
||||
|
||||
static void elaborate_scope_task(Design*des, NetScope*scope, PTask*task)
|
||||
{
|
||||
hname_t use_name( task->pscope_name() );
|
||||
|
||||
NetScope*task_scope = new NetScope(scope, use_name, NetScope::TASK);
|
||||
task_scope->is_auto(task->is_auto());
|
||||
task_scope->set_line(task);
|
||||
|
||||
if (scope==0)
|
||||
des->add_root_task(task_scope, task);
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << task->get_fileline() << ": elaborate_scope_task: "
|
||||
<< "Elaborate task scope " << scope_path(task_scope) << endl;
|
||||
}
|
||||
|
||||
task->elaborate_scope(des, task_scope);
|
||||
}
|
||||
|
||||
static void elaborate_scope_tasks(Design*des, NetScope*scope,
|
||||
const map<perm_string,PTask*>&tasks)
|
||||
{
|
||||
@@ -345,19 +720,30 @@ static void elaborate_scope_tasks(Design*des, NetScope*scope,
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
NetScope*task_scope = new NetScope(scope, use_name,
|
||||
NetScope::TASK);
|
||||
task_scope->is_auto((*cur).second->is_auto());
|
||||
task_scope->set_line((*cur).second);
|
||||
|
||||
if (debug_scopes)
|
||||
cerr << cur->second->get_fileline() << ": debug: "
|
||||
<< "Elaborate task scope " << scope_path(task_scope) << endl;
|
||||
(*cur).second->elaborate_scope(des, task_scope);
|
||||
elaborate_scope_task(des, scope, cur->second);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void elaborate_scope_func(Design*des, NetScope*scope, PFunction*task)
|
||||
{
|
||||
hname_t use_name( task->pscope_name() );
|
||||
|
||||
NetScope*task_scope = new NetScope(scope, use_name, NetScope::FUNC);
|
||||
task_scope->is_auto(task->is_auto());
|
||||
task_scope->set_line(task);
|
||||
|
||||
if (scope==0)
|
||||
des->add_root_task(task_scope, task);
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << task->get_fileline() << ": elaborate_scope_func: "
|
||||
<< "Elaborate task scope " << scope_path(task_scope) << endl;
|
||||
}
|
||||
|
||||
task->elaborate_scope(des, task_scope);
|
||||
}
|
||||
|
||||
static void elaborate_scope_funcs(Design*des, NetScope*scope,
|
||||
const map<perm_string,PFunction*>&funcs)
|
||||
{
|
||||
@@ -400,19 +786,33 @@ static void elaborate_scope_funcs(Design*des, NetScope*scope,
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
NetScope*func_scope = new NetScope(scope, use_name,
|
||||
NetScope::FUNC);
|
||||
func_scope->is_auto((*cur).second->is_auto());
|
||||
func_scope->set_line((*cur).second);
|
||||
|
||||
if (debug_scopes)
|
||||
cerr << cur->second->get_fileline() << ": debug: "
|
||||
<< "Elaborate function scope " << scope_path(func_scope) << endl;
|
||||
(*cur).second->elaborate_scope(des, func_scope);
|
||||
elaborate_scope_func(des, scope, cur->second);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void elaborate_rootscope_tasks(Design*des)
|
||||
{
|
||||
for (map<perm_string,PTaskFunc*>::iterator cur = pform_tasks.begin()
|
||||
; cur != pform_tasks.end() ; ++ cur) {
|
||||
|
||||
if (PTask*task = dynamic_cast<PTask*> (cur->second)) {
|
||||
elaborate_scope_task(des, 0, task);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (PFunction*func = dynamic_cast<PFunction*>(cur->second)) {
|
||||
elaborate_scope_func(des, 0, func);
|
||||
continue;
|
||||
}
|
||||
|
||||
cerr << cur->second->get_fileline() << ": internal error: "
|
||||
<< "elabortae_rootscope_tasks does not understand "
|
||||
<< "this object," << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class generate_schemes_work_item_t : public elaborator_work_item_t {
|
||||
public:
|
||||
generate_schemes_work_item_t(Design*des__, NetScope*scope, Module*mod)
|
||||
@@ -445,12 +845,28 @@ class generate_schemes_work_item_t : public elaborator_work_item_t {
|
||||
Module*mod_;
|
||||
};
|
||||
|
||||
bool PPackage::elaborate_scope(Design*des, NetScope*scope)
|
||||
{
|
||||
if (debug_scopes) {
|
||||
cerr << get_fileline() << ": PPackage::elaborate_scope: "
|
||||
<< "Elaborate package " << scope_path(scope) << "." << endl;
|
||||
}
|
||||
|
||||
collect_scope_parameters_(des, scope, parameters);
|
||||
collect_scope_localparams_(des, scope, localparams);
|
||||
elaborate_scope_enumerations(des, scope, enum_sets);
|
||||
elaborate_scope_classes(des, scope, classes_lexical);
|
||||
elaborate_scope_funcs(des, scope, funcs);
|
||||
elaborate_scope_tasks(des, scope, tasks);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||
const replace_t&replacements)
|
||||
{
|
||||
if (debug_scopes) {
|
||||
cerr << get_fileline() << ": debug: Elaborate scope "
|
||||
<< scope_path(scope) << "." << endl;
|
||||
cerr << get_fileline() << ": Module::elaborate_scope: "
|
||||
<< "Elaborate " << scope_path(scope) << "." << endl;
|
||||
}
|
||||
|
||||
// Add the genvars to the scope.
|
||||
@@ -468,6 +884,8 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||
|
||||
collect_scope_localparams_(des, scope, localparams);
|
||||
|
||||
collect_scope_specparams_(des, scope, specparams);
|
||||
|
||||
// Run parameter replacements that were collected from the
|
||||
// containing scope and meant for me.
|
||||
|
||||
@@ -475,6 +893,9 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||
|
||||
elaborate_scope_enumerations(des, scope, enum_sets);
|
||||
|
||||
assert(classes.size() == classes_lexical.size());
|
||||
elaborate_scope_classes(des, scope, classes_lexical);
|
||||
|
||||
// Run through the defparams for this module and save the result
|
||||
// in a table for later final override.
|
||||
|
||||
@@ -495,7 +916,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||
delete[]attr;
|
||||
|
||||
// Generate schemes need to have their scopes elaborated, but
|
||||
// we cannot do that until defparams are run, so push it off
|
||||
// we can not do that until defparams are run, so push it off
|
||||
// into an elaborate work item.
|
||||
if (debug_scopes)
|
||||
cerr << get_fileline() << ": debug: "
|
||||
@@ -518,6 +939,19 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||
|
||||
elaborate_scope_funcs(des, scope, funcs);
|
||||
|
||||
// Look for implicit modules and implicit gates for them.
|
||||
|
||||
for (map<perm_string,Module*>::iterator cur = nested_modules.begin()
|
||||
; cur != nested_modules.end() ; ++cur) {
|
||||
// Skip modules that must be explicitly instantiated.
|
||||
if (cur->second->port_count() > 0)
|
||||
continue;
|
||||
|
||||
PGModule*nested_gate = new PGModule(cur->second, cur->second->mod_name());
|
||||
nested_gate->set_line(*cur->second);
|
||||
gates_.push_back(nested_gate);
|
||||
}
|
||||
|
||||
// Gates include modules, which might introduce new scopes, so
|
||||
// scan all of them to create those scopes.
|
||||
|
||||
@@ -618,8 +1052,10 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
||||
|
||||
// Check the generate block name.
|
||||
|
||||
// A generate "loop" can not have the same name as another scope object.
|
||||
const NetScope *child = container->child(hname_t(scope_name));
|
||||
// A generate "loop" can not have the same name as another
|
||||
// scope object. Find any scope with this name, not just an
|
||||
// exact match scope.
|
||||
const NetScope *child = container->child_byname(scope_name);
|
||||
if (child) {
|
||||
cerr << get_fileline() << ": error: generate \"loop\" and ";
|
||||
child->print_type(cerr);
|
||||
@@ -707,7 +1143,7 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
||||
genvar_verinum);
|
||||
// The file and line information should really come
|
||||
// from the genvar statement, not the for loop.
|
||||
scope->set_localparam(loop_index, gp, *this);
|
||||
scope->set_parameter(loop_index, gp, *this);
|
||||
if (debug_scopes)
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Create implicit localparam "
|
||||
@@ -960,6 +1396,12 @@ bool PGenerate::generate_scope_case_(Design*des, NetScope*container)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << get_fileline() << ": PGenerate::generate_scope_case_: "
|
||||
<< "Generate subscope " << use_name
|
||||
<< " and elaborate." << endl;
|
||||
}
|
||||
|
||||
NetScope*scope = new NetScope(container, use_name,
|
||||
NetScope::GENBLOCK);
|
||||
scope->set_line(get_file(), get_lineno());
|
||||
@@ -1029,7 +1471,13 @@ void PGenerate::elaborate_subscope_direct_(Design*des, NetScope*scope)
|
||||
typedef list<PGenerate*>::const_iterator generate_it_t;
|
||||
for (generate_it_t cur = generate_schemes.begin()
|
||||
; cur != generate_schemes.end() ; ++ cur ) {
|
||||
(*cur) -> generate_scope(des, scope);
|
||||
PGenerate*curp = *cur;
|
||||
if (debug_scopes) {
|
||||
cerr << get_fileline() << ": elaborate_subscope_direct_: "
|
||||
<< "Elaborate direct subscope " << curp->scope_name
|
||||
<< " within scope " << scope_name << endl;
|
||||
}
|
||||
curp -> generate_scope(des, scope);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1041,6 +1489,21 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
||||
scope->add_genvar((*cur).first, (*cur).second);
|
||||
}
|
||||
|
||||
// Scan the localparams in this scope, and store the information
|
||||
// needed to evaluate the parameter expressions. The expressions
|
||||
// will be evaluated later, once all parameter overrides for this
|
||||
// module have been done.
|
||||
collect_scope_localparams_(des, scope, localparams);
|
||||
|
||||
// Run through the defparams for this scope and save the result
|
||||
// in a table for later final override.
|
||||
|
||||
typedef list<PGenerate::named_expr_t>::const_iterator defparms_iter_t;
|
||||
for (defparms_iter_t cur = defparms.begin()
|
||||
; cur != defparms.end() ; ++ cur ) {
|
||||
scope->defparams.push_back(make_pair(cur->first, cur->second));
|
||||
}
|
||||
|
||||
// Scan the generated scope for nested generate schemes,
|
||||
// and *generate* new scopes, which is slightly different
|
||||
// from simple elaboration.
|
||||
@@ -1051,12 +1514,6 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
||||
(*cur) -> generate_scope(des, scope);
|
||||
}
|
||||
|
||||
// Scan the localparams in this scope, and store the information
|
||||
// needed to evaluate the parameter expressions. The expressions
|
||||
// will be evaluated later, once all parameter overrides for this
|
||||
// module have been done.
|
||||
collect_scope_localparams_(des, scope, localparams);
|
||||
|
||||
// Scan through all the task and function declarations in this
|
||||
// scope.
|
||||
elaborate_scope_tasks(des, scope, tasks);
|
||||
@@ -1081,7 +1538,7 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
||||
|
||||
if (debug_scopes)
|
||||
cerr << get_fileline() << ": debug: Generated scope " << scope_path(scope)
|
||||
<< " by generate block " << scope_name << endl;
|
||||
<< " for generate block " << scope_name << endl;
|
||||
|
||||
// Save the scope that we created, for future use.
|
||||
scope_list_.push_back(scope);
|
||||
@@ -1201,7 +1658,7 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
||||
continue;
|
||||
}
|
||||
|
||||
cerr << get_fileline() << ": error: You cannot instantiate "
|
||||
cerr << get_fileline() << ": error: You can not instantiate "
|
||||
<< "module " << mod->mod_name() << " within itself." << endl;
|
||||
cerr << get_fileline() << ": : The offending instance is "
|
||||
<< get_name() << " within " << scope_path(scn) << "." << endl;
|
||||
@@ -1294,8 +1751,12 @@ void PGModule::elaborate_scope_mod_instances_(Design*des, Module*mod, NetScope*s
|
||||
<< "." << endl;
|
||||
}
|
||||
|
||||
// Create the new scope as a MODULE with my name.
|
||||
NetScope*my_scope = new NetScope(sc, use_name, NetScope::MODULE);
|
||||
// Create the new scope as a MODULE with my name. Note
|
||||
// that if this is a nested module, mark it thus so that
|
||||
// scope searches will continue into the parent scope.
|
||||
NetScope*my_scope = new NetScope(sc, use_name, NetScope::MODULE,
|
||||
bound_type_? true : false,
|
||||
mod->program_block);
|
||||
my_scope->set_line(get_file(), mod->get_file(),
|
||||
get_lineno(), mod->get_lineno());
|
||||
my_scope->set_module_name(mod->mod_name());
|
||||
@@ -1512,7 +1973,9 @@ void PBlock::elaborate_scope(Design*des, NetScope*scope) const
|
||||
<< "Elaborate block scope " << use_name
|
||||
<< " within " << scope_path(scope) << endl;
|
||||
|
||||
my_scope = new NetScope(scope, use_name, bl_type_==BL_PAR
|
||||
// The scope type is begin-end or fork-join. The
|
||||
// sub-types of fork-join are not interesting to the scope.
|
||||
my_scope = new NetScope(scope, use_name, bl_type_!=BL_SEQ
|
||||
? NetScope::FORK_JOIN
|
||||
: NetScope::BEGIN_END);
|
||||
my_scope->set_line(get_file(), get_lineno());
|
||||
@@ -1574,6 +2037,17 @@ void PDelayStatement::elaborate_scope(Design*des, NetScope*scope) const
|
||||
statement_ -> elaborate_scope(des, scope);
|
||||
}
|
||||
|
||||
/*
|
||||
* Statements that contain a further statement but do not
|
||||
* intrinsically add a scope need to elaborate_scope the contained
|
||||
* statement.
|
||||
*/
|
||||
void PDoWhile::elaborate_scope(Design*des, NetScope*scope) const
|
||||
{
|
||||
if (statement_)
|
||||
statement_ -> elaborate_scope(des, scope);
|
||||
}
|
||||
|
||||
/*
|
||||
* Statements that contain a further statement but do not
|
||||
* intrinsically add a scope need to elaborate_scope the contained
|
||||
@@ -1585,6 +2059,18 @@ void PEventStatement::elaborate_scope(Design*des, NetScope*scope) const
|
||||
statement_ -> elaborate_scope(des, scope);
|
||||
}
|
||||
|
||||
/*
|
||||
* The standard says that we create an implicit scope for foreach
|
||||
* loops, but that is just to hold the index variables, and we'll
|
||||
* handle them by creating unique names. So just jump into the
|
||||
* contained statement for scope elaboration.
|
||||
*/
|
||||
void PForeach::elaborate_scope(Design*des, NetScope*scope) const
|
||||
{
|
||||
if (statement_)
|
||||
statement_ -> elaborate_scope(des, scope);
|
||||
}
|
||||
|
||||
/*
|
||||
* Statements that contain a further statement but do not
|
||||
* intrinsically add a scope need to elaborate_scope the contained
|
||||
|
||||
+549
-359
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2014 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
* General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "pform_types.h"
|
||||
# include "netlist.h"
|
||||
# include "netclass.h"
|
||||
# include "netdarray.h"
|
||||
# include "netenum.h"
|
||||
# include "netparray.h"
|
||||
# include "netscalar.h"
|
||||
# include "netstruct.h"
|
||||
# include "netvector.h"
|
||||
# include "netmisc.h"
|
||||
# include <typeinfo>
|
||||
# include "ivl_assert.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
* Elaborations of types may vary depending on the scope that it is
|
||||
* done in, so keep a per-scope cache of the results.
|
||||
*/
|
||||
ivl_type_s* data_type_t::elaborate_type(Design*des, NetScope*scope)
|
||||
{
|
||||
Definitions*use_definitions = scope;
|
||||
if (use_definitions == 0)
|
||||
use_definitions = des;
|
||||
|
||||
map<Definitions*,ivl_type_s*>::iterator pos = cache_type_elaborate_.lower_bound(use_definitions);
|
||||
if (pos->first == use_definitions)
|
||||
return pos->second;
|
||||
|
||||
ivl_type_s*tmp = elaborate_type_raw(des, scope);
|
||||
cache_type_elaborate_.insert(pos, pair<NetScope*,ivl_type_s*>(scope, tmp));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
ivl_type_s* data_type_t::elaborate_type_raw(Design*des, NetScope*) const
|
||||
{
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Elaborate method not implemented for " << typeid(*this).name()
|
||||
<< "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ivl_type_s* atom2_type_t::elaborate_type_raw(Design*des, NetScope*) const
|
||||
{
|
||||
switch (type_code) {
|
||||
case 64:
|
||||
if (signed_flag)
|
||||
return &netvector_t::atom2s64;
|
||||
else
|
||||
return &netvector_t::atom2u64;
|
||||
|
||||
case 32:
|
||||
if (signed_flag)
|
||||
return &netvector_t::atom2s32;
|
||||
else
|
||||
return &netvector_t::atom2u32;
|
||||
|
||||
case 16:
|
||||
if (signed_flag)
|
||||
return &netvector_t::atom2s16;
|
||||
else
|
||||
return &netvector_t::atom2u16;
|
||||
|
||||
case 8:
|
||||
if (signed_flag)
|
||||
return &netvector_t::atom2s8;
|
||||
else
|
||||
return &netvector_t::atom2u8;
|
||||
|
||||
default:
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "atom2_type_t type_code=" << type_code << "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ivl_type_s* class_type_t::elaborate_type_raw(Design*, NetScope*) const
|
||||
{
|
||||
ivl_assert(*this, save_elaborated_type);
|
||||
return save_elaborated_type;
|
||||
}
|
||||
|
||||
/*
|
||||
* elaborate_type_raw for enumerations is actually mostly performed
|
||||
* during scope elaboration so that the enumeration literals are
|
||||
* available at the right time. At that time, the netenum_t* object is
|
||||
* stashed in the scope so that I can retrieve it here.
|
||||
*/
|
||||
ivl_type_s* enum_type_t::elaborate_type_raw(Design*des, NetScope*scope) const
|
||||
{
|
||||
ivl_assert(*this, scope);
|
||||
ivl_type_s*tmp = scope->enumeration_for_key(this);
|
||||
if (tmp) return tmp;
|
||||
|
||||
tmp = des->enumeration_for_key(this);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
ivl_type_s* vector_type_t::elaborate_type_raw(Design*des, NetScope*scope) const
|
||||
{
|
||||
vector<netrange_t> packed;
|
||||
|
||||
if (pdims.get()) {
|
||||
for (list<pform_range_t>::const_iterator cur = pdims->begin()
|
||||
; cur != pdims->end() ; ++ cur) {
|
||||
|
||||
NetExpr*me = elab_and_eval(des, scope, cur->first, 0, true);
|
||||
|
||||
NetExpr*le = elab_and_eval(des, scope, cur->second, 0, true);
|
||||
|
||||
/* If elaboration failed for either expression, we
|
||||
should have already reported the error, so just
|
||||
skip the following evaluation to recover. */
|
||||
|
||||
long mnum = 0, lnum = 0;
|
||||
if ( me && ! eval_as_long(mnum, me) ) {
|
||||
assert(0);
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
if ( le && ! eval_as_long(lnum, le) ) {
|
||||
assert(0);
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
packed.push_back(netrange_t(mnum, lnum));
|
||||
}
|
||||
}
|
||||
|
||||
netvector_t*tmp = new netvector_t(packed, base_type);
|
||||
tmp->set_signed(signed_flag);
|
||||
tmp->set_isint(integer_flag);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
ivl_type_s* real_type_t::elaborate_type_raw(Design*, NetScope*) const
|
||||
{
|
||||
switch (type_code) {
|
||||
case REAL:
|
||||
return &netreal_t::type_real;
|
||||
case SHORTREAL:
|
||||
return &netreal_t::type_shortreal;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ivl_type_s* string_type_t::elaborate_type_raw(Design*, NetScope*) const
|
||||
{
|
||||
return &netstring_t::type_string;
|
||||
}
|
||||
|
||||
ivl_type_s* parray_type_t::elaborate_type_raw(Design*des, NetScope*) const
|
||||
{
|
||||
cerr << get_fileline() << " : sorry: "
|
||||
<< "Packed arrays are not currently supported in this context."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
netstruct_t* struct_type_t::elaborate_type_raw(Design*des, NetScope*scope) const
|
||||
{
|
||||
netstruct_t*res = new netstruct_t;
|
||||
|
||||
res->packed(packed_flag);
|
||||
|
||||
if (union_flag)
|
||||
res->union_flag(true);
|
||||
|
||||
for (list<struct_member_t*>::iterator cur = members->begin()
|
||||
; cur != members->end() ; ++ cur) {
|
||||
|
||||
// Elaborate the type of the member.
|
||||
struct_member_t*curp = *cur;
|
||||
ivl_type_t mem_vec = curp->type->elaborate_type(des, scope);
|
||||
if (mem_vec == 0)
|
||||
continue;
|
||||
|
||||
// There may be several names that are the same type:
|
||||
// <data_type> name1, name2, ...;
|
||||
// Process all the member, and give them a type.
|
||||
for (list<decl_assignment_t*>::iterator name = curp->names->begin()
|
||||
; name != curp->names->end() ; ++ name) {
|
||||
decl_assignment_t*namep = *name;
|
||||
|
||||
netstruct_t::member_t memb;
|
||||
memb.name = namep->name;
|
||||
memb.net_type = mem_vec;
|
||||
res->append_member(des, memb);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
ivl_type_s* uarray_type_t::elaborate_type_raw(Design*des, NetScope*scope) const
|
||||
{
|
||||
|
||||
ivl_type_t btype = base_type->elaborate_type(des, scope);
|
||||
|
||||
assert(dims->size() >= 1);
|
||||
list<pform_range_t>::const_iterator cur = dims->begin();
|
||||
|
||||
// Special case: if the dimension is nil:nil, this is a
|
||||
// dynamic array. Note that we only know how to handle dynamic
|
||||
// arrays with 1 dimension at a time.
|
||||
if (cur->first==0 && cur->second==0) {
|
||||
assert(dims->size()==1);
|
||||
ivl_type_s*res = new netdarray_t(btype);
|
||||
return res;
|
||||
}
|
||||
|
||||
vector<netrange_t> dimensions;
|
||||
bool bad_range = evaluate_ranges(des, scope, dimensions, *dims);
|
||||
|
||||
if (bad_range) {
|
||||
cerr << get_fileline() << " : warning: "
|
||||
<< "Bad dimensions for type here." << endl;
|
||||
}
|
||||
|
||||
ivl_assert(*this, btype);
|
||||
ivl_type_s*res = new netuarray_t(dimensions, btype);
|
||||
return res;
|
||||
}
|
||||
+1666
-284
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008,2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2008-2012 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -55,7 +55,7 @@ bool AProcess::elaborate(Design*des, NetScope*scope) const
|
||||
// Evaluate the attributes for this process, if there
|
||||
// are any. These attributes are to be attached to the
|
||||
// NetProcTop object.
|
||||
struct attrib_list_t*attrib_list = 0;
|
||||
struct attrib_list_t*attrib_list;
|
||||
unsigned attrib_list_n = 0;
|
||||
attrib_list = evaluate_attributes(attributes, attrib_list_n, des, scope);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1998-2013 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -26,7 +26,9 @@
|
||||
* target.
|
||||
*/
|
||||
# include "target.h"
|
||||
# include "netclass.h"
|
||||
# include "netlist.h"
|
||||
# include "compiler.h"
|
||||
# include <typeinfo>
|
||||
# include <cassert>
|
||||
# include <cstring>
|
||||
@@ -165,6 +167,11 @@ bool NetSignExtend::emit_node(struct target_t*tgt) const
|
||||
return tgt->sign_extend(this);
|
||||
}
|
||||
|
||||
bool NetSubstitute::emit_node(struct target_t*tgt) const
|
||||
{
|
||||
return tgt->substitute(this);
|
||||
}
|
||||
|
||||
bool NetUReduce::emit_node(struct target_t*tgt) const
|
||||
{
|
||||
return tgt->ureduce(this);
|
||||
@@ -259,6 +266,17 @@ bool NetDisable::emit_proc(struct target_t*tgt) const
|
||||
return tgt->proc_disable(this);
|
||||
}
|
||||
|
||||
bool NetDoWhile::emit_proc(struct target_t*tgt) const
|
||||
{
|
||||
tgt->proc_do_while(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
void NetDoWhile::emit_proc_recurse(struct target_t*tgt) const
|
||||
{
|
||||
proc_->emit_proc(tgt);
|
||||
}
|
||||
|
||||
bool NetForce::emit_proc(struct target_t*tgt) const
|
||||
{
|
||||
return tgt->proc_force(this);
|
||||
@@ -270,6 +288,11 @@ bool NetForever::emit_proc(struct target_t*tgt) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetForLoop::emit_proc(struct target_t*tgt) const
|
||||
{
|
||||
return tgt->proc_block(as_block_);
|
||||
}
|
||||
|
||||
bool NetFree::emit_proc(struct target_t*tgt) const
|
||||
{
|
||||
tgt->proc_free(this);
|
||||
@@ -316,6 +339,11 @@ bool NetWhile::emit_proc(struct target_t*tgt) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void NetWhile::emit_proc_recurse(struct target_t*tgt) const
|
||||
{
|
||||
proc_->emit_proc(tgt);
|
||||
}
|
||||
|
||||
void NetBlock::emit_recurse(struct target_t*tgt) const
|
||||
{
|
||||
if (last_ == 0)
|
||||
@@ -378,16 +406,32 @@ void NetRepeat::emit_recurse(struct target_t*tgt) const
|
||||
statement_->emit_proc(tgt);
|
||||
}
|
||||
|
||||
void netclass_t::emit_scope(struct target_t*tgt) const
|
||||
{
|
||||
class_scope_->emit_scope(tgt);
|
||||
}
|
||||
|
||||
void NetScope::emit_scope(struct target_t*tgt) const
|
||||
{
|
||||
if (debug_emit) {
|
||||
cerr << "NetScope::emit_scope: "
|
||||
<< "Emit scope " << scope_path(this) << endl;
|
||||
}
|
||||
|
||||
tgt->scope(this);
|
||||
|
||||
for (NetEvent*cur = events_ ; cur ; cur = cur->snext_)
|
||||
tgt->event(cur);
|
||||
|
||||
for (list<netenum_t*>::const_iterator cur = enum_sets_.begin()
|
||||
for (map<perm_string,netclass_t*>::const_iterator cur = classes_.begin()
|
||||
; cur != classes_.end() ; ++cur) {
|
||||
cur->second->emit_scope(tgt);
|
||||
tgt->class_type(this, cur->second);
|
||||
}
|
||||
|
||||
for (map<const enum_type_t*,netenum_t*>::const_iterator cur = enum_sets_.begin()
|
||||
; cur != enum_sets_.end() ; ++cur)
|
||||
tgt->enumeration(this, *cur);
|
||||
tgt->enumeration(this, cur->second);
|
||||
|
||||
for (map<hname_t,NetScope*>::const_iterator cur = children_.begin()
|
||||
; cur != children_.end() ; ++ cur )
|
||||
@@ -416,11 +460,20 @@ bool NetScope::emit_defs(struct target_t*tgt) const
|
||||
{
|
||||
bool flag = true;
|
||||
|
||||
if (debug_emit) {
|
||||
cerr << "NetScope::emit_defs: "
|
||||
<< "Emit definitions for " << scope_path(this) << endl;
|
||||
}
|
||||
|
||||
switch (type_) {
|
||||
case PACKAGE:
|
||||
case MODULE:
|
||||
for (map<hname_t,NetScope*>::const_iterator cur = children_.begin()
|
||||
; cur != children_.end() ; ++ cur )
|
||||
flag &= cur->second->emit_defs(tgt);
|
||||
for (map<perm_string,netclass_t*>::const_iterator cur = classes_.begin()
|
||||
; cur != classes_.end() ; ++ cur)
|
||||
flag &= cur->second->emit_defs(tgt);
|
||||
break;
|
||||
|
||||
case FUNC:
|
||||
@@ -439,9 +492,9 @@ bool NetScope::emit_defs(struct target_t*tgt) const
|
||||
return flag;
|
||||
}
|
||||
|
||||
void NetWhile::emit_proc_recurse(struct target_t*tgt) const
|
||||
bool netclass_t::emit_defs(struct target_t*tgt) const
|
||||
{
|
||||
proc_->emit_proc(tgt);
|
||||
return class_scope_->emit_defs(tgt);
|
||||
}
|
||||
|
||||
int Design::emit(struct target_t*tgt) const
|
||||
@@ -451,11 +504,31 @@ int Design::emit(struct target_t*tgt) const
|
||||
if (tgt->start_design(this) == false)
|
||||
return -2;
|
||||
|
||||
// enumerate the scopes
|
||||
for (list<NetScope*>::const_iterator scope = root_scopes_.begin();
|
||||
scope != root_scopes_.end(); ++ scope )
|
||||
(*scope)->emit_scope(tgt);
|
||||
for (map<NetScope*,PTaskFunc*>::const_iterator scope = root_tasks_.begin()
|
||||
; scope != root_tasks_.end() ; ++ scope) {
|
||||
scope->first->emit_scope(tgt);
|
||||
scope->first->emit_defs(tgt);
|
||||
}
|
||||
|
||||
// enumerate package scopes
|
||||
for (map<perm_string,NetScope*>::const_iterator scope = packages_.begin()
|
||||
; scope != packages_.end() ; ++ scope) {
|
||||
scope->second->emit_scope(tgt);
|
||||
}
|
||||
|
||||
for (map<perm_string,netclass_t*>::const_iterator cur = classes_.begin()
|
||||
; cur != classes_.end() ; ++cur) {
|
||||
const NetScope*use_scope = cur->second->class_scope();
|
||||
cur->second->emit_scope(tgt);
|
||||
tgt->class_type(use_scope, cur->second);
|
||||
cur->second->emit_defs(tgt);
|
||||
}
|
||||
|
||||
// enumerate root scopes
|
||||
for (list<NetScope*>::const_iterator scope = root_scopes_.begin()
|
||||
; scope != root_scopes_.end(); ++ scope ) {
|
||||
(*scope)->emit_scope(tgt);
|
||||
}
|
||||
|
||||
// emit nodes
|
||||
bool nodes_rc = true;
|
||||
@@ -475,8 +548,11 @@ int Design::emit(struct target_t*tgt) const
|
||||
|
||||
// emit task and function definitions
|
||||
bool tasks_rc = true;
|
||||
for (list<NetScope*>::const_iterator scope = root_scopes_.begin();
|
||||
scope != root_scopes_.end(); ++ scope )
|
||||
for (map<perm_string,NetScope*>::const_iterator scope = packages_.begin()
|
||||
; scope != packages_.end() ; ++ scope )
|
||||
tasks_rc &= scope->second->emit_defs(tgt);
|
||||
for (list<NetScope*>::const_iterator scope = root_scopes_.begin()
|
||||
; scope != root_scopes_.end(); ++ scope )
|
||||
tasks_rc &= (*scope)->emit_defs(tgt);
|
||||
|
||||
|
||||
@@ -487,6 +563,15 @@ int Design::emit(struct target_t*tgt) const
|
||||
for (const NetAnalogTop*idx = aprocs_ ; idx ; idx = idx->next_)
|
||||
proc_rc &= idx->emit(tgt);
|
||||
|
||||
if (nodes_rc == false)
|
||||
tgt->errors += 1;
|
||||
if (tasks_rc == false)
|
||||
tgt->errors += 1;
|
||||
if (proc_rc == false)
|
||||
tgt->errors += 1;
|
||||
if (branches_rc == false)
|
||||
tgt->errors += 1;
|
||||
|
||||
rc = tgt->end_design(this);
|
||||
|
||||
if (nodes_rc == false)
|
||||
@@ -494,7 +579,7 @@ int Design::emit(struct target_t*tgt) const
|
||||
if (tasks_rc == false)
|
||||
return -2;
|
||||
if (proc_rc == false)
|
||||
return -3;
|
||||
return -3;
|
||||
if (branches_rc == false)
|
||||
return -4;
|
||||
|
||||
@@ -506,6 +591,11 @@ void NetEAccess::expr_scan(struct expr_scan_t*tgt) const
|
||||
tgt->expr_access_func(this);
|
||||
}
|
||||
|
||||
void NetEArrayPattern::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_array_pattern(this);
|
||||
}
|
||||
|
||||
void NetEBinary::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_binary(this);
|
||||
@@ -546,11 +636,31 @@ void NetEEvent::expr_scan(struct expr_scan_t*tgt) const
|
||||
tgt->expr_event(this);
|
||||
}
|
||||
|
||||
void NetELast::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_last(this);
|
||||
}
|
||||
|
||||
void NetENetenum::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_netenum(this);
|
||||
}
|
||||
|
||||
void NetENew::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_new(this);
|
||||
}
|
||||
|
||||
void NetENull::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_null(this);
|
||||
}
|
||||
|
||||
void NetEProperty::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_property(this);
|
||||
}
|
||||
|
||||
void NetEScope::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_scope(this);
|
||||
@@ -566,6 +676,21 @@ void NetESFunc::expr_scan(struct expr_scan_t*tgt) const
|
||||
tgt->expr_sfunc(this);
|
||||
}
|
||||
|
||||
void NetEShallowCopy::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_scopy(this);
|
||||
}
|
||||
|
||||
void NetEShallowCopy::expr_scan_oper1(struct expr_scan_t*tgt) const
|
||||
{
|
||||
arg1_->expr_scan(tgt);
|
||||
}
|
||||
|
||||
void NetEShallowCopy::expr_scan_oper2(struct expr_scan_t*tgt) const
|
||||
{
|
||||
arg2_->expr_scan(tgt);
|
||||
}
|
||||
|
||||
void NetEUFunc::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
tgt->expr_ufunc(this);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998-1999 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1998-2014 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -44,6 +44,14 @@ verinum* PEBinary::eval_const(Design*des, NetScope*scope) const
|
||||
verinum*res;
|
||||
|
||||
switch (op_) {
|
||||
case 'p': {
|
||||
if (l->is_defined() && r->is_defined()) {
|
||||
res = new verinum(pow(*l, *r));
|
||||
} else {
|
||||
res = new verinum(verinum::Vx, l->len());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case '+': {
|
||||
if (l->is_defined() && r->is_defined()) {
|
||||
res = new verinum(*l + *r);
|
||||
@@ -261,7 +269,7 @@ verinum* PEUnary::eval_const(Design*des, NetScope*scope) const
|
||||
for (unsigned idx = 0 ; idx < val->len() ; idx += 1)
|
||||
tmp.set(idx, val->get(idx));
|
||||
|
||||
*val = v_not(tmp) + verinum(verinum::V1, 1);
|
||||
*val = -tmp;
|
||||
val->has_sign(true);
|
||||
return val;
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
+929
-575
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-23
@@ -14,11 +14,8 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: hello_vpi.c,v 1.5 2007/01/17 05:35:48 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This file contains an example VPI module to demonstrate the tools
|
||||
@@ -60,22 +57,3 @@ void (*vlog_startup_routines[])() = {
|
||||
my_hello_register,
|
||||
0
|
||||
};
|
||||
/*
|
||||
* $Log: hello_vpi.c,v $
|
||||
* Revision 1.5 2007/01/17 05:35:48 steve
|
||||
* Fix typo is hello_vpi.c example.
|
||||
*
|
||||
* Revision 1.4 2006/10/30 22:46:25 steve
|
||||
* Updates for Cygwin portability (pr1585922)
|
||||
*
|
||||
* Revision 1.3 2002/08/12 01:35:01 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.2 2002/08/11 23:47:04 steve
|
||||
* Add missing Log and Ident strings.
|
||||
*
|
||||
* Revision 1.1 2002/04/18 03:25:16 steve
|
||||
* More examples.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Id: sqrt-virtex.v,v 1.5 2007/03/22 16:08:18 steve Exp $"
|
||||
*/
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Id: sqrt.vl,v 1.5 2007/03/22 16:08:18 steve Exp $"
|
||||
*/
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// This example describes a 16x1 RAM that can be synthesized into
|
||||
|
||||
+112
-80
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2013 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -24,6 +24,7 @@
|
||||
# include <iostream>
|
||||
|
||||
# include "netlist.h"
|
||||
# include "netvector.h"
|
||||
# include "netmisc.h"
|
||||
# include "ivl_assert.h"
|
||||
|
||||
@@ -118,11 +119,11 @@ NetNet* NetEBAdd::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
}
|
||||
|
||||
perm_string path = lsig->scope()->local_symbol();
|
||||
NetNet*osig = new NetNet(lsig->scope(), path, NetNet::IMPLICIT, width);
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
osig_vec->set_signed(has_sign());
|
||||
NetNet*osig = new NetNet(lsig->scope(), path, NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(expr_type());
|
||||
osig->set_signed(has_sign());
|
||||
|
||||
perm_string oname = osig->scope()->local_symbol();
|
||||
NetAddSub *adder = new NetAddSub(lsig->scope(), oname, width);
|
||||
@@ -173,11 +174,11 @@ NetNet* NetEBBits::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
rsig = pad_to_width(des, rsig, width, *this);
|
||||
|
||||
assert(lsig->vector_width() == rsig->vector_width());
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, width);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(expr_type());
|
||||
|
||||
perm_string oname = scope->local_symbol();
|
||||
NetLogic*gate;
|
||||
@@ -243,11 +244,11 @@ NetNet* NetEBComp::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
rsig = pad_to_width(des, rsig, width, *this);
|
||||
}
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(IVL_VT_LOGIC);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, 1);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(IVL_VT_LOGIC);
|
||||
|
||||
// Test if the comparison is signed.
|
||||
//
|
||||
@@ -273,7 +274,7 @@ NetNet* NetEBComp::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
|
||||
if (op_ == 'E' || op_ == 'N') {
|
||||
NetCaseCmp*gate = new NetCaseCmp(scope, scope->local_symbol(),
|
||||
width, op_=='E'?true:false);
|
||||
width, op_=='E'?NetCaseCmp::EEQ:NetCaseCmp::NEQ);
|
||||
gate->set_line(*this);
|
||||
connect(gate->pin(0), osig->pin(0));
|
||||
connect(gate->pin(1), lsig->pin(0));
|
||||
@@ -390,11 +391,11 @@ NetNet* NetEBPow::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
connect(powr->pin_DataA(), lsig->pin(0));
|
||||
connect(powr->pin_DataB(), rsig->pin(0));
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
osig_vec->set_signed(has_sign());
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, width);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->set_signed(has_sign());
|
||||
osig->local_flag(true);
|
||||
|
||||
connect(powr->pin_Result(), osig->pin(0));
|
||||
@@ -427,11 +428,11 @@ NetNet* NetEBMult::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
connect(mult->pin_DataA(), lsig->pin(0));
|
||||
connect(mult->pin_DataB(), rsig->pin(0));
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
osig_vec->set_signed(has_sign());
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, width);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->set_signed(has_sign());
|
||||
osig->local_flag(true);
|
||||
|
||||
connect(mult->pin_Result(), osig->pin(0));
|
||||
@@ -452,11 +453,11 @@ NetNet* NetEBDiv::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
if (real_args) width = 1;
|
||||
else width = expr_width();
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(lsig->data_type(), width-1, 0);
|
||||
osig_vec->set_signed(has_sign());
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, width);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(lsig->data_type());
|
||||
osig->set_signed(has_sign());
|
||||
osig->local_flag(true);
|
||||
|
||||
switch (op()) {
|
||||
@@ -530,10 +531,10 @@ NetNet* NetEBLogic::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
return 0;
|
||||
}
|
||||
|
||||
netvector_t*osig_tmp = new netvector_t(expr_type());
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, 1);
|
||||
NetNet::IMPLICIT, osig_tmp);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
NetLogic*olog;
|
||||
@@ -597,10 +598,10 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
if (shift == 0)
|
||||
return lsig;
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), expr_width()-1,0);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, expr_width());
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
// ushift is the amount of pad created by the shift.
|
||||
@@ -614,14 +615,15 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
// to the amount left by the shift.
|
||||
NetPartSelect*psel = new NetPartSelect(lsig, shift<0? ushift : 0,
|
||||
part_width,
|
||||
NetPartSelect::VP);
|
||||
NetPartSelect::VP,
|
||||
signed_flag && right_flag);
|
||||
psel->set_line(*this);
|
||||
des->add_node(psel);
|
||||
|
||||
netvector_t*psig_vec = new netvector_t(expr_type(), part_width-1, 0);
|
||||
NetNet*psig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, part_width);
|
||||
NetNet::IMPLICIT, psig_vec);
|
||||
psig->set_line(*this);
|
||||
psig->data_type(expr_type());
|
||||
psig->local_flag(true);
|
||||
connect(psig->pin(0), psel->pin(0));
|
||||
|
||||
@@ -646,10 +648,11 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
znum);
|
||||
des->add_node(zcon);
|
||||
|
||||
netvector_t*zsig_vec = new netvector_t(osig->data_type(),
|
||||
znum.len()-1, 0);
|
||||
NetNet*zsig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::WIRE, znum.len());
|
||||
NetNet::WIRE, zsig_vec);
|
||||
zsig->set_line(*this);
|
||||
zsig->data_type(osig->data_type());
|
||||
zsig->local_flag(true);
|
||||
connect(zcon->pin(0), zsig->pin(0));
|
||||
|
||||
@@ -676,10 +679,10 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
|
||||
if (rsig == 0) return 0;
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), expr_width()-1, 0);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, expr_width());
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
NetCLShift*dev = new NetCLShift(scope, scope->local_symbol(),
|
||||
@@ -702,11 +705,11 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
NetNet* NetEConcat::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
{
|
||||
/* First, synthesize the operands. */
|
||||
unsigned num_parms = parms_.count();
|
||||
NetNet**tmp = new NetNet*[parms_.count()];
|
||||
unsigned num_parms = parms_.size();
|
||||
NetNet**tmp = new NetNet*[parms_.size()];
|
||||
bool flag = true;
|
||||
ivl_variable_type_t data_type = IVL_VT_NO_TYPE;
|
||||
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
|
||||
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
|
||||
if (parms_[idx]->expr_width() == 0) {
|
||||
/* We need to synthesize a replication of zero. */
|
||||
tmp[idx] = parms_[idx]->synthesize(des, scope, root);
|
||||
@@ -739,10 +742,10 @@ NetNet* NetEConcat::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
|
||||
/* Make a NetNet object to carry the output vector. */
|
||||
perm_string path = scope->local_symbol();
|
||||
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, expr_width());
|
||||
netvector_t*osig_vec = new netvector_t(data_type, expr_width()-1, 0);
|
||||
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(data_type);
|
||||
|
||||
NetConcat*concat = new NetConcat(scope, scope->local_symbol(),
|
||||
osig->vector_width(),
|
||||
@@ -754,8 +757,8 @@ NetNet* NetEConcat::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
unsigned count_input_width = 0;
|
||||
unsigned cur_pin = 1;
|
||||
for (unsigned rpt = 0; rpt < repeat(); rpt += 1) {
|
||||
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
|
||||
unsigned concat_item = parms_.count()-idx-1;
|
||||
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
|
||||
unsigned concat_item = parms_.size()-idx-1;
|
||||
if (tmp[concat_item] == 0) continue;
|
||||
connect(concat->pin(cur_pin), tmp[concat_item]->pin(0));
|
||||
cur_pin += 1;
|
||||
@@ -785,11 +788,11 @@ NetNet* NetEConst::synthesize(Design*des, NetScope*scope, NetExpr*)
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, width);
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
osig_vec->set_signed(has_sign());
|
||||
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(expr_type());
|
||||
osig->set_signed(has_sign());
|
||||
|
||||
NetConst*con = new NetConst(scope, scope->local_symbol(), value());
|
||||
con->set_line(*this);
|
||||
@@ -806,11 +809,11 @@ NetNet* NetECReal::synthesize(Design*des, NetScope*scope, NetExpr*)
|
||||
{
|
||||
perm_string path = scope->local_symbol();
|
||||
|
||||
NetNet*osig = new NetNet(scope, path, NetNet::WIRE, 1);
|
||||
netvector_t*osig_vec = new netvector_t(IVL_VT_REAL);
|
||||
osig_vec->set_signed(has_sign());
|
||||
NetNet*osig = new NetNet(scope, path, NetNet::WIRE, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(IVL_VT_REAL);
|
||||
osig->set_signed(has_sign());
|
||||
|
||||
NetLiteral*con = new NetLiteral(scope, scope->local_symbol(), value_);
|
||||
con->set_line(*this);
|
||||
@@ -839,10 +842,10 @@ NetNet* NetEUBits::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
}
|
||||
|
||||
unsigned width = isig->vector_width();
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, width);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
perm_string oname = scope->local_symbol();
|
||||
@@ -882,11 +885,12 @@ NetNet* NetEUnary::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
if (expr_->has_sign() == false)
|
||||
return sub;
|
||||
|
||||
netvector_t*sig_vec = new netvector_t(sub->data_type(),
|
||||
sub->vector_width()-1, 0);
|
||||
NetNet*sig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::WIRE, sub->vector_width());
|
||||
NetNet::WIRE, sig_vec);
|
||||
sig->set_line(*this);
|
||||
sig->local_flag(true);
|
||||
sig->data_type(sub->data_type());
|
||||
|
||||
NetAbs*tmp = new NetAbs(scope, scope->local_symbol(), sub->vector_width());
|
||||
tmp->set_line(*this);
|
||||
@@ -956,10 +960,10 @@ NetNet* NetEUReduce::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
gate->set_line(*this);
|
||||
des->add_node(gate);
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(expr_type());
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, 1);
|
||||
NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
connect(gate->pin(0), osig->pin(0));
|
||||
@@ -977,7 +981,10 @@ NetNet* NetECast::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
|
||||
switch (op()) {
|
||||
case 'v':
|
||||
isig = cast_to_int4(des, scope, isig, isig->vector_width());
|
||||
isig = cast_to_int4(des, scope, isig, expr_width());
|
||||
break;
|
||||
case '2':
|
||||
isig = cast_to_int2(des, scope, isig, expr_width());
|
||||
break;
|
||||
case 'r':
|
||||
isig = cast_to_real(des, scope, isig);
|
||||
@@ -1006,8 +1013,6 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
|
||||
if (sub == 0) return 0;
|
||||
|
||||
NetNet*off = 0;
|
||||
|
||||
// Detect the special case that there is a base expression and
|
||||
// it is constant. In this case we can generate fixed part selects.
|
||||
if (NetEConst*base_const = dynamic_cast<NetEConst*>(base_)) {
|
||||
@@ -1064,10 +1069,12 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
NetPartSelect::VP);
|
||||
des->add_node(sel);
|
||||
|
||||
ivl_assert(*this, select_width > 0);
|
||||
netvector_t*tmp_vec = new netvector_t(sub->data_type(),
|
||||
select_width-1, 0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::WIRE, select_width);
|
||||
NetNet::WIRE, tmp_vec);
|
||||
tmp->set_line(*this);
|
||||
tmp->data_type(sub->data_type());
|
||||
tmp->local_flag(true);
|
||||
connect(sel->pin(0), tmp->pin(0));
|
||||
|
||||
@@ -1091,10 +1098,10 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
connect(cat->pin(concat_count), above->pin(0));
|
||||
}
|
||||
|
||||
tmp_vec = new netvector_t(sub->data_type(), expr_width()-1, 0);
|
||||
tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::WIRE, expr_width());
|
||||
NetNet::WIRE, tmp_vec);
|
||||
tmp->set_line(*this);
|
||||
tmp->data_type(sub->data_type());
|
||||
tmp->local_flag(true);
|
||||
connect(cat->pin(0), tmp->pin(0));
|
||||
}
|
||||
@@ -1105,16 +1112,17 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
// actual part/bit select. Generate a NetPartSelect object to
|
||||
// do the work, and replace "sub" with the selected output.
|
||||
if (base_ != 0) {
|
||||
off = base_->synthesize(des, scope, root);
|
||||
NetNet*off = base_->synthesize(des, scope, root);
|
||||
|
||||
NetPartSelect*sel = new NetPartSelect(sub, off, expr_width(),
|
||||
base_->has_sign());
|
||||
sel->set_line(*this);
|
||||
des->add_node(sel);
|
||||
|
||||
netvector_t*tmp_vec = new netvector_t(sub->data_type(),
|
||||
expr_width()-1, 0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, expr_width());
|
||||
tmp->data_type(sub->data_type());
|
||||
NetNet::IMPLICIT, tmp_vec);
|
||||
tmp->local_flag(true);
|
||||
tmp->set_line(*this);
|
||||
sub = tmp;
|
||||
@@ -1135,10 +1143,11 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
// extension or 0 extension, depending on the has_sign() mode
|
||||
// of the expression.
|
||||
|
||||
netvector_t*net_vec = new netvector_t(expr_type(), expr_width()-1, 0);
|
||||
net_vec->set_signed(has_sign());
|
||||
NetNet*net = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, expr_width());
|
||||
NetNet::IMPLICIT, net_vec);
|
||||
net->set_line(*this);
|
||||
net->data_type(expr_type());
|
||||
net->local_flag(true);
|
||||
if (has_sign()) {
|
||||
NetSignExtend*pad = new NetSignExtend(scope,
|
||||
@@ -1149,7 +1158,6 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
|
||||
connect(pad->pin(1), sub->pin(0));
|
||||
connect(pad->pin(0), net->pin(0));
|
||||
net->set_signed(true);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -1166,10 +1174,10 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
con->set_line(*this);
|
||||
des->add_node(con);
|
||||
|
||||
netvector_t*tmp_vec = new netvector_t(expr_type(), pad_width-1, 0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, pad_width);
|
||||
NetNet::IMPLICIT, tmp_vec);
|
||||
tmp->set_line(*this);
|
||||
tmp->data_type(expr_type());
|
||||
tmp->local_flag(true);
|
||||
connect(tmp->pin(0), con->pin(0));
|
||||
|
||||
@@ -1221,9 +1229,9 @@ NetNet* NetETernary::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
ivl_assert(*this, csig->vector_width() == 1);
|
||||
|
||||
unsigned width=expr_width();
|
||||
NetNet*osig = new NetNet(csig->scope(), path, NetNet::IMPLICIT, width);
|
||||
netvector_t*osig_vec = new netvector_t(expr_type(), width-1, 0);
|
||||
NetNet*osig = new NetNet(csig->scope(), path, NetNet::IMPLICIT, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
/* Make sure the types match. */
|
||||
@@ -1263,14 +1271,31 @@ NetNet* NetETernary::synthesize(Design *des, NetScope*scope, NetExpr*root)
|
||||
*/
|
||||
NetNet* NetESignal::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
{
|
||||
// If this is a synthesis with a specific value for the
|
||||
// signal, then replace it (here) with a constant value.
|
||||
if (net_->scope()==scope && net_->name()==scope->genvar_tmp) {
|
||||
netvector_t*tmp_vec = new netvector_t(net_->data_type(),
|
||||
net_->vector_width()-1, 0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, tmp_vec);
|
||||
verinum tmp_val ((uint64_t)scope->genvar_tmp_val, net_->vector_width());
|
||||
NetConst*tmp_const = new NetConst(scope, scope->local_symbol(), tmp_val);
|
||||
tmp_const->set_line(*this);
|
||||
des->add_node(tmp_const);
|
||||
|
||||
connect(tmp->pin(0), tmp_const->pin(0));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (word_ == 0)
|
||||
return net_;
|
||||
|
||||
netvector_t*tmp_vec = new netvector_t(net_->data_type(),
|
||||
net_->vector_width()-1, 0);
|
||||
NetNet*tmp = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, net_->vector_width());
|
||||
NetNet::IMPLICIT, tmp_vec);
|
||||
tmp->set_line(*this);
|
||||
tmp->local_flag(true);
|
||||
tmp->data_type(net_->data_type());
|
||||
|
||||
// For NetExpr objects, the word index is already converted to
|
||||
// a canonical (lsb==0) address. Just use the index directly.
|
||||
@@ -1301,16 +1326,16 @@ static NetEvWait* make_func_trigger(Design*des, NetScope*scope, NetExpr*root)
|
||||
NetEvWait*trigger = 0;
|
||||
|
||||
NexusSet*nset = root->nex_input(false);
|
||||
if (nset && (nset->count() > 0)) {
|
||||
if (nset && (nset->size() > 0)) {
|
||||
NetEvent*ev = new NetEvent(scope->local_symbol());
|
||||
ev->set_line(*root);
|
||||
|
||||
NetEvProbe*pr = new NetEvProbe(scope, scope->local_symbol(),
|
||||
ev, NetEvProbe::ANYEDGE,
|
||||
nset->count());
|
||||
nset->size());
|
||||
pr->set_line(*root);
|
||||
for (unsigned idx = 0 ; idx < nset->count() ; idx += 1)
|
||||
connect(nset[0][idx], pr->pin(idx));
|
||||
for (unsigned idx = 0 ; idx < nset->size() ; idx += 1)
|
||||
connect(nset->at(idx).lnk, pr->pin(idx));
|
||||
|
||||
des->add_node(pr);
|
||||
|
||||
@@ -1355,12 +1380,12 @@ NetNet* NetESFunc::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
net->set_line(*this);
|
||||
des->add_node(net);
|
||||
|
||||
netvector_t*osig_vec = new netvector_t(def->type, def->wid-1, 0);
|
||||
osig_vec->set_signed(def->type==IVL_VT_REAL? true : false);
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::WIRE, def->wid);
|
||||
NetNet::WIRE, osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->set_signed(def->type==IVL_VT_REAL? true : false);
|
||||
osig->data_type(def->type);
|
||||
|
||||
connect(net->pin(0), osig->pin(0));
|
||||
|
||||
@@ -1386,11 +1411,11 @@ NetNet* NetESFunc::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
|
||||
NetNet* NetEUFunc::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
{
|
||||
svector<NetNet*> eparms (parms_.count());
|
||||
vector<NetNet*> eparms (parms_.size());
|
||||
|
||||
/* Synthesize the arguments. */
|
||||
bool errors = false;
|
||||
for (unsigned idx = 0; idx < eparms.count(); idx += 1) {
|
||||
for (unsigned idx = 0; idx < eparms.size(); idx += 1) {
|
||||
if (dynamic_cast<NetEEvent*> (parms_[idx])) {
|
||||
errors = true;
|
||||
continue;
|
||||
@@ -1423,16 +1448,23 @@ NetNet* NetEUFunc::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
||||
des->add_node(net);
|
||||
|
||||
/* Create an output signal and connect it to the function. */
|
||||
netvector_t*osig_vec = new netvector_t(result_sig_->expr_type(),
|
||||
result_sig_->vector_width()-1, 0);
|
||||
NetNet*osig = new NetNet(scope_, scope_->local_symbol(), NetNet::WIRE,
|
||||
result_sig_->vector_width());
|
||||
osig_vec);
|
||||
osig->set_line(*this);
|
||||
osig->local_flag(true);
|
||||
osig->data_type(result_sig_->expr_type());
|
||||
connect(net->pin(0), osig->pin(0));
|
||||
|
||||
if (debug_synth2) {
|
||||
cerr << get_fileline() << ": NetEUFunc::synthesize: "
|
||||
<< "result_sig_->vector_width()=" << result_sig_->vector_width()
|
||||
<< ", osig->vector_width()=" << osig->vector_width() << endl;
|
||||
}
|
||||
|
||||
/* Connect the pins to the arguments. */
|
||||
NetFuncDef*def = func_->func_def();
|
||||
for (unsigned idx = 0; idx < eparms.count(); idx += 1) {
|
||||
for (unsigned idx = 0; idx < eparms.size(); idx += 1) {
|
||||
unsigned width = def->port(idx)->vector_width();
|
||||
NetNet*tmp;
|
||||
if (eparms[idx]->get_signed()) {
|
||||
|
||||
+39
-19
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2012 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
@@ -24,75 +24,85 @@
|
||||
# include "functor.h"
|
||||
# include "netlist.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
functor_t::~functor_t()
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::event(class Design*, class NetEvent*)
|
||||
void functor_t::event(Design*, NetEvent*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::signal(class Design*, class NetNet*)
|
||||
void functor_t::signal(Design*, NetNet*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::process(class Design*, class NetProcTop*)
|
||||
void functor_t::process(Design*, NetProcTop*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_abs(class Design*, class NetAbs*)
|
||||
void functor_t::lpm_abs(Design*, NetAbs*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_add_sub(class Design*, class NetAddSub*)
|
||||
void functor_t::lpm_add_sub(Design*, NetAddSub*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_compare(class Design*, class NetCompare*)
|
||||
void functor_t::lpm_compare(Design*, NetCompare*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_const(class Design*, class NetConst*)
|
||||
void functor_t::lpm_concat(Design*, NetConcat*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_divide(class Design*, class NetDivide*)
|
||||
void functor_t::lpm_const(Design*, NetConst*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_literal(class Design*, class NetLiteral*)
|
||||
void functor_t::lpm_divide(Design*, NetDivide*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_modulo(class Design*, class NetModulo*)
|
||||
void functor_t::lpm_literal(Design*, NetLiteral*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_ff(class Design*, class NetFF*)
|
||||
void functor_t::lpm_modulo(Design*, NetModulo*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_logic(class Design*, class NetLogic*)
|
||||
void functor_t::lpm_ff(Design*, NetFF*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_mult(class Design*, class NetMult*)
|
||||
void functor_t::lpm_logic(Design*, NetLogic*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_mux(class Design*, class NetMux*)
|
||||
void functor_t::lpm_mult(Design*, NetMult*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_pow(class Design*, class NetPow*)
|
||||
void functor_t::lpm_mux(Design*, NetMux*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::sign_extend(class Design*, class NetSignExtend*)
|
||||
void functor_t::lpm_part_select(Design*, NetPartSelect*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_ureduce(class Design*, class NetUReduce*)
|
||||
void functor_t::lpm_pow(Design*, NetPow*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::sign_extend(Design*, NetSignExtend*)
|
||||
{
|
||||
}
|
||||
|
||||
void functor_t::lpm_ureduce(Design*, NetUReduce*)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -185,6 +195,11 @@ void NetCompare::functor_node(Design*des, functor_t*fun)
|
||||
fun->lpm_compare(des, this);
|
||||
}
|
||||
|
||||
void NetConcat::functor_node(Design*des, functor_t*fun)
|
||||
{
|
||||
fun->lpm_concat(des, this);
|
||||
}
|
||||
|
||||
void NetConst::functor_node(Design*des, functor_t*fun)
|
||||
{
|
||||
fun->lpm_const(des, this);
|
||||
@@ -225,6 +240,11 @@ void NetMux::functor_node(Design*des, functor_t*fun)
|
||||
fun->lpm_mux(des, this);
|
||||
}
|
||||
|
||||
void NetPartSelect::functor_node(Design*des, functor_t*fun)
|
||||
{
|
||||
fun->lpm_part_select(des, this);
|
||||
}
|
||||
|
||||
void NetPow::functor_node(Design*des, functor_t*fun)
|
||||
{
|
||||
fun->lpm_pow(des, this);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __functor_H
|
||||
#define __functor_H
|
||||
#ifndef IVL_functor_H
|
||||
#define IVL_functor_H
|
||||
/*
|
||||
* Copyright (c) 1999-2008 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -57,6 +57,9 @@ struct functor_t {
|
||||
/* This method is called for each structural comparator. */
|
||||
virtual void lpm_compare(class Design*des, class NetCompare*);
|
||||
|
||||
/* This method is called for each structural concatenation. */
|
||||
virtual void lpm_concat(class Design*des, class NetConcat*);
|
||||
|
||||
/* This method is called for each structural constant. */
|
||||
virtual void lpm_const(class Design*des, class NetConst*);
|
||||
|
||||
@@ -81,6 +84,8 @@ struct functor_t {
|
||||
/* This method is called for each MUX. */
|
||||
virtual void lpm_mux(class Design*des, class NetMux*);
|
||||
|
||||
virtual void lpm_part_select(class Design*des, class NetPartSelect*);
|
||||
|
||||
/* This method is called for each power. */
|
||||
virtual void lpm_pow(class Design*des, class NetPow*);
|
||||
|
||||
@@ -100,4 +105,4 @@ struct proc_match_t {
|
||||
virtual int block(class NetBlock*);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* IVL_functor_H */
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# Boston, MA 02111-1307, USA
|
||||
#
|
||||
|
||||
@@ -28,7 +28,7 @@ SUFFIX=@SUFFIX@
|
||||
|
||||
# These are used for linking...
|
||||
LD=$CC
|
||||
LDFLAGS="@SHARED@ -L@LIBDIR@"
|
||||
LDFLAGS="@IVCTARGETFLAGS@ @SHARED@ -L@LIBDIR@"
|
||||
LDLIBS="-lveriuser$SUFFIX -lvpi$SUFFIX"
|
||||
|
||||
CCSRC=
|
||||
|
||||
@@ -63,6 +63,7 @@ ivl_expr_file
|
||||
ivl_expr_lineno
|
||||
ivl_expr_name
|
||||
ivl_expr_nature
|
||||
ivl_expr_net_type
|
||||
ivl_expr_opcode
|
||||
ivl_expr_oper1
|
||||
ivl_expr_oper2
|
||||
@@ -70,6 +71,7 @@ ivl_expr_oper3
|
||||
ivl_expr_parameter
|
||||
ivl_expr_parm
|
||||
ivl_expr_parms
|
||||
ivl_expr_property_idx
|
||||
ivl_expr_repeat
|
||||
ivl_expr_scope
|
||||
ivl_expr_sel_type
|
||||
@@ -139,7 +141,9 @@ ivl_lpm_width
|
||||
|
||||
ivl_lval_idx
|
||||
ivl_lval_mux
|
||||
ivl_lval_nest
|
||||
ivl_lval_part_off
|
||||
ivl_lval_property_idx
|
||||
ivl_lval_sel_type
|
||||
ivl_lval_sig
|
||||
ivl_lval_width
|
||||
@@ -166,6 +170,12 @@ ivl_parameter_basename
|
||||
ivl_parameter_expr
|
||||
ivl_parameter_file
|
||||
ivl_parameter_lineno
|
||||
ivl_parameter_local
|
||||
ivl_parameter_lsb
|
||||
ivl_parameter_msb
|
||||
ivl_parameter_scope
|
||||
ivl_parameter_signed
|
||||
ivl_parameter_width
|
||||
|
||||
ivl_path_condit
|
||||
ivl_path_delay
|
||||
@@ -175,10 +185,23 @@ ivl_path_source
|
||||
ivl_path_source_negedge
|
||||
ivl_path_source_posedge
|
||||
|
||||
ivl_process_analog
|
||||
ivl_process_attr_cnt
|
||||
ivl_process_attr_val
|
||||
ivl_process_file
|
||||
ivl_process_lineno
|
||||
ivl_process_scope
|
||||
ivl_process_stmt
|
||||
ivl_process_type
|
||||
|
||||
ivl_scope_attr_cnt
|
||||
ivl_scope_attr_val
|
||||
ivl_scope_basename
|
||||
ivl_scope_children
|
||||
ivl_scope_child
|
||||
ivl_scope_childs
|
||||
ivl_scope_class
|
||||
ivl_scope_classes
|
||||
ivl_scope_def
|
||||
ivl_scope_def_file
|
||||
ivl_scope_def_lineno
|
||||
@@ -194,6 +217,10 @@ ivl_scope_logs
|
||||
ivl_scope_log
|
||||
ivl_scope_lpms
|
||||
ivl_scope_lpm
|
||||
ivl_scope_mod_module_ports
|
||||
ivl_scope_mod_module_port_name
|
||||
ivl_scope_mod_module_port_type
|
||||
ivl_scope_mod_module_port_width
|
||||
ivl_scope_mod_port
|
||||
ivl_scope_name
|
||||
ivl_scope_param
|
||||
@@ -228,8 +255,12 @@ ivl_signal_local
|
||||
ivl_signal_lsb
|
||||
ivl_signal_msb
|
||||
ivl_signal_name
|
||||
ivl_signal_net_type
|
||||
ivl_signal_nex
|
||||
ivl_signal_npath
|
||||
ivl_signal_packed_dimensions
|
||||
ivl_signal_packed_lsb
|
||||
ivl_signal_packed_msb
|
||||
ivl_signal_path
|
||||
ivl_signal_port
|
||||
ivl_signal_scope
|
||||
@@ -237,18 +268,6 @@ ivl_signal_signed
|
||||
ivl_signal_type
|
||||
ivl_signal_width
|
||||
|
||||
ivl_path_delay
|
||||
ivl_path_source
|
||||
|
||||
ivl_process_analog
|
||||
ivl_process_attr_cnt
|
||||
ivl_process_attr_val
|
||||
ivl_process_file
|
||||
ivl_process_lineno
|
||||
ivl_process_scope
|
||||
ivl_process_stmt
|
||||
ivl_process_type
|
||||
|
||||
ivl_statement_type
|
||||
|
||||
ivl_stmt_block_count
|
||||
@@ -272,6 +291,7 @@ ivl_stmt_lvals
|
||||
ivl_stmt_lwidth
|
||||
ivl_stmt_name
|
||||
ivl_stmt_nevent
|
||||
ivl_stmt_opcode
|
||||
ivl_stmt_parm
|
||||
ivl_stmt_parm_count
|
||||
ivl_stmt_rval
|
||||
@@ -292,6 +312,17 @@ ivl_switch_scope
|
||||
ivl_switch_type
|
||||
ivl_switch_width
|
||||
|
||||
ivl_type_base
|
||||
ivl_type_element
|
||||
ivl_type_name
|
||||
ivl_type_packed_dimensions
|
||||
ivl_type_packed_lsb
|
||||
ivl_type_packed_msb
|
||||
ivl_type_prop_name
|
||||
ivl_type_prop_type
|
||||
ivl_type_properties
|
||||
ivl_type_signed
|
||||
|
||||
ivl_udp_init
|
||||
ivl_udp_file
|
||||
ivl_udp_lineno
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
#ifndef __ivl_alloc_H
|
||||
#define __ivl_alloc_H
|
||||
#ifndef IVL_ivl_alloc_H
|
||||
#define IVL_ivl_alloc_H
|
||||
/*
|
||||
* Copyright (C) 2010 Cary R. (cygcary@yahoo.com)
|
||||
* Copyright (C) 2010-2014 Cary R. (cygcary@yahoo.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -83,4 +83,4 @@
|
||||
__ivl_rtn; \
|
||||
})
|
||||
|
||||
#endif
|
||||
#endif /* IVL_ivl_alloc_H */
|
||||
|
||||
+5
-6
@@ -1,5 +1,7 @@
|
||||
#ifndef IVL_ivl_assert_H
|
||||
#define IVL_ivl_assert_H
|
||||
/*
|
||||
* Copyright (c) 2007-2010 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2007-2014 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -14,12 +16,9 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __ivl_assert_h
|
||||
#define __ivl_assert_h
|
||||
|
||||
# include <cstdlib>
|
||||
|
||||
#define ivl_assert(tok, expression) \
|
||||
@@ -32,4 +31,4 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
#endif /* IVL_ivl_assert_H */
|
||||
|
||||
+222
-60
@@ -1,7 +1,7 @@
|
||||
#ifndef __ivl_target_H
|
||||
#define __ivl_target_H
|
||||
#ifndef IVL_ivl_target_H
|
||||
#define IVL_ivl_target_H
|
||||
/*
|
||||
* Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -16,17 +16,25 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
# include <inttypes.h>
|
||||
# include <stddef.h>
|
||||
|
||||
/* Re the _CLASS define: clang++ wants this to be class to match the
|
||||
* definition, but clang (the C) compiler needs it to be a struct
|
||||
* since class is not defined in C. They are effectively both pointers
|
||||
* to an object so everything works out. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define _BEGIN_DECL extern "C" {
|
||||
#define _END_DECL }
|
||||
#define _CLASS class
|
||||
#else
|
||||
#define _BEGIN_DECL
|
||||
#define _END_DECL
|
||||
#define _CLASS struct
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC__
|
||||
@@ -157,21 +165,8 @@ typedef struct ivl_array_s *ivl_array_t;
|
||||
typedef struct ivl_branch_s *ivl_branch_t;
|
||||
typedef struct ivl_delaypath_s*ivl_delaypath_t;
|
||||
typedef struct ivl_design_s *ivl_design_t;
|
||||
/* clang++ wants this to be class to match the definition, but clang
|
||||
* (the C) compiler needs it to be a struct since class is not defined
|
||||
* in C. They are effecively both pointers to an object so everything
|
||||
* works out. */
|
||||
#ifdef __cplusplus
|
||||
typedef class ivl_discipline_s*ivl_discipline_t;
|
||||
#else
|
||||
typedef struct ivl_discipline_s*ivl_discipline_t;
|
||||
#endif
|
||||
/* See the comments above. */
|
||||
#ifdef __cplusplus
|
||||
typedef class netenum_t *ivl_enumtype_t;
|
||||
#else
|
||||
typedef struct netenum_t *ivl_enumtype_t;
|
||||
#endif
|
||||
typedef _CLASS ivl_discipline_s*ivl_discipline_t;
|
||||
typedef const _CLASS netenum_t*ivl_enumtype_t;
|
||||
typedef struct ivl_event_s *ivl_event_t;
|
||||
typedef struct ivl_expr_s *ivl_expr_t;
|
||||
typedef struct ivl_island_s *ivl_island_t;
|
||||
@@ -180,12 +175,7 @@ typedef struct ivl_lval_s *ivl_lval_t;
|
||||
typedef struct ivl_net_const_s*ivl_net_const_t;
|
||||
typedef struct ivl_net_logic_s*ivl_net_logic_t;
|
||||
typedef struct ivl_udp_s *ivl_udp_t;
|
||||
/* See the comments above. */
|
||||
#ifdef __cplusplus
|
||||
typedef class ivl_nature_s *ivl_nature_t;
|
||||
#else
|
||||
typedef struct ivl_nature_s *ivl_nature_t;
|
||||
#endif
|
||||
typedef _CLASS ivl_nature_s *ivl_nature_t;
|
||||
typedef struct ivl_net_probe_s*ivl_net_probe_t;
|
||||
typedef struct ivl_nexus_s *ivl_nexus_t;
|
||||
typedef struct ivl_nexus_ptr_s*ivl_nexus_ptr_t;
|
||||
@@ -193,9 +183,11 @@ typedef struct ivl_parameter_s*ivl_parameter_t;
|
||||
typedef struct ivl_process_s *ivl_process_t;
|
||||
typedef struct ivl_scope_s *ivl_scope_t;
|
||||
typedef struct ivl_signal_s *ivl_signal_t;
|
||||
typedef struct ivl_port_info_s*ivl_port_info_t;
|
||||
typedef struct ivl_switch_s *ivl_switch_t;
|
||||
typedef struct ivl_memory_s *ivl_memory_t; //XXXX __attribute__((deprecated));
|
||||
typedef struct ivl_statement_s*ivl_statement_t;
|
||||
typedef const _CLASS ivl_type_s*ivl_type_t;
|
||||
|
||||
/*
|
||||
* These are types that are defined as enumerations. These have
|
||||
@@ -233,11 +225,16 @@ typedef enum ivl_expr_type_e {
|
||||
IVL_EX_ENUMTYPE = 21,
|
||||
IVL_EX_EVENT = 17,
|
||||
IVL_EX_MEMORY = 4,
|
||||
IVL_EX_NEW = 23,
|
||||
IVL_EX_NULL = 22,
|
||||
IVL_EX_NUMBER = 5,
|
||||
IVL_EX_ARRAY_PATTERN = 26,
|
||||
IVL_EX_PROPERTY = 24,
|
||||
IVL_EX_REALNUM = 16,
|
||||
IVL_EX_SCOPE = 6,
|
||||
IVL_EX_SELECT = 7,
|
||||
IVL_EX_SFUNC = 8,
|
||||
IVL_EX_SHALLOWCOPY = 25,
|
||||
IVL_EX_SIGNAL = 9,
|
||||
IVL_EX_STRING = 10,
|
||||
IVL_EX_TERNARY = 11,
|
||||
@@ -301,7 +298,10 @@ typedef enum ivl_lpm_type_e {
|
||||
IVL_LPM_CAST_INT2 = 35,
|
||||
IVL_LPM_CAST_REAL = 33,
|
||||
IVL_LPM_CONCAT = 16,
|
||||
IVL_LPM_CONCATZ = 36, /* Transparent concat */
|
||||
IVL_LPM_CMP_EEQ= 18, /* Case EQ (===) */
|
||||
IVL_LPM_CMP_EQX= 37, /* Windcard EQ (==?) */
|
||||
IVL_LPM_CMP_EQZ= 38, /* casez EQ */
|
||||
IVL_LPM_CMP_EQ = 10,
|
||||
IVL_LPM_CMP_GE = 1,
|
||||
IVL_LPM_CMP_GT = 2,
|
||||
@@ -328,6 +328,7 @@ typedef enum ivl_lpm_type_e {
|
||||
IVL_LPM_SHIFTR = 7,
|
||||
IVL_LPM_SIGN_EXT=27,
|
||||
IVL_LPM_SUB = 8,
|
||||
IVL_LPM_SUBSTITUTE=39,
|
||||
/* IVL_LPM_RAM = 9, / obsolete */
|
||||
IVL_LPM_UFUNC = 14
|
||||
} ivl_lpm_type_t;
|
||||
@@ -358,12 +359,14 @@ typedef enum ivl_scope_type_e {
|
||||
IVL_SCT_TASK = 2,
|
||||
IVL_SCT_BEGIN = 3,
|
||||
IVL_SCT_FORK = 4,
|
||||
IVL_SCT_GENERATE= 5
|
||||
IVL_SCT_GENERATE= 5,
|
||||
IVL_SCT_PACKAGE = 6,
|
||||
IVL_SCT_CLASS = 7
|
||||
} ivl_scope_type_t;
|
||||
|
||||
/* Signals (ivl_signal_t) that are ports into the scope that contains
|
||||
them have a port type. Otherwise, they are port IVL_SIP_NONE. */
|
||||
typedef enum ivl_signal_port_e {
|
||||
typedef enum OUT {
|
||||
IVL_SIP_NONE = 0,
|
||||
IVL_SIP_INPUT = 1,
|
||||
IVL_SIP_OUTPUT= 2,
|
||||
@@ -403,9 +406,12 @@ typedef enum ivl_statement_type_e {
|
||||
IVL_ST_DELAY = 11,
|
||||
IVL_ST_DELAYX = 12,
|
||||
IVL_ST_DISABLE = 13,
|
||||
IVL_ST_DO_WHILE = 30,
|
||||
IVL_ST_FORCE = 14,
|
||||
IVL_ST_FOREVER = 15,
|
||||
IVL_ST_FORK = 16,
|
||||
IVL_ST_FORK_JOIN_ANY = 28,
|
||||
IVL_ST_FORK_JOIN_NONE = 29,
|
||||
IVL_ST_FREE = 26,
|
||||
IVL_ST_RELEASE = 17,
|
||||
IVL_ST_REPEAT = 18,
|
||||
@@ -432,6 +438,9 @@ typedef enum ivl_variable_type_e {
|
||||
IVL_VT_BOOL = 3,
|
||||
IVL_VT_LOGIC = 4,
|
||||
IVL_VT_STRING = 5,
|
||||
IVL_VT_DARRAY = 6, /* Array (esp. dynamic array) */
|
||||
IVL_VT_CLASS = 7, /* SystemVerilog class instances */
|
||||
IVL_VT_QUEUE = 8, /* SystemVerilog queue instances */
|
||||
IVL_VT_VECTOR = IVL_VT_LOGIC /* For compatibility */
|
||||
} ivl_variable_type_t;
|
||||
|
||||
@@ -770,6 +779,11 @@ extern unsigned ivl_event_lineno(ivl_event_t net);
|
||||
* Get the data type of the expression node. This uses the variable
|
||||
* type enum to express the type of the expression node.
|
||||
*
|
||||
* ivl_expr_net_type
|
||||
* This is used in some cases to carry more advanced type
|
||||
* descriptions. Over the long run, all type information will be
|
||||
* moved into the ivl_type_t type description method.
|
||||
*
|
||||
* ivl_expr_width
|
||||
* This method returns the bit width of the expression at this
|
||||
* node. It can be applied to any expression node, and returns the
|
||||
@@ -802,6 +816,36 @@ extern unsigned ivl_event_lineno(ivl_event_t net);
|
||||
*
|
||||
* - IVL_EX_BINARY
|
||||
*
|
||||
* - IVL_EX_PROPERTY
|
||||
* This expression represents the property select from a class
|
||||
* type, for example "foo.property" where "foo" is a class handle and
|
||||
* "property" is the name of one of the properties of the class. The
|
||||
* ivl_expr_signal function returns the ivl_signal_t for "foo" and the
|
||||
* data_type for the signal will be IVL_VT_CLASS.
|
||||
*
|
||||
* The ivl_signal_net_type(sig) for the "foo" signal will be a class
|
||||
* type and from there you can get access to the type information.
|
||||
*
|
||||
* Elaboration reduces the properties of a class to a vector numbered
|
||||
* from 0 to the number of properties. The ivl_expr_property_idx()
|
||||
* function gets the index of the selected property into the property
|
||||
* table. That number can be passed to ivl_type_prop_*() functions to
|
||||
* get details about the property.
|
||||
*
|
||||
* If the property is an array, then the ivl_expr_oper1() function
|
||||
* returns the canonical expression for accessing the element of the
|
||||
* property.
|
||||
*
|
||||
* - IVL_EX_NEW
|
||||
* This expression takes one or two operands. The first operand,
|
||||
* returned by ivl_expr_oper1() is the number of elements to create
|
||||
* for the dynamic array. The second operand, if present, is returned
|
||||
* by the ivl_expr_oper2() function. If this returns a non-nil
|
||||
* expression, it is the initial value to be written to the elements
|
||||
* of the array. If the expression is an IVL_EX_ARRAY_PATTERN, then
|
||||
* this is the very special case of a list of values to be written to
|
||||
* array elements.
|
||||
*
|
||||
* - IVL_EX_SELECT
|
||||
* This expression takes two operands, oper1 is the expression to
|
||||
* select from, and oper2 is the selection base. The ivl_expr_width
|
||||
@@ -810,6 +854,14 @@ extern unsigned ivl_event_lineno(ivl_event_t net);
|
||||
* conversion from signal units to vector units, so the result of
|
||||
* ivl_expr_oper1 should range from 0 to ivl_expr_width().
|
||||
*
|
||||
* This expression is also used to implement string substrings. If the
|
||||
* sub-expression (oper1) is IVL_VT_STRING, then the base expression
|
||||
* (oper2) is a character address, with 0 the first address of the
|
||||
* string, 1 the second, and so on. This is OPPOSITE how a part select
|
||||
* of a string cast to a vector works, to be aware. The size of the
|
||||
* expression is an even multiple of 8, and is 8 times the number of
|
||||
* characters to pick.
|
||||
*
|
||||
* - IVL_EX_SIGNAL
|
||||
* This expression references a signal vector. The ivl_expr_signal
|
||||
* function gets a handle for the signal that is referenced. The
|
||||
@@ -839,6 +891,7 @@ extern unsigned ivl_event_lineno(ivl_event_t net);
|
||||
*/
|
||||
|
||||
extern ivl_expr_type_t ivl_expr_type(ivl_expr_t net);
|
||||
extern ivl_type_t ivl_expr_net_type(ivl_expr_t net);
|
||||
extern ivl_variable_type_t ivl_expr_value(ivl_expr_t net);
|
||||
extern const char*ivl_expr_file(ivl_expr_t net);
|
||||
extern unsigned ivl_expr_lineno(ivl_expr_t net);
|
||||
@@ -855,23 +908,23 @@ extern uint64_t ivl_expr_delay_val(ivl_expr_t net);
|
||||
extern double ivl_expr_dvalue(ivl_expr_t net);
|
||||
/* IVL_EX_ENUMTYPE */
|
||||
extern ivl_enumtype_t ivl_expr_enumtype(ivl_expr_t net);
|
||||
/* IVL_EX_SIGNAL, IVL_EX_SFUNC, IVL_EX_VARIABLE */
|
||||
/* IVL_EX_PROPERTY IVL_EX_SIGNAL IVL_EX_SFUNC IVL_EX_VARIABLE */
|
||||
extern const char* ivl_expr_name(ivl_expr_t net);
|
||||
/* IVL_EX_BACCESS */
|
||||
extern ivl_nature_t ivl_expr_nature(ivl_expr_t net);
|
||||
/* IVL_EX_BINARY IVL_EX_UNARY */
|
||||
extern char ivl_expr_opcode(ivl_expr_t net);
|
||||
/* IVL_EX_BINARY IVL_EX_UNARY, IVL_EX_MEMORY IVL_EX_TERNARY */
|
||||
/* IVL_EX_BINARY IVL_EX_UNARY, IVL_EX_MEMORY IVL_EX_NEW IVL_EX_TERNARY */
|
||||
extern ivl_expr_t ivl_expr_oper1(ivl_expr_t net);
|
||||
/* IVL_EX_BINARY IVL_EX_TERNARY */
|
||||
/* IVL_EX_BINARY IVL_EX_NEW IVL_EX_TERNARY */
|
||||
extern ivl_expr_t ivl_expr_oper2(ivl_expr_t net);
|
||||
/* IVL_EX_TERNARY */
|
||||
extern ivl_expr_t ivl_expr_oper3(ivl_expr_t net);
|
||||
/* and expression */
|
||||
extern ivl_parameter_t ivl_expr_parameter(ivl_expr_t net);
|
||||
/* IVL_EX_CONCAT IVL_EX_UFUNC */
|
||||
/* IVL_EX_ARRAY_PATTERN IVL_EX_CONCAT IVL_EX_UFUNC */
|
||||
extern ivl_expr_t ivl_expr_parm(ivl_expr_t net, unsigned idx);
|
||||
/* IVL_EX_CONCAT IVL_EX_SFUNC IVL_EX_UFUNC */
|
||||
/* IVL_EX_ARRAY_PATTERN IVL_EX_CONCAT IVL_EX_SFUNC IVL_EX_UFUNC */
|
||||
extern unsigned ivl_expr_parms(ivl_expr_t net);
|
||||
/* IVL_EX_CONCAT */
|
||||
extern unsigned ivl_expr_repeat(ivl_expr_t net);
|
||||
@@ -879,9 +932,11 @@ extern unsigned ivl_expr_repeat(ivl_expr_t net);
|
||||
extern ivl_select_type_t ivl_expr_sel_type(ivl_expr_t net);
|
||||
/* IVL_EX_EVENT */
|
||||
extern ivl_event_t ivl_expr_event(ivl_expr_t net);
|
||||
/* IVL_EX_PROPERTY */
|
||||
extern int ivl_expr_property_idx(ivl_expr_t net);
|
||||
/* IVL_EX_SCOPE */
|
||||
extern ivl_scope_t ivl_expr_scope(ivl_expr_t net);
|
||||
/* IVL_EX_SIGNAL */
|
||||
/* IVL_EX_PROPERTY IVL_EX_SIGNAL */
|
||||
extern ivl_signal_t ivl_expr_signal(ivl_expr_t net);
|
||||
/* any expression */
|
||||
extern int ivl_expr_signed(ivl_expr_t net);
|
||||
@@ -1218,7 +1273,7 @@ extern unsigned ivl_lpm_lineno(ivl_lpm_t net);
|
||||
* width of the part. The ivl_lpm_q is the part end, and the
|
||||
* ivl_lpm_data(0) is the non-part end.
|
||||
*
|
||||
* - Comparisons (IVL_LPM_CMP_GT/GE/EQ/NE/EEQ/NEE)
|
||||
* - Comparisons (IVL_LPM_CMP_GT/GE/EQ/NE/EEQ/NEE/EQX/EQZ)
|
||||
* These devices have two inputs, available by the ivl_lpm_data()
|
||||
* function, and one output available by the ivl_lpm_q function. The
|
||||
* output width is always 1, but the ivl_lpm_width() returns the width
|
||||
@@ -1230,6 +1285,11 @@ extern unsigned ivl_lpm_lineno(ivl_lpm_t net);
|
||||
* magnitude compare, the signedness does matter. In any case, the
|
||||
* result of the compare is always unsigned.
|
||||
*
|
||||
* The EQX and EQZ nodes are windcard compares, where xz bits (EQX) or
|
||||
* z bits (EQZ) in the data(1) operand are treated as windcards. no
|
||||
* bits in the data(0) operand are wild. This matches the
|
||||
* SystemVerilog convention for the ==? operator.
|
||||
*
|
||||
* - Mux Device (IVL_LPM_MUX)
|
||||
* The MUX device has a q output, a select input, and a number of data
|
||||
* inputs. The ivl_lpm_q output and the ivl_lpm_data inputs all have
|
||||
@@ -1279,7 +1339,7 @@ extern unsigned ivl_lpm_lineno(ivl_lpm_t net);
|
||||
* repeated to get the desired width. The ivl core assures that the
|
||||
* input vector is exactly ivl_lpm_width() / ivl_lpm_size() bits.
|
||||
*
|
||||
* - Sign Exend (IVL_LPM_SIGN_EXT)
|
||||
* - Sign Extend (IVL_LPM_SIGN_EXT)
|
||||
* This node takes a single input and generates a single output. The
|
||||
* input must be signed, and the output will be a vector sign extended
|
||||
* to the desired width. The ivl_lpm_width() value is the output
|
||||
@@ -1355,7 +1415,7 @@ extern ivl_nexus_t ivl_lpm_sync_set(ivl_lpm_t net);
|
||||
extern ivl_expr_t ivl_lpm_sset_value(ivl_lpm_t net);
|
||||
/* IVL_LPM_ARRAY */
|
||||
extern ivl_signal_t ivl_lpm_array(ivl_lpm_t net);
|
||||
/* IVL_LPM_PART */
|
||||
/* IVL_LPM_PART IVL_LPM_SUBSTITUTE */
|
||||
extern unsigned ivl_lpm_base(ivl_lpm_t net);
|
||||
/* IVL_LPM_FF */
|
||||
extern ivl_nexus_t ivl_lpm_clk(ivl_lpm_t net);
|
||||
@@ -1365,12 +1425,14 @@ extern ivl_scope_t ivl_lpm_define(ivl_lpm_t net);
|
||||
extern ivl_nexus_t ivl_lpm_enable(ivl_lpm_t net);
|
||||
/* IVL_LPM_ADD IVL_LPM_CONCAT IVL_LPM_FF IVL_LPM_PART IVL_LPM_MULT
|
||||
IVL_LPM_MUX IVL_LPM_POW IVL_LPM_SHIFTL IVL_LPM_SHIFTR IVL_LPM_SUB
|
||||
IVL_LPM_UFUNC */
|
||||
IVL_LPM_UFUNC IVL_LPM_SUBSTITUTE */
|
||||
extern ivl_nexus_t ivl_lpm_data(ivl_lpm_t net, unsigned idx);
|
||||
/* IVL_LPM_ADD IVL_LPM_MULT IVL_LPM_POW IVL_LPM_SUB */
|
||||
/* IVL_LPM_ADD IVL_LPM_MULT IVL_LPM_POW IVL_LPM_SUB IVL_LPM_CMP_EQ
|
||||
IVL_LPM_CMP_EEQ IVL_LPM_CMP_EQX IVL_LPM_CMP_EQZ IVL_LPM_CMP_NEE */
|
||||
extern ivl_nexus_t ivl_lpm_datab(ivl_lpm_t net, unsigned idx);
|
||||
/* IVL_LPM_ADD IVL_LPM_FF IVL_LPM_MULT IVL_LPM_PART IVL_LPM_POW
|
||||
IVL_LPM_SUB IVL_LPM_UFUNC */
|
||||
IVL_LPM_SUB IVL_LPM_UFUNC IVL_LPM_CMP_EEQ IVL_LPM_CMP_EQX
|
||||
IVL_LPM_CMP_EQZ IVL_LPM_CMP_NEE IVL_LPM_SUBSTITUTE */
|
||||
extern ivl_nexus_t ivl_lpm_q(ivl_lpm_t net);
|
||||
extern ivl_drive_t ivl_lpm_drive0(ivl_lpm_t net);
|
||||
extern ivl_drive_t ivl_lpm_drive1(ivl_lpm_t net);
|
||||
@@ -1397,12 +1459,11 @@ extern const char*ivl_lpm_string(ivl_lpm_t net);
|
||||
* for the local part selecting I might to in the lval object, as
|
||||
* well as the target object width.
|
||||
*
|
||||
* ivl_lval_mux
|
||||
* If the l-value includes a bit select expression, this method
|
||||
* returns an ivl_expr_t that represents that
|
||||
* expression. Otherwise, it returns 0.
|
||||
* ivl_lval_mux (* obsolete *)
|
||||
*
|
||||
* (Should this be combined with ivl_lval_idx? -Ed)
|
||||
* ivl_lval_nest
|
||||
* If the l-value is an object more complex than a variable, then
|
||||
* this returns the nested l-value (and ivl_lval_sig==0).
|
||||
*
|
||||
* ivl_lval_sig
|
||||
* If the l-value is a variable, this method returns the signal
|
||||
@@ -1419,6 +1480,11 @@ extern const char*ivl_lpm_string(ivl_lpm_t net);
|
||||
* ivl_expr_t that represents the index expression. Otherwise, it
|
||||
* returns 0.
|
||||
*
|
||||
* ivl_lval_property_idx
|
||||
* If the l-value is a class object, this is the name of a property
|
||||
* to select from the object. If this property is not present (<0)
|
||||
* then the l-value represents the class object itself.
|
||||
*
|
||||
* SEMANTIC NOTES
|
||||
* The ivl_lval_width is not necessarily the same as the width of the
|
||||
* signal or memory word it represents. It is the width of the vector
|
||||
@@ -1437,14 +1503,21 @@ extern const char*ivl_lpm_string(ivl_lpm_t net);
|
||||
* then the ivl_lval_idx expression must *not* be present.
|
||||
*
|
||||
* For array words, the ivl_lval_width is the width of the word.
|
||||
*
|
||||
* - Arrayed properties
|
||||
* If the l-value is a class property, then the ivl_lval_idx function
|
||||
* will return an expression if the property is in fact arrayed. The
|
||||
* expression is the canonical index for elements in the property.
|
||||
*/
|
||||
|
||||
extern unsigned ivl_lval_width(ivl_lval_t net);
|
||||
extern ivl_expr_t ivl_lval_mux(ivl_lval_t net); /* XXXX Obsolete? */
|
||||
extern ivl_expr_t ivl_lval_mux(ivl_lval_t net) __attribute__((deprecated)); /* XXXX Obsolete? */
|
||||
extern ivl_expr_t ivl_lval_idx(ivl_lval_t net);
|
||||
extern ivl_expr_t ivl_lval_part_off(ivl_lval_t net);
|
||||
extern ivl_select_type_t ivl_lval_sel_type(ivl_lval_t net);
|
||||
extern int ivl_lval_property_idx(ivl_lval_t net);
|
||||
extern ivl_signal_t ivl_lval_sig(ivl_lval_t net);
|
||||
extern ivl_lval_t ivl_lval_nest(ivl_lval_t net);
|
||||
|
||||
|
||||
/* NEXUS
|
||||
@@ -1566,6 +1639,22 @@ extern ivl_signal_t ivl_nexus_ptr_sig(ivl_nexus_ptr_t net);
|
||||
* Return the value of the parameter. This should be a simple
|
||||
* constant expression, an IVL_EX_STRING or IVL_EX_NUMBER.
|
||||
*
|
||||
* ivl_parameter_msb
|
||||
* ivl_parameter_lsb
|
||||
* Returns the MSB and LSB for the parameter. For a parameter without
|
||||
* a range the value is zero based and the width of the expression is
|
||||
* used to determine the MSB.
|
||||
*
|
||||
* ivl_parameter_width
|
||||
* return |MSB - LSB| + 1
|
||||
*
|
||||
* ivl_parameter_signed
|
||||
* Returns if the parameter was declared to be signed.
|
||||
*
|
||||
* ivl_parameter_local
|
||||
* Return whether parameter was local (localparam, implicit genvar etc)
|
||||
* or not.
|
||||
*
|
||||
* ivl_parameter_file
|
||||
* ivl_parameter_lineno
|
||||
* Returns the file and line where this parameter is defined
|
||||
@@ -1573,9 +1662,13 @@ extern ivl_signal_t ivl_nexus_ptr_sig(ivl_nexus_ptr_t net);
|
||||
extern const char* ivl_parameter_basename(ivl_parameter_t net);
|
||||
extern ivl_scope_t ivl_parameter_scope(ivl_parameter_t net);
|
||||
extern ivl_expr_t ivl_parameter_expr(ivl_parameter_t net);
|
||||
|
||||
extern int ivl_parameter_msb(ivl_parameter_t net);
|
||||
extern int ivl_parameter_lsb(ivl_parameter_t net);
|
||||
extern unsigned ivl_parameter_width(ivl_parameter_t net);
|
||||
extern int ivl_parameter_signed(ivl_parameter_t net);
|
||||
extern int ivl_parameter_local(ivl_parameter_t net);
|
||||
extern const char* ivl_parameter_file(ivl_parameter_t net);
|
||||
extern unsigned ivl_parameter_lineno(ivl_parameter_t net);
|
||||
extern unsigned ivl_parameter_lineno(ivl_parameter_t net);
|
||||
|
||||
|
||||
/* SCOPE
|
||||
@@ -1618,6 +1711,11 @@ extern unsigned ivl_parameter_lineno(ivl_parameter_t net);
|
||||
* If the scope has no children, this method will return 0 and
|
||||
* otherwise do nothing.
|
||||
*
|
||||
* ivl_scope_childs
|
||||
* ivl_scope_child
|
||||
* This is an alternative way of getting at the childs scopes of a
|
||||
* given scope.
|
||||
*
|
||||
* ivl_scope_def
|
||||
* Task definition scopes carry a task definition, in the form of
|
||||
* a statement. This method accesses that definition. The
|
||||
@@ -1719,6 +1817,10 @@ extern ivl_statement_t ivl_scope_def(ivl_scope_t net);
|
||||
extern const char* ivl_scope_def_file(ivl_scope_t net);
|
||||
extern unsigned ivl_scope_def_lineno(ivl_scope_t net);
|
||||
|
||||
extern size_t ivl_scope_childs(ivl_scope_t net);
|
||||
extern ivl_scope_t ivl_scope_child(ivl_scope_t net, size_t idx);
|
||||
extern unsigned ivl_scope_classes(ivl_scope_t net);
|
||||
extern ivl_type_t ivl_scope_class(ivl_scope_t net, unsigned idx);
|
||||
extern unsigned ivl_scope_enumerates(ivl_scope_t net);
|
||||
extern ivl_enumtype_t ivl_scope_enumerate(ivl_scope_t net, unsigned idx);
|
||||
extern unsigned ivl_scope_events(ivl_scope_t net);
|
||||
@@ -1736,6 +1838,12 @@ extern const char* ivl_scope_basename(ivl_scope_t net);
|
||||
extern unsigned ivl_scope_params(ivl_scope_t net);
|
||||
extern ivl_parameter_t ivl_scope_param(ivl_scope_t net, unsigned idx);
|
||||
extern ivl_scope_t ivl_scope_parent(ivl_scope_t net);
|
||||
|
||||
extern unsigned ivl_scope_mod_module_ports(ivl_scope_t net);
|
||||
extern const char *ivl_scope_mod_module_port_name(ivl_scope_t net, unsigned idx );
|
||||
extern ivl_signal_port_t ivl_scope_mod_module_port_type(ivl_scope_t net, unsigned idx );
|
||||
extern unsigned ivl_scope_mod_module_port_width(ivl_scope_t net, unsigned idx );
|
||||
|
||||
extern unsigned ivl_scope_ports(ivl_scope_t net);
|
||||
extern ivl_signal_t ivl_scope_port(ivl_scope_t net, unsigned idx);
|
||||
extern ivl_nexus_t ivl_scope_mod_port(ivl_scope_t net, unsigned idx);
|
||||
@@ -1785,13 +1893,23 @@ extern int ivl_scope_time_units(ivl_scope_t net);
|
||||
* If the signal has been declared with a domain (Verilog-AMS) then
|
||||
* this function will return a non-nil ivl_discipline_t.
|
||||
*
|
||||
* ivl_signal_msb
|
||||
* ivl_signal_lsb
|
||||
* ivl_signal_msb (deprecated)
|
||||
* ivl_signal_lsb (deprecated)
|
||||
* ivl_signal_packed_dimensions
|
||||
* ivl_signal_packed_msb
|
||||
* ivl_signal_packed_lsb
|
||||
* ivl_signal_width
|
||||
* These functions return the left and right indices, respectively,
|
||||
* of the signal. If the signal is a scalar, both return 0. However,
|
||||
* it doesn't mean that the signal is a scalar if both return 0, one
|
||||
* can have a vector with 0 as both indices.
|
||||
* These functions return the msb and lsb packed indices. The
|
||||
* packed dimensions are declared differently from array
|
||||
* dimensions, like so:
|
||||
* reg [4:1][7:0] sig...
|
||||
* which has two packed dimensions. The [4:1] dimension is the
|
||||
* first, and so forth. If the signal is a scalar, it has 0
|
||||
* dimension.
|
||||
*
|
||||
* The ivl_signal_msb/ivl_signal_lsb functions are deprecated
|
||||
* versions that only work with variables that have less than two
|
||||
* dimensions. They will return msb==lsb==0 for scalars.
|
||||
*
|
||||
* ivl_signal_port
|
||||
* If the signal is a port to a module, this function returns the
|
||||
@@ -1859,10 +1977,14 @@ extern unsigned ivl_signal_array_count(ivl_signal_t net);
|
||||
extern unsigned ivl_signal_array_addr_swapped(ivl_signal_t net);
|
||||
extern unsigned ivl_signal_dimensions(ivl_signal_t net);
|
||||
extern ivl_discipline_t ivl_signal_discipline(ivl_signal_t net);
|
||||
extern int ivl_signal_msb(ivl_signal_t net);
|
||||
extern int ivl_signal_lsb(ivl_signal_t net);
|
||||
extern unsigned ivl_signal_packed_dimensions(ivl_signal_t net);
|
||||
extern int ivl_signal_packed_msb(ivl_signal_t net, unsigned dim);
|
||||
extern int ivl_signal_packed_lsb(ivl_signal_t net, unsigned dim);
|
||||
extern int ivl_signal_msb(ivl_signal_t net) __attribute__((deprecated));
|
||||
extern int ivl_signal_lsb(ivl_signal_t net) __attribute__((deprecated));
|
||||
extern unsigned ivl_signal_width(ivl_signal_t net);
|
||||
extern ivl_signal_port_t ivl_signal_port(ivl_signal_t net);
|
||||
extern int ivl_signal_module_port_index(ivl_signal_t net);
|
||||
extern int ivl_signal_signed(ivl_signal_t net);
|
||||
extern int ivl_signal_integer(ivl_signal_t net);
|
||||
extern int ivl_signal_local(ivl_signal_t net);
|
||||
@@ -1871,6 +1993,7 @@ extern unsigned ivl_signal_npath(ivl_signal_t net);
|
||||
extern ivl_delaypath_t ivl_signal_path(ivl_signal_t net, unsigned idx);
|
||||
extern ivl_signal_type_t ivl_signal_type(ivl_signal_t net);
|
||||
extern ivl_variable_type_t ivl_signal_data_type(ivl_signal_t net);
|
||||
extern ivl_type_t ivl_signal_net_type(ivl_signal_t net);
|
||||
extern const char* ivl_signal_name(ivl_signal_t net);
|
||||
extern const char* ivl_signal_basename(ivl_signal_t net);
|
||||
extern const char* ivl_signal_attr(ivl_signal_t net, const char*key);
|
||||
@@ -1958,7 +2081,7 @@ extern unsigned ivl_stmt_lineno(ivl_statement_t net);
|
||||
* Statements that have event arguments (TRIGGER and WAIT) make
|
||||
* those event objects available through these methods.
|
||||
*
|
||||
* ivl_stmt_lval
|
||||
* ivl_stmt_lval
|
||||
* ivl_stmt_lvals
|
||||
* Return the number of l-values for an assignment statement, or
|
||||
* the specific l-value. If there is more than 1 l-value, then the
|
||||
@@ -1995,6 +2118,13 @@ extern unsigned ivl_stmt_lineno(ivl_statement_t net);
|
||||
* the statement.) The ivl_stmt_delay_expr function returns the
|
||||
* expression for the delay, or nil if there is no delay expression.
|
||||
*
|
||||
* The blocking assignment (IVL_ST_ASSIGN) may have an associated
|
||||
* opcode, that can be extracted from ivl_stmt_opcode(). This opcode
|
||||
* is the compressed operator used it statements like this:
|
||||
* foo += <expr>
|
||||
* The ivl_stmt_opcode() returns null (0) if this is not a compressed
|
||||
* assignment statement.
|
||||
*
|
||||
* - IVL_ST_CASSIGN
|
||||
* This reflects a procedural continuous assignment to an l-value. The
|
||||
* l-value is the same as any other assignment (use ivl_stmt_lval).
|
||||
@@ -2049,11 +2179,11 @@ extern unsigned ivl_stmt_lineno(ivl_statement_t net);
|
||||
* triggers. The statement waits even if the sub-statement is nul.
|
||||
*/
|
||||
|
||||
/* IVL_ST_BLOCK, IVL_ST_FORK */
|
||||
/* IVL_ST_BLOCK, IVL_ST_FORK, IVL_ST_FORK_JOIN_ANY, IVL_ST_FORK_JOIN_NONE */
|
||||
extern unsigned ivl_stmt_block_count(ivl_statement_t net);
|
||||
/* IVL_ST_BLOCK, IVL_ST_FORK */
|
||||
/* IVL_ST_BLOCK, IVL_ST_FORK, IVL_ST_FORK_JOIN_ANY, IVL_ST_FORK_JOIN_NONE */
|
||||
extern ivl_scope_t ivl_stmt_block_scope(ivl_statement_t net);
|
||||
/* IVL_ST_BLOCK, IVL_ST_FORK */
|
||||
/* IVL_ST_BLOCK, IVL_ST_FORK, IVL_ST_FORK_JOIN_ANY, IVL_ST_FORK_JOIN_NONE */
|
||||
extern ivl_statement_t ivl_stmt_block_stmt(ivl_statement_t net, unsigned i);
|
||||
/* IVL_ST_UTASK IVL_ST_DISABLE */
|
||||
extern ivl_scope_t ivl_stmt_call(ivl_statement_t net);
|
||||
@@ -2088,6 +2218,8 @@ extern unsigned ivl_stmt_lvals(ivl_statement_t net);
|
||||
extern unsigned ivl_stmt_lwidth(ivl_statement_t net);
|
||||
/* IVL_ST_STASK */
|
||||
extern const char* ivl_stmt_name(ivl_statement_t net);
|
||||
/* IVL_ST_ASSIGN */
|
||||
extern char ivl_stmt_opcode(ivl_statement_t net);
|
||||
/* IVL_ST_STASK */
|
||||
extern ivl_expr_t ivl_stmt_parm(ivl_statement_t net, unsigned idx);
|
||||
/* IVL_ST_STASK */
|
||||
@@ -2150,6 +2282,36 @@ extern ivl_attribute_t ivl_switch_attr_val(ivl_switch_t net, unsigned idx);
|
||||
extern const char* ivl_switch_file(ivl_switch_t net);
|
||||
extern unsigned ivl_switch_lineno(ivl_switch_t net);
|
||||
|
||||
/* TYPES
|
||||
*
|
||||
* ivl_type_base
|
||||
* This returns the base type for the type. See the
|
||||
* ivl_variable_type_t definition for the various base types.
|
||||
*
|
||||
* ivl_type_element
|
||||
* Return the type of the element of an array. This is only valid
|
||||
* for array types.
|
||||
*
|
||||
* ivl_type_signed
|
||||
* Return TRUE if the type represents a signed packed vector or
|
||||
* signed atomic type, and FALSE otherwise.
|
||||
*
|
||||
* SEMANTIC NOTES
|
||||
*
|
||||
* Class types have names and properties.
|
||||
*/
|
||||
extern ivl_variable_type_t ivl_type_base(ivl_type_t net);
|
||||
extern ivl_type_t ivl_type_element(ivl_type_t net);
|
||||
extern unsigned ivl_type_packed_dimensions(ivl_type_t net);
|
||||
extern int ivl_type_packed_lsb(ivl_type_t net, unsigned dim);
|
||||
extern int ivl_type_packed_msb(ivl_type_t net, unsigned dim);
|
||||
extern int ivl_type_signed(ivl_type_t net);
|
||||
extern const char* ivl_type_name(ivl_type_t net);
|
||||
extern int ivl_type_properties(ivl_type_t net);
|
||||
extern const char* ivl_type_prop_name(ivl_type_t net, int idx);
|
||||
extern ivl_type_t ivl_type_prop_type(ivl_type_t net, int idx);
|
||||
|
||||
|
||||
#if defined(__MINGW32__) || defined (__CYGWIN32__)
|
||||
# define DLLEXPORT __declspec(dllexport)
|
||||
#else
|
||||
@@ -2180,4 +2342,4 @@ typedef const char* (*target_query_f) (const char*key);
|
||||
|
||||
_END_DECL
|
||||
|
||||
#endif
|
||||
#endif /* IVL_ivl_target_H */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user