You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was uncovered on the b-lang-discuss mailing list ("How to get fifo's runtime status in bluetcl?"). Bluesim has a "symbols" interface which allows probing values in the modules of a design.
For the FIFO primitives, they appear to provide access to three things: the array of values in the FIFO, a "depth", and a "level":
However, I think there's a bug in the implementation. I believe that depth is attempting to provide the configured depth of the FIFO (a constant value) and that level is the current number of elements (a dynamic value). What I observe is that depth returns the value of an invalid memory location! And level returns the static size. (The depth is defined as a pointer to a constructor argument, which is no longer a valid location after the constructor finishes.)
We can probably fix this by changing these two definitions in bsc/src/bluesim/bs_prim_mod_fifo.h (around line 73):
That is, depth should point to size (a local variable with constant value) and level should point to elems (a local variable that indicates the current number of elements).
Interactive mode is tested in bsc/testsuite/bsc.bluesim/interactive/ and there is a script prims.cmd for testing primitives, but it only tests that signals can be probed and not that they have the right dynamic values, so that would need to be added.
The text was updated successfully, but these errors were encountered:
This issue was uncovered on the
b-lang-discuss
mailing list ("How to get fifo's runtime status in bluetcl?"). Bluesim has a "symbols" interface which allows probing values in the modules of a design.For the FIFO primitives, they appear to provide access to three things: the array of values in the FIFO, a "depth", and a "level":
However, I think there's a bug in the implementation. I believe that
depth
is attempting to provide the configured depth of the FIFO (a constant value) and thatlevel
is the current number of elements (a dynamic value). What I observe is thatdepth
returns the value of an invalid memory location! Andlevel
returns the static size. (Thedepth
is defined as a pointer to a constructor argument, which is no longer a valid location after the constructor finishes.)We can probably fix this by changing these two definitions in
bsc/src/bluesim/bs_prim_mod_fifo.h
(around line 73):to instead be:
That is,
depth
should point tosize
(a local variable with constant value) andlevel
should point toelems
(a local variable that indicates the current number of elements).Interactive mode is tested in
bsc/testsuite/bsc.bluesim/interactive/
and there is a scriptprims.cmd
for testing primitives, but it only tests that signals can be probed and not that they have the right dynamic values, so that would need to be added.The text was updated successfully, but these errors were encountered: