tests pass

This commit is contained in:
Ethan Sifferman 2024-01-24 16:11:58 -08:00 committed by Zachary Snow
parent bcb6d9b249
commit 4181b94c0f
4 changed files with 30 additions and 3 deletions

View File

@ -24,7 +24,7 @@ module Language.SystemVerilog.AST.Expr
, pattern Mux
) where
import Data.List (intercalate)
import Data.List (intercalate, isPrefixOf)
import Text.Printf (printf)
import Language.SystemVerilog.AST.Number (Number(..))
@ -138,8 +138,8 @@ instance Show Expr where
showString " : " .
shows f .
showChar ')'
showsPrec _ (Call e (Args [] [])) =
shows e
showsPrec _ (Call (Ident e) (Args [] [])) | "$" `isPrefixOf` e =
shows (Ident e)
showsPrec _ (Call e l ) =
shows e .
shows l

22
test/core/system_tasks.v Normal file
View File

@ -0,0 +1,22 @@
module top;
initial begin
$write("[%0t] Info: ", $time);
$display;
$write("[%0t] Info: ", $time);
$display("%b", 1);
$write("[%0t] Warning: ", $time);
$display;
$write("[%0t] Warning: ", $time);
$display("%b", 2);
$write("[%0t] Error: ", $time);
$display;
$write("[%0t] Error: ", $time);
$display("%b", 3);
$write("[%0t] Fatal: ", $time);
$display;
$finish;
$write("Fatal:");
$display("%b", 4);
$finish(0);
end
endmodule

View File

@ -173,6 +173,11 @@ simulateAndCompare() {
simulate $cvs_vcd $cvs_log $cs $tb
simulate $cvv_vcd $cvv_log $cv $tb
# clean log files by removing filenames
sed -E 's#'$ve':[[:digit:]]+#'$ve'#g' $ref_log > $ref_log.tmp && mv $ref_log.tmp $ref_log
sed -E 's#'$cs':[[:digit:]]+#'$ve'#g' $cvs_log > $cvs_log.tmp && mv $cvs_log.tmp $cvs_log
sed -E 's#'$cv':[[:digit:]]+#'$ve'#g' $cvv_log > $cvv_log.tmp && mv $cvv_log.tmp $cvv_log
# compare reference verilog to converted succinct
output=`diff $ref_vcd $cvs_vcd`
assertTrue "VE/CS VCDs are different:\n$output" $?