From d9f18e7b58f5cb06f65ed69b795ec14ce96ac94a Mon Sep 17 00:00:00 2001 From: Andreas Olofsson Date: Tue, 8 Mar 2016 21:23:02 -0500 Subject: [PATCH] DV cleanup -removing all redundant build files, there must be only one... --- README.md | 19 ++- accelerator/dv/build.sh | 13 -- ...ut_axi_accelerator.v => dut_accelerator.v} | 21 ++- accelerator/dv/run.sh | 7 - accelerator/dv/tests/hello_world.emf | 5 - .../dv/{test_0.emf => tests/test_basic.emf} | 0 common/dv/build.sh | 27 ---- common/dv/build_all.sh | 13 -- emailbox/dv/dv_embox.v | 119 -------------- emailbox/dv/run.sh | 10 -- emmu/dv/dv_emmu.v | 149 ------------------ emmu/dv/dv_emmu_tb.v | 39 ----- emmu/dv/emmu.cpp | 34 ---- emmu/dv/run.sh | 10 -- etrace/dv/build.sh | 13 -- etrace/dv/run.sh | 7 - etrace/dv/test_0.memh | 19 --- gpio/dv/build.sh | 16 -- gpio/dv/run.sh | 7 - mio/dv/build.sh | 12 -- mio/dv/build_all.sh | 16 -- mio/dv/run.sh | 13 -- mio/dv/test_0.emf | 1 - parallella/dv/build.sh | 7 - 24 files changed, 31 insertions(+), 546 deletions(-) delete mode 100755 accelerator/dv/build.sh rename accelerator/dv/{dut_axi_accelerator.v => dut_accelerator.v} (97%) delete mode 100755 accelerator/dv/run.sh delete mode 100644 accelerator/dv/tests/hello_world.emf rename accelerator/dv/{test_0.emf => tests/test_basic.emf} (100%) delete mode 100644 common/dv/build.sh delete mode 100755 common/dv/build_all.sh delete mode 100644 emailbox/dv/dv_embox.v delete mode 100755 emailbox/dv/run.sh delete mode 100644 emmu/dv/dv_emmu.v delete mode 100644 emmu/dv/dv_emmu_tb.v delete mode 100644 emmu/dv/emmu.cpp delete mode 100755 emmu/dv/run.sh delete mode 100755 etrace/dv/build.sh delete mode 100755 etrace/dv/run.sh delete mode 100644 etrace/dv/test_0.memh delete mode 100755 gpio/dv/build.sh delete mode 100755 gpio/dv/run.sh delete mode 100755 mio/dv/build.sh delete mode 100755 mio/dv/build_all.sh delete mode 100755 mio/dv/run.sh delete mode 120000 mio/dv/test_0.emf delete mode 100755 parallella/dv/build.sh diff --git a/README.md b/README.md index dfada6d..542c0db 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,27 @@ ```sh ./build.sh gpio/dv/dut_gpio.v # compile gpio testbench (example) -./sim.sh gpio/dv/tests/test_regs.emf # run a simulation with "test_regs.emf" +./sim.sh gpio/dv/tests/test_basic.emf # run a simulation with "test_regs.emf" ./view.sh # open the waveform with gtkwave ``` +**Short-cut:** + +* Builds $name/dv/dut_$name.v +* Runs test $name/dv/tests/test_basic.emf + +```sh +./run.sh accelerator +./run.sh elink +./run.sh emailbox +./run.sh emmu +./run.sh gpio +./run.sh spi +./run.sh pic +``` + + + ## LICENSE The OH! repository source code is licensed under the MIT license unless otherwise specified. See [LICENSE](LICENSE) for MIT copyright terms. Design specific licenses can be found in the folder root (eg: aes/LICENSE) diff --git a/accelerator/dv/build.sh b/accelerator/dv/build.sh deleted file mode 100755 index 97bb47f..0000000 --- a/accelerator/dv/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -dut="axi_accelerator" -top="../../common/dv/dv_top.v" -iverilog -g2005 -DTARGET_SIM=1 -DTARGET_XILINX=1 $top dut_${dut}.v -f ../../common/dv/libs.cmd -o ${dut}.vvp $1 - -#-Wtimescale - -#PUT TARGET_SIM - -#-pfileline=1 -#-Wall - diff --git a/accelerator/dv/dut_axi_accelerator.v b/accelerator/dv/dut_accelerator.v similarity index 97% rename from accelerator/dv/dut_axi_accelerator.v rename to accelerator/dv/dut_accelerator.v index 7c6f007..dcbd140 100644 --- a/accelerator/dv/dut_axi_accelerator.v +++ b/accelerator/dv/dut_accelerator.v @@ -1,9 +1,9 @@ -`include "elink_regmap.v" +//`include "elink_regmap.v" module dut(/*AUTOARG*/ // Outputs - dut_active, wait_out, access_out, packet_out, + dut_active, clkout, wait_out, access_out, packet_out, // Inputs - clk, nreset, vdd, vss, access_in, packet_in, wait_in + clk1, clk2, nreset, vdd, vss, access_in, packet_in, wait_in ); //########################################################################## @@ -18,11 +18,13 @@ module dut(/*AUTOARG*/ parameter N = 1; //clock,reset - input clk; + input clk1; + input clk2; input nreset; input [N*N-1:0] vdd; input vss; output dut_active; + output clkout; //Stimulus Driven Transaction input [N-1:0] access_in; @@ -127,13 +129,16 @@ module dut(/*AUTOARG*/ wire s_axi_wvalid; // From emaxi of emaxi.v // End of automatics + assign clkout = clk1; + assign dut_active = 1'b1; + //###################################################################### //ACCELERATOR //###################################################################### axi_accelerator axi_accelerator (.sys_nreset (nreset), - .sys_clk (clk), + .sys_clk (clk1), .m_axi_aresetn (nreset), .s_axi_aresetn (nreset), .s_axi_wstrb (s_axi_wstrb[7:4] | s_axi_wstrb[3:0]), @@ -231,7 +236,7 @@ module dut(/*AUTOARG*/ */ emaxi #(.M_IDW(M_IDW)) - emaxi (.m_axi_aclk (clk), + emaxi (.m_axi_aclk (clk1), .m_axi_aresetn (nreset), .m_axi_rdata ({s_axi_rdata[31:0],s_axi_rdata[31:0]}), .rr_wait (wait_in), @@ -286,7 +291,7 @@ module dut(/*AUTOARG*/ - assign dut_active = 1'b1; + //Tie off master output for now @@ -294,7 +299,7 @@ module dut(/*AUTOARG*/ ); */ - axislave_stub m_stub (.s_axi_aclk (clk), + axislave_stub m_stub (.s_axi_aclk (clk1), .s_axi_aresetn (nreset), /*AUTOINST*/ // Outputs diff --git a/accelerator/dv/run.sh b/accelerator/dv/run.sh deleted file mode 100755 index 543fb57..0000000 --- a/accelerator/dv/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [ -e "test_0.emf" ] -then - rm test_0.emf -fi -cp $1 test_0.emf -./axi_accelerator.vvp diff --git a/accelerator/dv/tests/hello_world.emf b/accelerator/dv/tests/hello_world.emf deleted file mode 100644 index 8d59055..0000000 --- a/accelerator/dv/tests/hello_world.emf +++ /dev/null @@ -1,5 +0,0 @@ -DEADBEEF_00000001_810f0000_05_0010 //INPUT A -DEADBEEF_00000002_810f0004_05_0010 //INPUT B -00000000_DEADBEEF_810f0008_04_0010 //READ OUTPUT - - diff --git a/accelerator/dv/test_0.emf b/accelerator/dv/tests/test_basic.emf similarity index 100% rename from accelerator/dv/test_0.emf rename to accelerator/dv/tests/test_basic.emf diff --git a/common/dv/build.sh b/common/dv/build.sh deleted file mode 100644 index 07474cf..0000000 --- a/common/dv/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -############################################################################ -# Icarus Verilog build script for OH! -# Requires $OH_HOME variable to be set -############################################################################ - -DUT=$1 - -#Create directory of all links -mkdir -p $OH_HOME/symlinks/hdl -mkdir -p $OH_HOME/symlinks/dv -pushd $OH_HOME/symlinks/hdl -ln -s ../../*/hdl/*.v . -cd ../dv -ln -s ../../*/dv/*.v . -popd -exit -#Build -iverilog -g2005\ - -DTARGET_SIM=1\ - $DUT\ - $OH_HOME/symlinks/dv/dv_top.v\ - -y .\ - -y $OH_HOME/symlinks/hdl\ - -y $OH_HOME/symlinks/dv\ - -I $OH_HOME/symlinks/hdl - -o dut.bin\ diff --git a/common/dv/build_all.sh b/common/dv/build_all.sh deleted file mode 100755 index de86c81..0000000 --- a/common/dv/build_all.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Compiles all dut*.v files in this directory - -DV=../../common/dv/dv_top.v -LIBS=$OH_HOME/common/dv/libs.cmd -CFG="cfg_random.v" - -for file in dut*.v -do - root=${file%%.*} - iverilog -g2005 -DTARGET_SIM=1 $CFG $file $DV -f $LIBS -o $root.bin -done diff --git a/emailbox/dv/dv_embox.v b/emailbox/dv/dv_embox.v deleted file mode 100644 index 86ae796..0000000 --- a/emailbox/dv/dv_embox.v +++ /dev/null @@ -1,119 +0,0 @@ -//`timescale 1 ns / 100 ps -module dv_embox(); - - parameter DW = 32; - - - //Stimulus to drive - reg clk; - reg reset; - reg mi_access; - reg [19:0] mi_addr; - reg [31:0] mi_data_in; - reg mi_write; - reg [1:0] test_state; - reg go; - - //Reset - initial - begin - $display($time, " << Starting the Simulation >>"); - #0 - clk = 1'b0; // at time 0 - reset = 1'b1; // reset is active - mi_write = 1'b0; - mi_access = 1'b0; - mi_addr[19:0] = 20'hf0368; - mi_data_in[31:0] = 32'h0; - test_state[1:0] = 2'b00; - go = 1'b0; - #100 - reset = 1'b0; // at time 100 release reset - #100 - go = 1'b1; - #10000 - $finish; - end - - //Clock - always - #10 clk = ~clk; - - //Pattern generator - //1.) Write in 8 transactions (split into low and high) - //2.) Read back 8 transactions (split into low and high) - - always @ (negedge clk) - if(go) - begin - case(test_state[1:0]) - 2'b00://write - if(~done) - begin - mi_access <= 1'b1; - mi_write <= 1'b1; - mi_addr[19:0] <= mi_addr[19:0] ^ 20'hc; - mi_data_in[31:0] <= mi_data_in[31:0]+1'b1; - end - else - begin - test_state <= 2'b01; - mi_addr[19:0] <= 20'hf0368; - mi_data_in[31:0] <= 32'h0; - end - 2'b01://read - if(~done) - begin - mi_write <= 1'b0; - mi_access <= 1'b1; - mi_addr[19:0] <= mi_addr[19:0] ^ 20'hc; - mi_data_in[31:0] <= mi_data_in[31:0]+1'b1; - end - else - begin - test_state <= 2'b10; - mi_write <= 1'b0; - mi_access <= 1'b0; - end - endcase // case (test_state[1:0]) - end - - wire done = (mi_data_in[19:0]==20'h8); - - /*AUTOWIRE*/ - // Beginning of automatic wires (for undeclared instantiated-module outputs) - wire embox_empty; // From embox of embox.v - wire embox_full; // From embox of embox.v - wire [DW-1:0] mi_data_out; // From embox of embox.v - // End of automatics - - //DUT - embox embox( - /*AUTOINST*/ - // Outputs - .mi_data_out (mi_data_out[DW-1:0]), - .embox_full (embox_full), - .embox_empty (embox_empty), - // Inputs - .reset (reset), - .clk (clk), - .mi_access (mi_access), - .mi_write (mi_write), - .mi_addr (mi_addr[19:0]), - .mi_data_in (mi_data_in[DW-1:0])); - - - //Waveform dump - initial - begin - $dumpfile("test.vcd"); - $dumpvars(0, dv_embox); - end - - -endmodule // dv_embox -// Local Variables: -// verilog-library-directories:("." "../hdl" "../../memory/hdl ") -// End: - - diff --git a/emailbox/dv/run.sh b/emailbox/dv/run.sh deleted file mode 100755 index f52794c..0000000 --- a/emailbox/dv/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -#Compiling sim -iverilog -y ../../fifos/hdl/ \ - -y ../../common/hdl \ - -y ../../memory/hdl \ - -y ../hdl \ - dv_embox.v - -#Running sim -./a.out diff --git a/emmu/dv/dv_emmu.v b/emmu/dv/dv_emmu.v deleted file mode 100644 index 487cce2..0000000 --- a/emmu/dv/dv_emmu.v +++ /dev/null @@ -1,149 +0,0 @@ -//`timescale 1 ns / 100 ps -module dv_emmu - (input clk, - input reset, - input go); - - parameter DW = 32; //data width of - parameter AW = 32; //data width of - parameter IW = 12; //index size of table - parameter PAW = 64; //physical address width of output - parameter MW = PAW-AW+IW; //table data width - parameter MD = 1<>"); - #0 - clk = 1'b0; // at time 0 - reset = 1'b1; // reset is active - #100 - reset = 1'b0; // at time 100 release reset - #100 - go = 1'b1; - #10000 - $finish; - end - - //Waveform dump - initial - begin - $dumpfile("test.vcd"); - $dumpvars(0, dv_emmu); - end - - -dv_emmu dv_emmu - (.clk (clk), - .reset (reset), - .go (go)); -endmodule diff --git a/emmu/dv/emmu.cpp b/emmu/dv/emmu.cpp deleted file mode 100644 index 68df76f..0000000 --- a/emmu/dv/emmu.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include - -#include "Vdv_emmu__Syms.h" - -int main(int argc, char **argv, char **env) -{ - Verilated::commandArgs(argc, argv); - - uint64_t t; - - //VCD stuff - Verilated::traceEverOn(true); - VerilatedVcdC* tfp = new VerilatedVcdC; - //char *vcdFileName; - Vdv_emmu* top = new Vdv_emmu; - top->trace(tfp, 99); - tfp->open("test.vcd"/*vcdFileName*/); - - //Init values - top->clk = 0; - top->reset = 1; - top->go = 0; - - while(t<100000) { - if (t==100) top->reset = 0; - if (t==10000) top->go = 1; - top->eval(); - top->clk = !top->clk; - tfp->dump((vluint64_t)t); - t++; - } - tfp->close(); -} diff --git a/emmu/dv/run.sh b/emmu/dv/run.sh deleted file mode 100755 index 5bb6688..0000000 --- a/emmu/dv/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -#Compiling sim -iverilog -y ../../fifos/hdl/ \ - -y ../../common/hdl \ - -y ../../memory/hdl \ - -y ../hdl \ - dv_emmu.v - -#Running sim -./a.out diff --git a/etrace/dv/build.sh b/etrace/dv/build.sh deleted file mode 100755 index 350e8a7..0000000 --- a/etrace/dv/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -dut="etrace" -top="../../common/dv/dv_top.v" -iverilog -g2005 -DTARGET_SIM=1 -DTARGET_XILINX=1 $top dut_${dut}.v -f ../../common/dv/libs.cmd -o ${dut}.vvp $1 - -#-Wtimescale - -#PUT TARGET_SIM - -#-pfileline=1 -#-Wall - diff --git a/etrace/dv/run.sh b/etrace/dv/run.sh deleted file mode 100755 index 690ce39..0000000 --- a/etrace/dv/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [ -e "test_0.memh" ] -then - rm test_0.memh -fi -cp $1 test_0.memh -./etrace.vvp diff --git a/etrace/dv/test_0.memh b/etrace/dv/test_0.memh deleted file mode 100644 index ce0cae7..0000000 --- a/etrace/dv/test_0.memh +++ /dev/null @@ -1,19 +0,0 @@ -00000000_00000001_810F0000_05_0010 //enable tracer -00000001_00000000_00000001_05_0010 //s0:use source address and write to dummy -10000000_00000000_00000001_05_0010 //s1 -10000000_00000000_00000001_05_0010 //s2 -00000000_00000000_00000001_05_0010 //s3 -11111111_00000000_00000001_05_0010 //s4 -00000000_00000000_810A0000_04_0010 //read sample0 -00000000_00000000_810A0004_04_0010 // -00000000_00000000_810A0008_04_0010 //read sample1 -00000000_00000000_810A000c_04_0010 // -00000000_00000000_810A0010_04_0010 //read sample2 -00000000_00000000_810A0014_04_0010 // -00000000_00000000_810A0018_04_0010 //read sample3 -00000000_00000000_810A001c_04_0010 // -00000000_00000000_810A0020_04_0010 //read sample4 -00000000_00000000_810A0024_04_0010 // - - - diff --git a/gpio/dv/build.sh b/gpio/dv/build.sh deleted file mode 100755 index f2756c6..0000000 --- a/gpio/dv/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -DV="../../common/dv/dv_top.v" -DUT="dut_gpio.v" -ROOT="gpio" -iverilog -o $ROOT.bin -g2005 -DTARGET_SIM=1 \ -$DV \ -$DUT \ --y ../hdl \ --y ../../common/hdl/ \ --y ../../common/dv/ \ --y ../../emesh/hdl/ \ --y ../../emesh/dv/ \ --I ../hdl - - diff --git a/gpio/dv/run.sh b/gpio/dv/run.sh deleted file mode 100755 index 7dcd4ea..0000000 --- a/gpio/dv/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [ -e "test_0.emf" ] -then - rm test_0.emf -fi -cp $1 test_0.emf -./gpio.bin diff --git a/mio/dv/build.sh b/mio/dv/build.sh deleted file mode 100755 index d485f02..0000000 --- a/mio/dv/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Compiles all dut*.v files in this directory - -DV=../../common/dv/dv_top.v -DUT=dut_mio.v -LIBS=$OH_HOME/common/dv/libs.cmd -CFG="../hdl/cfg_mio.vh" - -root=${DUT%%.*} -iverilog -g2005 -DTARGET_SIM=1 $CFG $DUT $DV -f $LIBS -o $root.bin - diff --git a/mio/dv/build_all.sh b/mio/dv/build_all.sh deleted file mode 100755 index cb5f2a7..0000000 --- a/mio/dv/build_all.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -DV=../../common/dv/dv_top.v -LIBS=$OH_HOME/common/dv/libs.cmd - -declare -a core_arr=("dut_c2c") -declare -a cfg_arr=("../hdl/cfg_c2c.v") - -for core in "${core_arr[@]}" -do - for cfg in "${cfg_arr[@]}" - do - iverilog -g2005 -DTARGET_SIM=1 $cfg $core.v $DV -f $LIBS -o $core.bin - done - -done diff --git a/mio/dv/run.sh b/mio/dv/run.sh deleted file mode 100755 index 5539e42..0000000 --- a/mio/dv/run.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -#ARGUMENTS -#$1=name of "dut*.bin" to simulate -#$2=path to test to run - -#Uses BASH $RANDOM variable to set seed - -rm test_0.emf -ln -s $2 test_0.emf -./$1 +SEED=$RANDOM - - diff --git a/mio/dv/test_0.emf b/mio/dv/test_0.emf deleted file mode 120000 index 1fc2aad..0000000 --- a/mio/dv/test_0.emf +++ /dev/null @@ -1 +0,0 @@ -tests/test_random.emf \ No newline at end of file diff --git a/parallella/dv/build.sh b/parallella/dv/build.sh deleted file mode 100755 index 2a32ae8..0000000 --- a/parallella/dv/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -top="../hdl/parallella_basic.v" -iverilog -g2005 -DTARGET_SIM=1 -DTARGET_XILINX=1 $top -f ../../common/dv/libs.cmd -o ${dut}.vvp - -#-pfileline=1 -#-Wall -