Posts

Showing posts from August, 2015

Simulation Behaviour of Associative Array with 64 Bit Index - QuestaSIM

Image
Hi All, This post is related to unexpected Simulation Behaviour with an Associative Array having 64 Bit Index in QuestaSIM. I had faced this problem and thought many others may have faced it also. So it is worth sharing the solution over here. NOTE :- This behaviour was observed in QuestaSIM 10.2. It may or may not be observed in the same or other versions of QuestaSIM. SAMPLE CODE :  Here is the sample code : typedef struct packed {   bit [7:0] data;   bit        valid; } dword_memory_st; ` define key 64 program p;   int loop_count;   int iteration; // Try with more than 8 to get the Errors ;)   dword_memory_st MEMORY[ bit [`key-1:0] ];   bit [`key-1:0] st = 'hffff_ffff_ffff_fffa;   bit [`key-1:0] ft = 'hffff_ffff_ffff_ffff;    bit [`key-1:0]  temp;    bit [`key:0]  max_memory_address = (1 << `key);    bit  bounded_address_used = 0;   initial   begin     void '( $value$plusargs ( "ITE=%d" , iteration));     $display