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
I have a signal that is an array of arrays, where the first level is indexed by an enumerated type:
type reg_e is (
I2CCFG,
I2CCON,
I2CDR,
-- ...and so on
);
type read_port_t isarray(reg_e range reg_e'highdownto reg_e'low) ofstd_ulogic_vector(apb_prdata_o'range);
signal read_port : read_port_t;
This signal is connected to the output of the block (which is an APB completer) through a pipelined mux tree block:
Here, address_as_select is a function that boils down to a case statement that translates the APB PADDR signal into a reg_e value, and the function read_port_to_slm2 is a trivial copy to a similarly-shaped type we use common across our IP cores:
Arranged like this, in simulation with nvc, the output on apb_prdata_o is constant at a partially don't-care, partially undefined value. The way the block is defined, whether or not an APB read is ongoing, the apb_prdata_o signal has the value of the currently-addressed register on it, so it should not remain constant. Here is a waveform showing this behaviour (five APB writes followed by an APB read):
I initially thought this might be an issue with the pipelined mux tree. The first two APB writes set up a strobe generator, and the two strobes_g rows near the bottom of the image come from that strobe generator through another instantiation of the same mux tree component. As these work fine, it suggests that the mux tree is not the issue.
I thought from there it might be an issue with using an enumerated type as an index, so I changed the definition of read_port so that it used a to range instead of a downto to see if it made a difference:
type read_port_t isarray(reg_e range reg_e'leftto reg_e'right) ofstd_ulogic_vector(apb_prdata_o'range);
(I also changed read_port_to_slm2 to use to ordering as well)
While this didn't solve the issue, it did change the observed behaviour—the constant-but-wrong output on apb_prdata_o is now different:
To me, this suggests it's something with how nvc is handling the read_port_t type.
The text was updated successfully, but these errors were encountered:
I'm using nvc 1.14.2.
I have a signal that is an array of arrays, where the first level is indexed by an enumerated type:
This signal is connected to the output of the block (which is an APB completer) through a pipelined mux tree block:
Here,
address_as_select
is a function that boils down to acase
statement that translates the APB PADDR signal into areg_e
value, and the functionread_port_to_slm2
is a trivial copy to a similarly-shaped type we use common across our IP cores:Arranged like this, in simulation with nvc, the output on
apb_prdata_o
is constant at a partially don't-care, partially undefined value. The way the block is defined, whether or not an APB read is ongoing, theapb_prdata_o
signal has the value of the currently-addressed register on it, so it should not remain constant. Here is a waveform showing this behaviour (five APB writes followed by an APB read):I initially thought this might be an issue with the pipelined mux tree. The first two APB writes set up a strobe generator, and the two
strobes_g
rows near the bottom of the image come from that strobe generator through another instantiation of the same mux tree component. As these work fine, it suggests that the mux tree is not the issue.I thought from there it might be an issue with using an enumerated type as an index, so I changed the definition of
read_port
so that it used ato
range instead of adownto
to see if it made a difference:(I also changed
read_port_to_slm2
to useto
ordering as well)While this didn't solve the issue, it did change the observed behaviour—the constant-but-wrong output on
apb_prdata_o
is now different:To me, this suggests it's something with how nvc is handling the
read_port_t
type.The text was updated successfully, but these errors were encountered: