zermelo
Junior Member level 3
- Joined
- May 24, 2013
- Messages
- 25
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,543
Hi,
I have used MATLAB to generate a linear frequency modulated waveform, quantize it as signed 16 bit and write it into a . MIF file:
So I have a two . MIF files displaying this data . They look like:
These files are used to initialize two ROMS in a Cyclone III. I do not understand that when I simulate it Modelsim does only display the absolute value of the samples (I select decimal data radix). The VHDL that uses the ROMs is as easy as this:
Where all the ports in the ROM (generated with the Megawizard) are std_logic_vector and the output is signed. Can you see what's going on with this code?
zermelo
I have used MATLAB to generate a linear frequency modulated waveform, quantize it as signed 16 bit and write it into a . MIF file:
Code:
for i = 1:N
fprintf(fid_50,'%i : %i;\n',i-1,(Chirp50_n(i)));
fprintf(fid_200,'%i : %i;\n',i-1,(Chirp200_n(i)));
end
So I have a two . MIF files displaying this data . They look like:
Code:
WIDTH=16;
DEPTH=20000;
ADDRESS_RADIX=DEC;
DATA_RADIX=DEC;
CONTENT BEGIN
0 : 0;
1 : 9817;
2 : 18733;
3 : 25927;
4 : 30740;
5 : 32728;
6 : 31709;
7 : 27777;
8 : 21293;
9 : 12852;
10 : 3231;
11 : -6688;
12 : -15991;
13 : -23826;
14 : -29472;
15 : -32409;
(...)
These files are used to initialize two ROMS in a Cyclone III. I do not understand that when I simulate it Modelsim does only display the absolute value of the samples (I select decimal data radix). The VHDL that uses the ROMs is as easy as this:
Code:
U_ROM_50k: chirp_rom_50k
port map
( address => std_logic_vector(s_addr50k),
clken => s_50kclk_en_rom,
clock => i_clk,
q => s_chirp50k_std
);
o_chirp50k <= signed(s_chirp50k_std);
Where all the ports in the ROM (generated with the Megawizard) are std_logic_vector and the output is signed. Can you see what's going on with this code?
zermelo