Forum Discussion
Altera_Forum
Honored Contributor
9 years agoWhy progrmmer is failed when using integer type
Hello, i had some code in my quartus project which read data from nios depend on writedata. So, programmer is always faild at 87% or 88%. But when i change all integer types to reg (reg popFlag, reg ...
Altera_Forum
Honored Contributor
9 years agoThe programmer fails or do you mean the compiler fails when compiling the design?
Is there a reason why you need to use integer (a signed 32-bit variable data type)? reg is more efficient because it only uses as many bits as needed, assuming you specify bit widths (8'h1 for 0x01 for example). You should be initializing these values in the always block with some type of reset signal (instead of initializing them up top) and using non-blocking assignments (<=) instead of blocking assignments (=) if your intent to create clocked registers, which is what this looks like. And is "randonValue" intentional or is that a typo (randomValue)?