Vorgegebene Dateien von Ordner /rsc kopiert.

This commit is contained in:
2024-02-22 12:24:10 +01:00
parent 906e16c100
commit 4337a72010
5 changed files with 308 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#JZ 2020
#remove working directory
file delete -force work
#Creating the work lib
vlib work
vmap ampel "designlib/ampel"
vmap work work
#Top level testbench
vlog tb_ampel.v
#vlog ../src/ampel.v +define+SIMULATION
#Simulate
vsim -c -t ps -L ampel tb_ampel
#vsim -c -t ps tb_ampel
#get wave
do wave.do
run 1500 us

View File

@@ -0,0 +1,67 @@
/******************************************************
*
* Description: tb_ampel
* Date: 13.01.2018
* File Name: tb_ampel.v
* Version: 1.0
* Target: Simulation
* Technology:
*
* Rev Author Date Changes
* -----------------------------------------------------
* 1.0 JZ 13.01.2018 Testbench zur Ampelsteuerung
*******************************************************/
`timescale 1ns / 1ps
module tb_ampel;
reg CLK;
reg RSTn;
reg SW;
wire [2:0] HAUPTSTR_LINKS;
wire [2:0] NEBENSTR_LINKS;
wire [1:0] FUSSGAENGER_LINKS;
wire [2:0] HAUPTSTR_RECHTS;
wire [2:0] NEBENSTR_RECHTS;
wire [1:0] FUSSGAENGER_RECHTS;
//50 MHz clock
initial
begin
CLK = 1'b0;
end
always
CLK = #10 ~CLK;
//push buttons
initial
begin
RSTn = 1'b1;
SW = 1'b1;
#100;
RSTn = 1'b0;
#10;
RSTn = 1'b1;
#50_000;
SW = 1'b0;
#100;
SW = 1'b1;
end
ampel ampel(
.CLOCK_50 (CLK),
.KEY ({RSTn, SW}),
.LEDH_L(HAUPTSTR_LINKS),
.LEDN_L(NEBENSTR_LINKS),
.LEDF_L(FUSSGAENGER_LINKS),
.LEDH_R(HAUPTSTR_RECHTS),
.LEDN_R(NEBENSTR_RECHTS),
.LEDF_R(FUSSGAENGER_RECHTS)
);
endmodule

View File

@@ -0,0 +1,29 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /tb_ampel/CLK
add wave -noupdate /tb_ampel/RSTn
add wave -noupdate /tb_ampel/SW
add wave -noupdate -expand -subitemconfig {{/tb_ampel/HAUPTSTR_LINKS[2]} {-color Red} {/tb_ampel/HAUPTSTR_LINKS[1]} {-color Gold}} /tb_ampel/HAUPTSTR_LINKS
add wave -noupdate -expand -subitemconfig {{/tb_ampel/NEBENSTR_LINKS[2]} {-color Red} {/tb_ampel/NEBENSTR_LINKS[1]} {-color Gold}} /tb_ampel/NEBENSTR_LINKS
add wave -noupdate -expand -subitemconfig {{/tb_ampel/FUSSGAENGER_LINKS[1]} {-color Red}} /tb_ampel/FUSSGAENGER_LINKS
add wave -noupdate -expand -subitemconfig {{/tb_ampel/HAUPTSTR_RECHTS[2]} {-color Red} {/tb_ampel/HAUPTSTR_RECHTS[1]} {-color Gold}} /tb_ampel/HAUPTSTR_RECHTS
add wave -noupdate -expand -subitemconfig {{/tb_ampel/NEBENSTR_RECHTS[2]} {-color Red} {/tb_ampel/NEBENSTR_RECHTS[1]} {-color Gold}} /tb_ampel/NEBENSTR_RECHTS
add wave -noupdate -expand -subitemconfig {{/tb_ampel/FUSSGAENGER_RECHTS[1]} {-color Red}} /tb_ampel/FUSSGAENGER_RECHTS
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {833117378 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 150
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 5000
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {1575 us}