diff --git a/Changes b/Changes index 206d397d3..39e4bfb76 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks! *** Support disable for loop escapes. +**** Use 'vluint64_t' for SystemC instead of (same sized) 'uint64' for MSVC++. + * Verilator 3.813 2011/06/28 *** Support bit vectors > 64 bits wide in DPI import and exports. diff --git a/bin/verilator b/bin/verilator index 8f9598f7c..7d6307cce 100755 --- a/bin/verilator +++ b/bin/verilator @@ -268,7 +268,7 @@ descriptions in the next sections for more information. --MP Create phony dependency targets --Mdir Name of output object directory --mod-prefix Name to prepend to lower classes - --no-pins64 Don't use uint64_t's for 33-64 bit sigs + --no-pins64 Don't use vluint64_t's for 33-64 bit sigs --no-skip-identical Disable skipping identical output +notimingchecks Ignored -O0 Disable optimizations @@ -713,7 +713,7 @@ Backward compatible alias for "--pins-bv 65". Note that's a 65, not a 64. =item --pins-bv I Specifies SystemC inputs/outputs of greater than or equal to I bits -wide should use sc_bv's instead of uint32/uint64_t's. The default is +wide should use sc_bv's instead of uint32/vluint64_t's. The default is "--pins-bv 65". Versions before Verilator 3.671 defaulted to "--pins-bv 33". The more sc_bv is used, the worse for performance. @@ -1352,7 +1352,7 @@ will plug directly into a SystemC netlist. The SC_MODULE gets the same pinout as the Verilog module, with the following type conversions: Pins of a single bit become bool. Pins 2-32 bits wide become uint32_t's. Pins 33-64 bits wide become sc_bv's or -uint64_t's depending on the --no-pins64 switch. Wider pins become sc_bv's. +vluint64_t's depending on the --no-pins64 switch. Wider pins become sc_bv's. (Uints simulate the fastest so are used where possible.) Lower modules are not pure SystemC code. This is a feature, as using the @@ -3182,7 +3182,7 @@ as you would any other member variable. Signals are the smallest of 8 bit chars, 16 bit shorts, 32 bit longs, or 64 bit long longs that fits the width of the signal. Generally, you can use -just uint32_t's for 1 to 32 bits, or uint64_t for 1 to 64 bits, and the +just uint32_t's for 1 to 32 bits, or vluint64_t for 1 to 64 bits, and the compiler will properly up-convert smaller entities. Signals wider than 64 bits are stored as an array of 32-bit uint32_t's. diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 9c6146aa1..198444d34 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -185,7 +185,7 @@ string AstVar::cPubArgType(bool named, bool forReturn) const { } else if (isWide()) { arg += "uint32_t"; // []'s added later } else { - arg += "uint64_t"; + arg += "vluint64_t"; } if (isWide()) { if (forReturn) v3error("Unsupported: Public functions with >64 bit outputs; make an output of a public task instead"); @@ -237,7 +237,7 @@ string AstVar::scType() const { return "uint32_t"; } } else { - return "uint64_t"; + return "vluint64_t"; } } diff --git a/test_regress/t/t_extend.v b/test_regress/t/t_extend.v index 4babc6f48..31814f1df 100644 --- a/test_regress/t/t_extend.v +++ b/test_regress/t/t_extend.v @@ -55,7 +55,7 @@ module t (/*AUTOARG*/ #error "`systemc_header didn't work" #endif bool m_did_ctor; - uint32_t my_function() { + vluint32_t my_function() { if (!m_did_ctor) vl_fatal(__FILE__,__LINE__,__FILE__,"`systemc_ctor didn't work"); return 1; } diff --git a/test_regress/t/t_func_public.v b/test_regress/t/t_func_public.v index a187e9bc0..6b3da7b81 100644 --- a/test_regress/t/t_func_public.v +++ b/test_regress/t/t_func_public.v @@ -100,7 +100,7 @@ module tpub ( if (1'b1 != got_bool) $stop; $c("publicGetLong(got_long);"); if (24'h11bca != got_long) $stop; - $c("{ uint64_t qq; publicGetQuad(qq); got_quad=qq; }"); + $c("{ vluint64_t qq; publicGetQuad(qq); got_quad=qq; }"); if (60'haaaa_bbbb_cccc != got_quad) $stop; $c("{ WData gw[3]; publicGetWide(gw); VL_ASSIGN_W(72,got_wide,gw); }"); if (72'hac_abca_aaaa_bbbb_1234 != got_wide) $stop; diff --git a/test_regress/t/t_var_pins_sc64.pl b/test_regress/t/t_var_pins_sc64.pl index 20a8cb72e..d0ecf9d1d 100755 --- a/test_regress/t/t_var_pins_sc64.pl +++ b/test_regress/t/t_var_pins_sc64.pl @@ -21,14 +21,14 @@ if ($Self->{v3}) { file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i8;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i16;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i32;/x); - file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i64;/x); + file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i64;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in\s> \s+ i65;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o1;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o8;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o16;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o32;/x); - file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o64;/x); + file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o64;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out\s> \s+ o65;/x); } diff --git a/test_regress/t/t_var_pins_scui.pl b/test_regress/t/t_var_pins_scui.pl index 26b69c522..97bdafb71 100755 --- a/test_regress/t/t_var_pins_scui.pl +++ b/test_regress/t/t_var_pins_scui.pl @@ -21,14 +21,14 @@ if ($Self->{v3}) { file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i8;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i16;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i32;/x); - file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i64;/x); + file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in \s+ i64;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_in\s> \s+ i65;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o1;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o8;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o16;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o32;/x); - file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o64;/x); + file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out \s+ o64;/x); file_grep ("$Self->{obj_dir}/$Self->{VM_PREFIX}.sp", qr/sc_out\s> \s+ o65;/x); } diff --git a/test_sc/sc_main.cpp b/test_sc/sc_main.cpp index 43629e1e8..f509fdc84 100644 --- a/test_sc/sc_main.cpp +++ b/test_sc/sc_main.cpp @@ -60,11 +60,11 @@ int sc_main(int argc, char* argv[]) { cout << "Defining Interconnect\n"; sc_signal reset_l; sc_signal passed; - sc_signal in_small; - sc_signal in_quad; + sc_signal in_small; + sc_signal in_quad; sc_signal > in_wide; - sc_signal out_small; - sc_signal out_quad; + sc_signal out_small; + sc_signal out_quad; sc_signal > out_wide; //========== diff --git a/test_verilated/vgen.pl b/test_verilated/vgen.pl index 4c5f9051c..bfd01b557 100755 --- a/test_verilated/vgen.pl +++ b/test_verilated/vgen.pl @@ -832,8 +832,8 @@ sub decl_text { my $varref = $Vars{$var}; if ($Opt_Sc) { (!$varref->{signed}) or die "%Error: No signed SystemC yet\n"; - my $type = (( ($varref->{val}->Size == 32) && "uint32_t") - || (($varref->{val}->Size == 64) && "uint64_t")); + my $type = (( ($varref->{val}->Size == 32) && "sc_dt::uint32") + || (($varref->{val}->Size == 64) && "sc_dt::uint64")); $type or die "%Error: Unknown Size ".$varref->{val}->Size,","; return sprintf " %s<%s> %s; //=%s" , $decl_with, $type, $var, $varref->{val}->to_Hex;