Altera_Forum
Honored Contributor
18 years agoHow to initial onchip_memory in modelsim post-simulation?
Hi all,
I known how to Pre-Simulating NiosII System with modelsim tool. Now, I am tring to do Post-Simulation for NiosII System in modelsim. I have completed the following steps: 1. set EDA tools option in QuartusII and select Modelsim-Altera 2. After full compilation for QuartusII project, modelsim ran automatically and load *.vho and all the library associated with the QuartusII project. 3. In modelsim's workspace window library TAB, I select the top-level entity to simulate 4. after simulation starting, I try to observe content of onchip_memory (note:my 64KB onchip_memory has been devided into 128 M4K modules, the following show you the first M4K declaration in *.vho), ram_block1a0 : cycloneii_ram_block -- pragma translate_off GENERIC MAP ( mem_init1 => X"5307BBFFA37BFB1BDFD8CD8CD8D41F8C63EC6FCCBCCBF9999965FEEFD8F73FFFE9CCBFA38C7 7FD8EDADBFFD1EE7FFFD3997F4718EFFB1BFB1BFB1F4D4C3530E492124D991D1D1D1D3A6749BE61A 6749BE61A1285BDFE8EE7CE5D7D1DCF9CBAFA3BF77DF3E72E5D7BE8F2963D086A8DF9C67A94F63D4 BB630D8F7BD3871F5468D1B80458AAE6FA3000000C6FF7697ADDDABD671327A3747BB1EE7EC794B1 E0CD8F2963C19B1E52C7FFFFEA0CEC7D0000C0600C060000003530610887E500080203F800240000 F945002DDA0E3B5006C4E70CF05C921820E460433000F81002539009000A002808016A024B000005 1000001520016E80200A5F08010000A03FF0C", mem_init0 => X"14000106B47FF1E3C0087CA60C8A4F8002814A4148B6C83000008314400125419BE514002C4 00A0900882BB91CE008401088000203B500049305084400007329007FE01FF810806020609818001 2980A830804080000000000004000000D062042029230000849860C2211C6300183032E48CB92C66 C60018BFEA8C000060D09CD8A3474606C791179AF35E6B63000628A28D434D8D4CD8D536300618E8 BD14791179EEE36B3AE971B59D75D8D536396BD6BA3AA9B198F2B272E564E5628DB1D633198D05B1 8E0E7CCFE0CDC6ED2F5D1BB57AE8FCB928EA5972763CBFCFB1E5FE7D8E1F8FB1A0B1C1C41C70638B FF5466C00C7E5A71083BF31FFFDD817FDFE00", data_interleave_offset_in_bits => 1, data_interleave_width_in_bits => 1, init_file => "onchip_mem.hex", init_file_layout => "port_a", logical_ram_name => "FreqMeasure_NiosII:inst|onchip_mem:the_onchip_mem|altsyncram:the_altsyncram |altsyncram_mmb1:auto_generated|ALTSYNCRAM", operation_mode => "single_port", port_a_address_clear => "none", port_a_address_width => 12, port_a_byte_enable_clear => "none", port_a_byte_enable_mask_width => 1, port_a_byte_size => 1, port_a_data_in_clear => "none", port_a_data_out_clear => "none", port_a_data_out_clock => "none", port_a_data_width => 1, port_a_first_address => 0, port_a_first_bit_number => 0, port_a_last_address => 4095, port_a_logical_ram_depth => 16384, port_a_logical_ram_width => 32, port_a_write_enable_clear => "none", port_b_address_width => 12, port_b_data_width => 1, ram_block_type => "M4K", safe_write => "err_on_2clk") and I observe content of the first M4K module, but it's value didn't equal to the content of 'onchip_memory.hex' , it equal to mem_init0 => X"14000106B47FF1E3C0087CA60C8A4F8002814A4148B6C83000008314400125419BE514002C4 00A0900882BB91CE008401088000203B500049305084400007329007FE01FF810806020609818001 2980A830804080000000000004000000D062042029230000849860C2211C6300183032E48CB92C66 C60018BFEA8C000060D09CD8A3474606C791179AF35E6B63000628A28D434D8D4CD8D536300618E8 BD14791179EEE36B3AE971B59D75D8D536396BD6BA3AA9B198F2B272E564E5628DB1D633198D05B1 8E0E7CCFE0CDC6ED2F5D1BB57AE8FCB928EA5972763CBFCFB1E5FE7D8E1F8FB1A0B1C1C41C70638B FF5466C00C7E5A71083BF31FFFDD817FDFE00", Anybody teach me how to initial the onchip_memory with the 'onchip_memory.hex' created by NiosII IDE? Thanks in advance...