Liebe Kollegen!
Ich möchte mein Eingangssignal in eine Datei schreiben. Das Signal ist
unsigned. Lieder funktioniert das schreiben in die Datei nur wenn ich es
als signed deklariere (zumindest bekomme ich es anders nicht hin).
Warum habe ich bei meiner Version immer noch ein - in der Liste? das
dürfte ja gar nicht sein!?
HELP!!!
1 | COMPONENT Top
|
2 | PORT( clk : IN STD_LOGIC;
|
3 | in_data : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
|
4 | Reset : IN STD_LOGIC;
|
5 | out0 : OUT STD_LOGIC_VECTOR (15 DOWNTO 0);
|
6 | out1 : OUT STD_LOGIC_VECTOR (15 DOWNTO 0));
|
7 | END COMPONENT;
|
8 |
|
9 | SIGNAL clk : STD_LOGIC:= '1';
|
10 | SIGNAL in_data : STD_LOGIC_VECTOR (31 DOWNTO 0);
|
11 | SIGNAL Reset : STD_LOGIC := '1';
|
12 | SIGNAL out0 : STD_LOGIC_VECTOR (15 DOWNTO 0);
|
13 | SIGNAL out1 : STD_LOGIC_VECTOR (15 DOWNTO 0);
|
14 | signal s_indata : STD_LOGIC_VECTOR (32 DOWNTO 0);
|
15 |
|
16 | -- ...
|
17 |
|
18 | wr3 : process(clk, in_data)
|
19 | FILE out_file3 : TEXT OPEN WRITE_MODE IS "in_values";
|
20 | VARIABLE out_line3 : LINE;
|
21 | FILE in_file3 : TEXT OPEN WRITE_MODE IS "in_values";
|
22 | VARIABLE in_line3 : LINE;
|
23 |
|
24 | begin
|
25 | if in_data'event then
|
26 | s_indata <= '0' & in_data(31 downto 0);
|
27 | WRITE(out_line3, to_integer(signed(s_indata))); --save results to line
|
28 | WRITELINE(out_file3, out_line3); --write line to file
|
29 | end if;
|
30 | end process;
|
In der Simulation habe ich das Singal in_values (unsigned) mit
s_invalues (signed) verglichen. Die sind genau gleich.
aus der Datei
1486016274
-1259154504
306242820
1131788658
1523992030
-243879802
1393545054
30418740
1610678780
2116269664
1470011646
DANKE
Sandy