@@ -113,7 +113,7 @@ final class Workspace(
113
113
}
114
114
l(" );" )
115
115
l()
116
- l(" import \" DPI-C\" context function void initTestBenchScope;" )
116
+ l(" import \" DPI-C\" context function void initTestBenchScope() ;" )
117
117
l(" initial" )
118
118
l(" initTestBenchScope();" )
119
119
for ((port, index) <- ports) {
@@ -243,9 +243,14 @@ final class Workspace(
243
243
l()
244
244
l(" extern \" C\" {" )
245
245
l(" svScope setScopeToTestBench();" )
246
- for ((port, index) <- ports.filter(_._1.isGettable)) {
247
- l(CreateFunctionForPort .createGetBits(port.name))
246
+ for ((port, index) <- ports) {
248
247
l(CreateFunctionForPort .createGetBitWidth(port.name))
248
+ if (port.isGettable) {
249
+ l(CreateFunctionForPort .createGetBits(port.name))
250
+ }
251
+ if (port.isSettable) {
252
+ l(CreateFunctionForPort .createSetBits(port.name))
253
+ }
249
254
}
250
255
l()
251
256
l(" int port_getter(int id, int *bitWidth, void (**getter)(uint8_t*)) {" )
@@ -261,10 +266,6 @@ final class Workspace(
261
266
l(" }" )
262
267
l(" }" )
263
268
l()
264
- for ((port, index) <- ports.filter(_._1.isSettable)) {
265
- l(CreateFunctionForPort .createSetBits(port.name))
266
- }
267
- l()
268
269
l(" int port_setter(int id, int *bitWidth, void (**setter)(const uint8_t*)) {" )
269
270
l(" switch (id) {" )
270
271
for ((port, index) <- ports.filter(_._1.isSettable)) {
0 commit comments