cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
markus.offergeld
Explorer
Explorer
611 Views
Registered: ‎02-28-2011

Bug: Inconsistency between Simulation and Code Generation

Hi,

I have just found a bug which causes inconsinstency between simualtion and code generation in System Generator 2019.1/Matlab 2018b:

I have a register which has a UFIX_32_0 input with enable and reset inputs.
Initial value is set to 2^32.

- In simualtion the register initializes to 2^32 - 1 and in this case and simulation works correctly as expected.
- In the generated code the register value becomes 0 instead and the final design doesnt work in hardware.

I am aware that the intial value of 2^32 is out of range of the UFIX_32_0 signal.
It should either raise a warning/error or saturate to the highest possible value 2^32 - 1 like it correctly does in the constant blocks.

Regards Markus

 

 

 

3 Replies
meherp
Moderator
Moderator
588 Views
Registered: ‎08-16-2018

Hi @markus.offergeld 

Is it possible to share a small testcase to reproduce this issue. 


/ 7\7     Meher Krishna Patel, PhD
\ \        Senior Product Application Engineer, Xilinx
/ /        
\_\/\7   It is not so much that you are within the cosmos as that the cosmos is within you...
0 Kudos
markus.offergeld
Explorer
Explorer
544 Views
Registered: ‎02-28-2011

Hi meherp,

I have attached a small model for it.

both the constant and the register initial values are set to 2^32 in this example.

generated code for constant (ContMax):

- assign op = 32'b11111111111111111111111111111111;

generated code for register (RegMax):

.init_value(32'b00000000000000000000000000000000)

In simulation the register output is 2^31-1 permanently. In hardware it is 0 for the first 101 cycles before it becomes 2^31-1

Regards Markus

meherp
Moderator
Moderator
532 Views
Registered: ‎08-16-2018

I verified it as bug.

We are checking for a fix.

Thanks for reporting it.  


/ 7\7     Meher Krishna Patel, PhD
\ \        Senior Product Application Engineer, Xilinx
/ /        
\_\/\7   It is not so much that you are within the cosmos as that the cosmos is within you...
Tags (1)