@@ -0,0 +1,53 | |||||
|
1 | LIBRARY ieee; | |||
|
2 | USE ieee.std_logic_1164.ALL; | |||
|
3 | USE ieee.numeric_std.ALL; | |||
|
4 | ||||
|
5 | LIBRARY std; | |||
|
6 | USE std.textio.ALL; | |||
|
7 | ||||
|
8 | LIBRARY lpp; | |||
|
9 | USE lpp.data_type_pkg.ALL; | |||
|
10 | ||||
|
11 | ENTITY sig_reader IS | |||
|
12 | GENERIC( | |||
|
13 | FNAME : STRING := "input.txt"; | |||
|
14 | WIDTH : INTEGER := 1; | |||
|
15 | RESOLUTION : INTEGER := 8; | |||
|
16 | GAIN : REAL := 1.0 | |||
|
17 | ); | |||
|
18 | PORT( | |||
|
19 | clk : IN std_logic; | |||
|
20 | end_of_simu : out std_logic; | |||
|
21 | out_signal : out sample_vector(0 to WIDTH-1,RESOLUTION-1 downto 0) | |||
|
22 | ); | |||
|
23 | END sig_reader; | |||
|
24 | ||||
|
25 | ARCHITECTURE beh OF sig_reader IS | |||
|
26 | FILE input_file : TEXT OPEN read_mode IS FNAME; | |||
|
27 | SIGNAL out_signal_reg : sample_vector(0 to WIDTH-1,RESOLUTION-1 downto 0):=(others=>(others=>'0')); | |||
|
28 | SIGNAL end_of_simu_reg : std_logic:='0'; | |||
|
29 | BEGIN | |||
|
30 | out_signal <= out_signal_reg; | |||
|
31 | end_of_simu <= end_of_simu_reg; | |||
|
32 | PROCESS | |||
|
33 | VARIABLE line_var : LINE; | |||
|
34 | VARIABLE value : INTEGER; | |||
|
35 | VARIABLE cell : STD_LOGIC_VECTOR(RESOLUTION-1 downto 0); | |||
|
36 | BEGIN | |||
|
37 | WAIT UNTIL clk = '1'; | |||
|
38 | IF endfile(input_file) THEN | |||
|
39 | end_of_simu_reg <= '1'; | |||
|
40 | ELSE | |||
|
41 | end_of_simu_reg <= '0'; | |||
|
42 | readline(input_file,line_var); | |||
|
43 | FOR COL IN 0 TO WIDTH-1 LOOP | |||
|
44 | read(line_var, value); | |||
|
45 | cell := std_logic_vector(to_signed(INTEGER(GAIN*REAL(value)) , RESOLUTION)); | |||
|
46 | FOR bit_idx IN RESOLUTION-1 downto 0 LOOP | |||
|
47 | out_signal_reg(COL,bit_idx) <= cell(bit_idx); | |||
|
48 | END LOOP; | |||
|
49 | END LOOP; | |||
|
50 | END IF; | |||
|
51 | END PROCESS; | |||
|
52 | ||||
|
53 | END beh; |
@@ -12,8 +12,8 EFFORT=high | |||||
12 | XSTOPT= |
|
12 | XSTOPT= | |
13 | SYNPOPT="set_option -pipe 0; set_option -retiming 0; set_option -write_apr_constraint 0" |
|
13 | SYNPOPT="set_option -pipe 0; set_option -retiming 0; set_option -write_apr_constraint 0" | |
14 | #VHDLSYNFILES=config.vhd ahbrom.vhd leon3mp.vhd |
|
14 | #VHDLSYNFILES=config.vhd ahbrom.vhd leon3mp.vhd | |
15 |
VHDLSYNFILES= IIR_CEL_TEST.vhd tb.vhd IIR_CEL_TEST_v3.vhd generator.vhd |
|
15 | VHDLSYNFILES= IIR_CEL_TEST.vhd tb.vhd IIR_CEL_TEST_v3.vhd generator.vhd | |
16 |
VHDLSIMFILES= tb.vhd |
|
16 | VHDLSIMFILES= tb.vhd | |
17 | SIMTOP=testbench |
|
17 | SIMTOP=testbench | |
18 | #SDCFILE=$(GRLIB)/boards/$(BOARD)/synplify.sdc |
|
18 | #SDCFILE=$(GRLIB)/boards/$(BOARD)/synplify.sdc | |
19 | PDC=$(VHDLIB)/boards/$(BOARD)/LFR_EQM_RTAX.pdc |
|
19 | PDC=$(VHDLIB)/boards/$(BOARD)/LFR_EQM_RTAX.pdc | |
@@ -35,7 +35,6 DIRSKIP = b1553 pcif leon2 leon3v3 leon2 | |||||
35 | ./general_purpose/lpp_delay \ |
|
35 | ./general_purpose/lpp_delay \ | |
36 | ./lpp_bootloader \ |
|
36 | ./lpp_bootloader \ | |
37 | ./lfr_management \ |
|
37 | ./lfr_management \ | |
38 | ./lpp_sim \ |
|
|||
39 | ./lpp_sim/CY7C1061DV33 \ |
|
38 | ./lpp_sim/CY7C1061DV33 \ | |
40 | ./lpp_cna \ |
|
39 | ./lpp_cna \ | |
41 | ./lpp_uart \ |
|
40 | ./lpp_uart \ | |
@@ -52,7 +51,8 FILESKIP = i2cmst.vhd \ | |||||
52 | lpp_lfr_ms_FFT.vhd \ |
|
51 | lpp_lfr_ms_FFT.vhd \ | |
53 | lpp_lfr_apbreg.vhd \ |
|
52 | lpp_lfr_apbreg.vhd \ | |
54 | CoreFFT.vhd \ |
|
53 | CoreFFT.vhd \ | |
55 | lpp_lfr_ms.vhd |
|
54 | lpp_lfr_ms.vhd \ | |
|
55 | lpp_lfr_sim_pkg.vhd | |||
56 |
|
56 | |||
57 | include $(GRLIB)/bin/Makefile |
|
57 | include $(GRLIB)/bin/Makefile | |
58 | include $(GRLIB)/software/leon3/Makefile |
|
58 | include $(GRLIB)/software/leon3/Makefile |
@@ -20,6 +20,7 USE lpp.general_purpose.ALL; | |||||
20 | USE lpp.data_type_pkg.ALL; |
|
20 | USE lpp.data_type_pkg.ALL; | |
21 | USE lpp.lpp_lfr_pkg.ALL; |
|
21 | USE lpp.lpp_lfr_pkg.ALL; | |
22 | USE lpp.general_purpose.ALL; |
|
22 | USE lpp.general_purpose.ALL; | |
|
23 | USE lpp.lpp_sim_pkg.ALL; | |||
23 |
|
24 | |||
24 | ENTITY testbench IS |
|
25 | ENTITY testbench IS | |
25 | GENERIC( |
|
26 | GENERIC( | |
@@ -75,19 +76,19 ARCHITECTURE behav OF testbench IS | |||||
75 | ); |
|
76 | ); | |
76 | END COMPONENT; |
|
77 | END COMPONENT; | |
77 |
|
78 | |||
78 | COMPONENT sig_reader IS |
|
79 | -- COMPONENT sig_reader IS | |
79 | GENERIC( |
|
80 | -- GENERIC( | |
80 |
|
|
81 | -- FNAME : STRING := "input.txt"; | |
81 | WIDTH : INTEGER := 1; |
|
82 | -- WIDTH : INTEGER := 1; | |
82 |
|
|
83 | -- RESOLUTION : INTEGER := 8; | |
83 | GAIN : REAL := 1.0 |
|
84 | -- GAIN : REAL := 1.0 | |
84 | ); |
|
85 | -- ); | |
85 | PORT( |
|
86 | -- PORT( | |
86 | clk : IN std_logic; |
|
87 | -- clk : IN std_logic; | |
87 | end_of_simu : out std_logic; |
|
88 | -- end_of_simu : out std_logic; | |
88 | out_signal : out sample_vector(0 to WIDTH-1,RESOLUTION-1 downto 0) |
|
89 | -- out_signal : out sample_vector(0 to WIDTH-1,RESOLUTION-1 downto 0) | |
89 | ); |
|
90 | -- ); | |
90 | END COMPONENT; |
|
91 | -- END COMPONENT; | |
91 |
|
92 | |||
92 |
|
93 | |||
93 | FILE input : TEXT OPEN read_mode IS "input.txt"; |
|
94 | FILE input : TEXT OPEN read_mode IS "input.txt"; |
@@ -32,6 +32,9 USE gaisler.jtagtst.ALL; | |||||
32 | LIBRARY techmap; |
|
32 | LIBRARY techmap; | |
33 | USE techmap.gencomp.ALL; |
|
33 | USE techmap.gencomp.ALL; | |
34 |
|
34 | |||
|
35 | LIBRARY lpp; | |||
|
36 | USE lpp.data_type_pkg.ALL; | |||
|
37 | ||||
35 | PACKAGE lpp_sim_pkg IS |
|
38 | PACKAGE lpp_sim_pkg IS | |
36 |
|
39 | |||
37 | PROCEDURE UART_INIT ( |
|
40 | PROCEDURE UART_INIT ( | |
@@ -58,7 +61,19 PACKAGE lpp_sim_pkg IS | |||||
58 | DATA : OUT STD_LOGIC_VECTOR |
|
61 | DATA : OUT STD_LOGIC_VECTOR | |
59 | ); |
|
62 | ); | |
60 |
|
63 | |||
61 |
|
64 | COMPONENT sig_reader IS | ||
|
65 | GENERIC( | |||
|
66 | FNAME : STRING := "input.txt"; | |||
|
67 | WIDTH : INTEGER := 1; | |||
|
68 | RESOLUTION : INTEGER := 8; | |||
|
69 | GAIN : REAL := 1.0 | |||
|
70 | ); | |||
|
71 | PORT( | |||
|
72 | clk : IN std_logic; | |||
|
73 | end_of_simu : out std_logic; | |||
|
74 | out_signal : out sample_vector(0 to WIDTH-1,RESOLUTION-1 downto 0) | |||
|
75 | ); | |||
|
76 | END COMPONENT; | |||
62 | END lpp_sim_pkg; |
|
77 | END lpp_sim_pkg; | |
63 |
|
78 | |||
64 | PACKAGE BODY lpp_sim_pkg IS |
|
79 | PACKAGE BODY lpp_sim_pkg IS |
@@ -1,3 +1,3 | |||||
|
1 | sig_reader.vhd | |||
1 | lpp_sim_pkg.vhd |
|
2 | lpp_sim_pkg.vhd | |
2 | lpp_lfr_sim_pkg.vhd |
|
3 | lpp_lfr_sim_pkg.vhd | |
3 |
|
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now