Hardware implemented

This commit is contained in:
golowatschjowde89891 committed 2026-11-23 11:24:43 +01:00
1 parent 518bc0e975
commit d1942b24ce
71 files changed
+3819 -36

No files matched your search

+41 -36
View File
@@ -29,23 +29,26 @@ architecture rtl of add is
-- TODO: fertig? Zustandsautomat und Signale fuer Addierer
type AddState is (
ADD_IDLE,
ADD-READ-FIFO,
ADD_READ_FIFO,
ADD_CALC,
ADD_STORE_RESULT
);
-- Es soll Signal current add state des oben angelegten Types AddState deklariert werden
Signal current_add_state : AddState;
-- Es soll Signal next add state des oben angelegten Types AddState deklariert werden
signal next_add_state : AddState;
-- TODO: ergänzung von run_calc zur init von AddState, in uebung von übergeordnet übergeben
Signal run_calc: std_logic;
-- Es soll Signal start_calc als std_logic angelegt werden
Signal start_calc : std_logic;
-- Es soll Signal done als std_logic angelegt werden
Signal done : std_logic;
-- Es soll Signal calc_cnt_int als Integer mit Bereich 0 bis 15 angelegt werden
signal calc_cnt_int: integer range 0 to 15;
-- Legen Sie ein signal result sum als std logic vector mit Laenge 32 Bit an
signal result_sum c: std_logic_vector(31 downto 0);
signal result_sum: std_logic_vector(31 downto 0);
signal current_task_state : work.task.State;
signal next_task_state : work.task.State;
@@ -68,19 +71,19 @@ begin
add_state_transitions : process ( all ) is
begin
next_add_state <= current_add_state ;
case current_add_state is
when ADD-IDLE =>
if (run_calc = T1 T) then
next_add_state <= ADD_READ_FIFO ;
end if;
when ADD_READ_FIFO =>
next_add_state <= ADD_CALC;
when A D D C A L C =>
if ( done = T1 1 ) then
next_add_state <= ADD_STORE_RESULT;
end if;
when ADD_STORE_RESULT =>
next—add—state <= ADD_IDLE;
case current_add_state is
when ADD_IDLE =>
if (run_calc = '1') then
next_add_state <= ADD_READ_FIFO ;
end if;
when ADD_READ_FIFO =>
next_add_state <= ADD_CALC;
when ADD_CALC =>
if ( done = '1') then
next_add_state <= ADD_STORE_RESULT;
end if;
when ADD_STORE_RESULT =>
next_add_state <= ADD_IDLE;
end case;
end process add_state_transitions;
@@ -115,18 +118,20 @@ begin
case next_task_state is
when work.task.TASK_IDLE =>
index <= 0;
signal_write <= '0';
--signal_write <= '0';
when work.task.TASK_RUNNING =>
-- here: start von calc?
next_add_state <= ADD_READ_FIFO;
run_calc <= '1';
index <= index + 1;
signal_write <= '1';
signal_writedata <= ( others => '0' );
if (next_add_state = ADD_STORE_RESULT) then
index <= index + 1;
end if;
--signal_write <= '1';
--signal_writedata <= ( others => '0' );
when work.task.TASK_DONE =>
index <= 0;
signal_write <= '0';
--signal_write <= '0';
end case;
end if;
end process sync;
@@ -139,29 +144,29 @@ begin
signal_a_read <= '0';
signal_b_read <= '0';
signal_write <= '0';
signal_writedata <= (others => '0')
signal_writedata <= (others => '0');
calc_cnt_int <= 0;
start_calc <= '0';
elsif ( rising_edge( clk ) ) then
current_add_state <= next_add_state; -- Zustandspeicher es wird dem aktuellen Zustand der zukuenftige Zustand zugewiesen
signal_a_read <= '0'; -- Steuersignal zum Lesen von FIFO A default null
signal_b_read <= '0'; -- Steuersignal zum Lesen von FIFO B default null
signal_write <= '0'; — Steuersignal zum Schreiben vom Ausgangsfifo default null
signal_write <= '0'; -- Steuersignal zum Schreiben vom Ausgangsfifo default null
start_calc <= '0'; -- Steuersignal start_calc default null
case next_add_state is
when ADD_IDLE => null; -- null Anweisung "macht nichts" und ist hier nur zur Übersichtlichkeit
when ADD_READ_FIFO =>
signal_a_read <= '1'; -- Steuersignal zum Lesen von FIFO A eins um Daten aus den FIFO zu lesen im naechsten Takt
signal_b_read <= '1'; -- Steuersignal zum Lesen von FIFO B eins um Daten aus den FIFO zu lesen im naechsten Takt
when ADD—CALC =>
start_calc <= '1'; -- starten der Berechnung durch aktiv setzen von start_calc
when ADD_STORE_RESULT =>
signal_write <= '1' ; -- Steuersignal zum Schreiben vom Ausgangsfifo
signal_writedata <= result_sum; -- letztes Additonsergebnis welches in den Ausgangsfifo geschrieben werden soll
calc_ent_int <= calc_cnt_int + 1 ; -- Zaehler calc_cnt_int um eins inkrementieren
when ADD_IDLE => null; -- null Anweisung "macht nichts" und ist hier nur zur Übersichtlichkeit
when ADD_READ_FIFO =>
signal_a_read <= '1'; -- Steuersignal zum Lesen von FIFO A eins um Daten aus den FIFO zu lesen im naechsten Takt
signal_b_read <= '1'; -- Steuersignal zum Lesen von FIFO B eins um Daten aus den FIFO zu lesen im naechsten Takt
when ADD_CALC =>
start_calc <= '1'; -- starten der Berechnung durch aktiv setzen von start_calc
when ADD_STORE_RESULT =>
signal_write <= '1' ; -- Steuersignal zum Schreiben vom Ausgangsfifo
signal_writedata <= result_sum; -- letztes Additonsergebnis welches in den Ausgangsfifo geschrieben werden soll
calc_cnt_int <= calc_cnt_int + 1; -- Zaehler calc_cnt_int um eins inkrementieren
end case;
end if;
end process sync;
end if;
end process addproc;
Whitespace-only changes.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,68 @@
# // Questa Sim-64
# // Version 2023.2 linux_x86_64 Apr 11 2023
# //
# // Copyright 1991-2023 Mentor Graphics Corporation
# // All Rights Reserved.
# //
# // QuestaSim and its associated documentation contain trade
# // secrets and commercial or financial information that are the property of
# // Mentor Graphics Corporation and are privileged, confidential,
# // and exempt from disclosure under the Freedom of Information Act,
# // 5 U.S.C. Section 552. Furthermore, this information
# // is prohibited from disclosure under the Trade Secrets Act,
# // 18 U.S.C. Section 1905.
# //
# vsim -voptargs="+acc" work.test_task_add_sine_cosine -do "do vsim.wave; set StdArithNoWarnings 1; set NumericStdNoWarnings 1; run -all" -gGUI_MODE=true -gCHECK_RESULTS=true
# Start time: 11:21:10 on Nov 23,2026
# ** Note: (vsim-8009) Loading existing optimized design _opt1
# Loading std.standard
# Loading std.textio(body)
# Loading ieee.std_logic_1164(body)
# Loading ieee.numeric_std(body)
# Loading ieee.fixed_float_types
# Loading ieee.math_real(body)
# Loading ieee.fixed_generic_pkg(body)
# Loading ieee.float_generic_pkg(body)
# Loading ieee.fixed_pkg
# Loading ieee.float_pkg
# Loading work.reg32(body)
# Loading work.avalon_slave
# Loading work.test_utility(body)
# Loading work.test_avalon_slave(body)
# Loading work.task(body)
# Loading work.sine_data
# Loading work.test_hardware_task(body)
# Loading work.test_data_channel_pkg(body)
# Loading std.env(body)
# Loading work.cosine_data
# Loading work.sine_cosine_data
# Loading work.test_task_add_sine_cosine(test)#1
# Loading work.task_add(struct)#1
# Loading work.hardware_task_control(rtl)#1
# Loading work.avalon_slave_transitions(rtl)#1
# Loading work.add(rtl)#1
# Loading work.float_add(mixed)#1
# Loading work.data_channel(struct)#1
# Loading work.data_channel_control(rtl)#1
# Loading work.avalon_slave_transitions(rtl)#2
# Loading work.data_sink_mux(rtl)#1
# Loading work.fifo(rtl)#1
# Loading work.data_source_mux(rtl)#1
# do vsim.wave
# set StdArithNoWarnings 1
# 1
# set NumericStdNoWarnings 1
# 1
# run -all
# --------------------------------------------------------------------------------
# Starting test_task_add_sine_cosine
# test_configure ... [ OK ]
# test_execute ... ** Fatal: (vsim-3421) Value 16 is out of range 0 to 15.
# Time: 3510 ns Iteration: 0 Process: /test_task_add_sine_cosine/dut/u_add/addproc File: ../../../hardware/signal_processing/add.vhd Line: 166
# Fatal error in Process addproc at ../../../hardware/signal_processing/add.vhd line 166
#
# HDL call sequence:
# Stopped at ../../../hardware/signal_processing/add.vhd 166 Process addproc
#
# End time: 11:23:59 on Nov 23,2026, Elapsed time: 0:02:49
# Errors: 1, Warnings: 0
Binary file not shown.
@@ -0,0 +1,156 @@
[N
13
12
13 CHECK_RESULTS
1
110 /users/ads1/golowatschjowde89891/linux/code/signal_processing_vorlage/tests/hardware/task_add_sine_cosine/work
8
12 data_channel
13
8 GUI_MODE
3
3 rtl
7
5 DEPTH
10
25 test_task_add_sine_cosine
2
24 avalon_slave_transitions
9
6 struct
6
4 fifo
4
9 REG_COUNT
5
16 REG_ACCESS_TYPES
11
4 test
]
[G
1
10
11
1
12
0
0
1
0
0 0
0
0
]
[G
1
2
3
1
5
0
0
0
0
6 0
2
1
1
3
3
3
1
1
0 5 1 1
]
[G
1
2
3
2
5
0
0
0
0
7 0
3
1
1
1
2
1
2
1
1
0 6 1 1
]
[G
1
8
9
1
7
1
0
1024
0
0 0
0
0
]
[G
1
6
3
1
7
1
0
1024
0
0 0
0
0
]
[G
1
2
3
1
4
1
0
6
0
0 0
0
0
]
[G
1
2
3
2
4
1
0
7
0
0 0
0
0
]
[G
1
10
11
1
13
0
0
0
0
0 0
0
0
]
@@ -0,0 +1,156 @@
[N
13
12
13 CHECK_RESULTS
1
110 /users/ads1/golowatschjowde89891/linux/code/signal_processing_vorlage/tests/hardware/task_add_sine_cosine/work
8
12 data_channel
13
8 GUI_MODE
3
3 rtl
7
5 DEPTH
10
25 test_task_add_sine_cosine
2
24 avalon_slave_transitions
9
6 struct
6
4 fifo
4
9 REG_COUNT
5
16 REG_ACCESS_TYPES
11
4 test
]
[G
1
10
11
1
12
0
0
1
0
0 0
0
0
]
[G
1
2
3
1
5
0
0
0
0
6 0
2
1
1
3
3
3
1
1
0 5 1 1
]
[G
1
2
3
2
5
0
0
0
0
7 0
3
1
1
1
2
1
2
1
1
0 6 1 1
]
[G
1
8
9
1
7
1
0
1024
0
0 0
0
0
]
[G
1
6
3
1
7
1
0
1024
0
0 0
0
0
]
[G
1
2
3
1
4
1
0
6
0
0 0
0
0
]
[G
1
2
3
2
4
1
0
7
0
0 0
0
0
]
[G
1
10
11
1
13
0
0
1
0
0 0
0
0
]
@@ -0,0 +1,156 @@
[N
13
12
13 CHECK_RESULTS
1
110 /users/ads1/golowatschjowde89891/linux/code/signal_processing_vorlage/tests/hardware/task_add_sine_cosine/work
8
12 data_channel
13
8 GUI_MODE
3
3 rtl
7
5 DEPTH
10
25 test_task_add_sine_cosine
2
24 avalon_slave_transitions
9
6 struct
6
4 fifo
4
9 REG_COUNT
5
16 REG_ACCESS_TYPES
11
4 test
]
[G
1
10
11
1
12
0
0
0
0
0 0
0
0
]
[G
1
2
3
1
5
0
0
0
0
6 0
2
1
1
3
3
3
1
1
0 5 1 1
]
[G
1
2
3
2
5
0
0
0
0
7 0
3
1
1
1
2
1
2
1
1
0 6 1 1
]
[G
1
8
9
1
7
1
0
1024
0
0 0
0
0
]
[G
1
6
3
1
7
1
0
1024
0
0 0
0
0
]
[G
1
2
3
1
4
1
0
6
0
0 0
0
0
]
[G
1
2
3
2
4
1
0
7
0
0 0
0
0
]
[G
1
10
11
1
13
0
0
0
0
0 0
0
0
]
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
m255
K4
z0
cModel Technology