2024-02-01 13:08:55 -06:00
|
|
|
#!/usr/bin/env bash
|
2024-02-14 04:42:27 -06:00
|
|
|
set -e
|
2024-02-01 13:08:55 -06:00
|
|
|
|
2024-02-14 04:42:27 -06:00
|
|
|
# TODO: when sim gets native $check support, remove the -DNO_ASSERT here
|
|
|
|
echo Running yosys sim
|
|
|
|
../../yosys -q -p "
|
|
|
|
read_verilog -formal -DNO_ASSERT clk2fflogic_effects.sv
|
2024-02-01 13:08:55 -06:00
|
|
|
hierarchy -top top; proc;;
|
|
|
|
|
2024-02-14 04:42:27 -06:00
|
|
|
tee -q -o clk2fflogic_effects.sim.log sim -q -n 32
|
|
|
|
"
|
|
|
|
echo Running yosys clk2fflogic sim
|
|
|
|
../../yosys -q -p "
|
|
|
|
read_verilog -formal clk2fflogic_effects.sv
|
2024-02-01 13:08:55 -06:00
|
|
|
hierarchy -top top; proc;;
|
|
|
|
clk2fflogic;;
|
|
|
|
|
2024-02-14 04:42:27 -06:00
|
|
|
logger -nowarn ^Assertion
|
|
|
|
tee -q -o clk2fflogic_effects.clk2fflogic.log sim -q -n 32
|
2024-02-01 13:08:55 -06:00
|
|
|
"
|
|
|
|
|
2024-02-14 04:42:27 -06:00
|
|
|
echo Running iverilog sim
|
|
|
|
iverilog -g2012 -DNO_ASSERT -o clk2fflogic_effects.iv.out clk2fflogic_effects.sv
|
|
|
|
|
2024-02-01 13:08:55 -06:00
|
|
|
|
|
|
|
./clk2fflogic_effects.iv.out > clk2fflogic_effects.iv.log
|
|
|
|
|
2024-02-14 04:42:27 -06:00
|
|
|
gawk '/([0-9]+):/{T=$1;print};/^Failed/{print T,$0}' clk2fflogic_effects.iv.log | sort > clk2fflogic_effects.iv.sorted.log
|
|
|
|
gawk '/([0-9]+):/{T=$1;print};/^Failed/{print T,$0}' clk2fflogic_effects.sim.log | sort > clk2fflogic_effects.sim.sorted.log
|
|
|
|
gawk '/([0-9]+):/{T=$1;print};/^Failed/{print T,$0}' clk2fflogic_effects.clk2fflogic.log | sort > clk2fflogic_effects.clk2fflogic.sorted.log
|
2024-02-01 13:08:55 -06:00
|
|
|
|
2024-02-14 04:42:27 -06:00
|
|
|
echo Comparing iverilog sim vs yosys sim
|
2024-02-01 13:08:55 -06:00
|
|
|
cmp clk2fflogic_effects.iv.sorted.log clk2fflogic_effects.sim.sorted.log
|
2024-02-14 04:42:27 -06:00
|
|
|
echo Comparing iverilog sim vs yosys clk2fflogic sim
|
2024-02-01 13:08:55 -06:00
|
|
|
cmp clk2fflogic_effects.iv.sorted.log clk2fflogic_effects.clk2fflogic.sorted.log
|