Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions svsim/src/main/scala/Workspace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ final class Workspace(
}
l(");")
l()
l(" import \"DPI-C\" context function void initTestBenchScope;")
l(" import \"DPI-C\" context function void initTestBenchScope();")
l(" initial")
l(" initTestBenchScope();")
for ((port, index) <- ports) {
Expand Down Expand Up @@ -243,9 +243,14 @@ final class Workspace(
l()
l("extern \"C\" {")
l(" svScope setScopeToTestBench();")
for ((port, index) <- ports.filter(_._1.isGettable)) {
l(CreateFunctionForPort.createGetBits(port.name))
for ((port, index) <- ports) {
l(CreateFunctionForPort.createGetBitWidth(port.name))
if (port.isGettable) {
l(CreateFunctionForPort.createGetBits(port.name))
}
if (port.isSettable) {
l(CreateFunctionForPort.createSetBits(port.name))
}
}
l()
l("int port_getter(int id, int *bitWidth, void (**getter)(uint8_t*)) {")
Expand All @@ -261,10 +266,6 @@ final class Workspace(
l(" }")
l("}")
l()
for ((port, index) <- ports.filter(_._1.isSettable)) {
l(CreateFunctionForPort.createSetBits(port.name))
}
l()
l("int port_setter(int id, int *bitWidth, void (**setter)(const uint8_t*)) {")
l(" switch (id) {")
for ((port, index) <- ports.filter(_._1.isSettable)) {
Expand Down