M1: Fehler bei Übertragung behoben

Fehler bei erstem Übertagendem Bit nach Reset behoben
This commit is contained in:
Matthias Biermann
2024-10-13 14:37:20 +02:00
parent 62679efee1
commit b26e228d0c
4 changed files with 27 additions and 10 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ architecture rtl of spi2display_rom is
"00"&x"61",
"00"&x"6C",
"00"&x"6C",
"11"&x"6F",
"10"&x"6F",
others=>"00"&x"20");
begin
+20 -5
View File
@@ -18,13 +18,28 @@ architecture rtl of spi2display_tb is
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal sck : std_logic;
signal mosi : std_logic;
signal ssel : std_logic;
begin
process (clk) begin
clk_proc: process (clk)
begin
clk <= not clk after clk_half_period;
end process;
reset <= '0' after 100 * clk_half_period;
stim: process
begin
reset <= '0' after 100 * clk_half_period;
wait for 45 us;
wait until rising_edge(clk);
reset <= '1';
wait for 1 us;
wait until rising_edge(clk);
reset <= '0';
end process;
dut: entity work.spi2display
generic map (
@@ -36,9 +51,9 @@ begin
port map (
clk => clk,
reset => reset,
mosi => open,
sck => open,
ssel => open
mosi => mosi,
sck => sck,
ssel => ssel
);
end;
+1 -1
View File
@@ -75,7 +75,7 @@ begin
begin
wait until rising_edge(clk);
if reset = '1' then
cntVal := to_unsigned(7, 3);
cntVal := to_unsigned(0, 3);
elsif CntBitsEn = '1' then
if cntVal = 0 then
cntVal := to_unsigned(7, 3);
+5 -3
View File
@@ -31,8 +31,8 @@ if {1} {
if {1} {
add wave -divider "Interne Signale"
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/data
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/addr
add wave -noupdate -ascii /spi2display_tb/dut/SPI_Transmitter_Inst/data
add wave -noupdate -hexadecimal /spi2display_tb/dut/SPI_Transmitter_Inst/addr
add wave -divider "Steuerwerk"
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/Steuerwerk/state
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/Steuerwerk/state_next
@@ -45,6 +45,8 @@ if {1} {
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/RegDataLd
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/RegDataShift
add wave -noupdate /spi2display_tb/dut/SPI_Transmitter_Inst/CntBitsEn
add wave -divider "Rechenwerk"
add wave -noupdate -unsigned -label CounterBits /spi2display_tb/dut/SPI_Transmitter_Inst/Rechenwerk/CntBits/cntVal
}
run 100 us
run 1000 us