Skip to content

Commit

Permalink
tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
sifferman committed Jan 25, 2024
1 parent 25e8781 commit b32d0a6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Language/SystemVerilog/AST/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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(..))
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions test/core/system_tasks.v
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions test/lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" $?
Expand Down

0 comments on commit b32d0a6

Please sign in to comment.