Skip to content

Commit

Permalink
Update README and use TCL script for loading waves.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvan Tortorella committed Feb 27, 2024
1 parent 3eea25a commit 32a4de5
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 3,715 deletions.
32 changes: 19 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,20 @@ sw-build: $(STIM_INSTR) $(STIM_DATA) dis
# Run the simulation
run: $(CRT)
ifeq ($(gui), 0)
cd $(VSIM_DIR); \
$(QUESTA) vsim -c $(tb)_opt -do "run -a" \
-gSTIM_INSTR=$(STIM_INSTR) \
-gSTIM_DATA=$(STIM_DATA) \
cd $(VSIM_DIR); \
$(QUESTA) vsim -c $(tb)_opt \
-do "run -a" \
-gSTIM_INSTR=$(STIM_INSTR) \
-gSTIM_DATA=$(STIM_DATA) \
-gPROB_STALL=$(P_STALL)
else
cd $(VSIM_DIR); \
$(QUESTA) vsim $(tb)_opt \
-do "log -r /*" \
-do "source $(WAVES)" \
-gSTIM_INSTR=$(STIM_INSTR) \
-gSTIM_DATA=$(STIM_DATA) \
cd $(VSIM_DIR); \
$(QUESTA) vsim $(tb)_opt \
-do "set Testbench $(tb)" \
-do "log -r /*" \
-do "source $(WAVES)" \
-gSTIM_INSTR=$(STIM_INSTR) \
-gSTIM_DATA=$(STIM_DATA) \
-gPROB_STALL=$(P_STALL)
endif

Expand All @@ -117,12 +119,12 @@ include bender_common.mk
include bender_sim.mk
include bender_synth.mk

WAVES := $(mkfile_path)scripts/wave.tcl

ifeq ($(REDMULE_COMPLEX),1)
tb := redmule_complex_tb
WAVES := $(mkfile_path)wave_complex_xif.do
else
tb := redmule_tb
WAVES := $(mkfile_path)wave.do
endif

$(VSIM_DIR):
Expand Down Expand Up @@ -166,10 +168,14 @@ golden: golden-clean
golden-clean:
$(MAKE) -C golden-model golden-clean

clean-all: clean-hw clean-sw
clean-all: hw-clean sw-clean
rm -rf $(mkfile_path).bender
rm -rf $(compile_script)

hw-build: $(VSIM_DIR)
cd $(VSIM_DIR); \
$(QUESTA) vsim -c -do 'quit -code [source $(compile_script)]'

sw-all: sw-clean sw-build

hw-all: hw-clean hw-build
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ make update-ips

Build the hardware:
```bash
make build-hw
make hw-build
```

### Run the test

To run the available tests, just do:
```bash
make build-sw
make sw-build
make run (gui=1 to open the Questasim Graphic User Interface)
```
It is possible to run the test introducing a parametric probability of stall by explicitly passing the `P_STALL` parameter while running the test (`P_STALL=0.1` means a stall probability of the 10%).
Expand Down
79 changes: 79 additions & 0 deletions scripts/wave.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright 2021 ETH Zurich and University of Bologna.
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51
#
# Yvan Tortorella <[email protected]>

onerror {resume}
quietly WaveActivateNextPane {} 0

if {$Testbench == {redmule_tb}} {
set TopLevelPath i_redmule_wrap/i_redmule_top
set CorePath $Testbench/i_cv32e40p_core
} elseif {$Testbench == {redmule_complex_tb}} {
set DutPath i_dut
set TopLevelPath $DutPath/i_redmule_top
set CorePath $DutPath/gen_cv32e40x/i_core
}
set MinHeight 16
set MaxHeight 32
set WavesRadix hexadecimal

# Core
add wave -noupdate -group Core -group top -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $CorePath/*
# Top level
add wave -noupdate -group RedMulE -group top -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/*
add wave -noupdate -group RedMulE -group periph -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/periph/*
add wave -noupdate -group RedMulE -group tcdm -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/tcdm/*
# Streamer
add wave -noupdate -group Streamer -group top -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/*
add wave -noupdate -group Streamer -group LDST-Mux -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/i_ldst_mux/*
add wave -noupdate -group Streamer -group LDST-Mux -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/i_source_mux/*
## X stream
add wave -noupdate -group Streamer -group X-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[0]/i_load_tcdm_fifo/*
add wave -noupdate -group Streamer -group X-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[0]/i_load_cast/*
add wave -noupdate -group Streamer -group X-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[0]/i_stream_source/*
## W stream
add wave -noupdate -group Streamer -group W-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[1]/i_load_tcdm_fifo/*
add wave -noupdate -group Streamer -group W-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[1]/i_load_cast/*
add wave -noupdate -group Streamer -group W-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[1]/i_stream_source/*
## Y stream
add wave -noupdate -group Streamer -group Y-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[2]/i_load_tcdm_fifo/*
add wave -noupdate -group Streamer -group Y-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[2]/i_load_cast/*
add wave -noupdate -group Streamer -group Y-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/gen_tcdm2stream[2]/i_stream_source/*
## Z stream
add wave -noupdate -group Streamer -group Z-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/i_stream_sink/*
add wave -noupdate -group Streamer -group Z-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/i_store_cast/*
add wave -noupdate -group Streamer -group Z-Stream -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_streamer/i_store_fifo/*
# Buffers and FIFOs
## X
add wave -noupdate -group X-channel -group x-buffer_fifo -group fifo_interface -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/x_buffer_fifo/*
add wave -noupdate -group X-channel -group x-buffer_fifo -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_x_buffer_fifo/*
add wave -noupdate -group X-channel -group x-buffer -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_x_buffer/*
## W
add wave -noupdate -group W-channel -group w-buffer_fifo -group fifo_interface -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/w_buffer_fifo/*
add wave -noupdate -group W-channel -group w-buffer_fifo -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_w_buffer_fifo/*
add wave -noupdate -group W-channel -group w-buffer -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_w_buffer/*
## Y
add wave -noupdate -group Y-channel -group y-buffer_fifo -group fifo_interface -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/y_buffer_fifo/*
add wave -noupdate -group Y-channel -group y-buffer_fifo -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_y_buffer_fifo/*
## Z
add wave -noupdate -group Z-channel -group z-buffer_fifo -group fifo_interface -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/z_buffer_fifo/*
add wave -noupdate -group Z-channel -group z-buffer_fifo -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_z_buffer_fifo/*
add wave -noupdate -group Z-channel -group z-buffer -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_z_buffer/*
# Engine
set NumRows [examine -radix dec redmule_pkg::ARRAY_WIDTH]
set NumCols [examine -radix dec redmule_pkg::ARRAY_HEIGHT]

for {set row 0} {$row < $NumRows} {incr row} {
for {set col 0} {$col < $NumCols} {incr col} {
add wave -noupdate -group Engine -group row_$row -group CE_$col -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_redmule_engine/gen_redmule_rows[$row]/i_row/gen_computing_element[$col]/i_computing_element/*
}
}
# Scheduler
add wave -noupdate -group Scheduler -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_scheduler/*
# Controller
add wave -noupdate -group Controller -color {} -height $MinHeight -max $MaxHeight -radix $WavesRadix $Testbench/$TopLevelPath/i_control/*

# Remove the hierarchial strip from signals
config wave -signalnamewidth 1
Loading

0 comments on commit 32a4de5

Please sign in to comment.