mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Support split_var in vit files (#2219)
This commit is contained in:
parent
305b4f3c75
commit
7f9aa057bf
2
Changes
2
Changes
@ -13,6 +13,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||
|
||||
**** Suppress REALCVT for whole real numbers.
|
||||
|
||||
**** Support split_var in vlt files, #2219. [Marco Widmer]
|
||||
|
||||
**** Fix parameter type redeclaring a type, #2195. [hdzhangdoc]
|
||||
|
||||
**** Fix VCD open with empty filename, #2198. [Julius Baxter]
|
||||
|
@ -2971,6 +2971,17 @@ behavior. See the test_regress/t/t_dpi_display.v file for an example.
|
||||
Same as /*verilator sformat*/, see L</"LANGUAGE EXTENSIONS"> for more
|
||||
information.
|
||||
|
||||
=item split_var [-module "<modulename>"] [-task "<taskname>"] -var "<varname>"
|
||||
|
||||
=item split_var [-module "<modulename>"] [-function "<funcname>"] -var "<varname>"
|
||||
|
||||
Break the variable into multiple pieces typically to resolve UNOPTFLAT
|
||||
performance issues. Typically the variables to attach this to are
|
||||
recommeded by Verilator itself, see UNOPTFLAT.
|
||||
|
||||
Same as /*verilator split_var*/, see L</"LANGUAGE EXTENSIONS"> for more
|
||||
information.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@ -3484,6 +3495,9 @@ requested but cannot occur a SPLITVAR warning is issued. Splitting large
|
||||
arrays may slow donw the Verilation speed, so use this only on variables
|
||||
that require it.
|
||||
|
||||
Same as C<split_var> in configuration files, see L</"CONFIGURATION FILES">
|
||||
for more information.
|
||||
|
||||
=item /*verilator tag <text...>*/
|
||||
|
||||
Attached after a variable or structure member to indicate opaque (to
|
||||
|
@ -151,6 +151,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
|
||||
"public_module" { FL; return yVLT_PUBLIC_MODULE; }
|
||||
"sc_bv" { FL; return yVLT_SC_BV; }
|
||||
"sformat" { FL; return yVLT_SFORMAT; }
|
||||
"split_var" { FL; return yVLT_SPLIT_VAR; }
|
||||
"tracing_off" { FL; return yVLT_TRACING_OFF; }
|
||||
"tracing_on" { FL; return yVLT_TRACING_ON; }
|
||||
|
||||
|
@ -291,6 +291,7 @@ class AstSenTree;
|
||||
%token<fl> yVLT_PUBLIC_MODULE "public_module"
|
||||
%token<fl> yVLT_SC_BV "sc_bv"
|
||||
%token<fl> yVLT_SFORMAT "sformat"
|
||||
%token<fl> yVLT_SPLIT_VAR "split_var"
|
||||
%token<fl> yVLT_TRACING_OFF "tracing_off"
|
||||
%token<fl> yVLT_TRACING_ON "tracing_on"
|
||||
|
||||
@ -5824,6 +5825,7 @@ vltVarAttrFront<attrtypeen>:
|
||||
| yVLT_PUBLIC_FLAT_RW { $$ = AstAttrType::VAR_PUBLIC_FLAT_RW; v3Global.dpi(true); }
|
||||
| yVLT_SC_BV { $$ = AstAttrType::VAR_SC_BV; }
|
||||
| yVLT_SFORMAT { $$ = AstAttrType::VAR_SFORMAT; }
|
||||
| yVLT_SPLIT_VAR { $$ = AstAttrType::VAR_SPLIT_VAR; }
|
||||
;
|
||||
|
||||
//**********************************************************************
|
||||
|
@ -14,7 +14,8 @@ scenarios(simulator => 1);
|
||||
# %Warning-UNOPTTHREADS: Thread scheduler is unable to provide requested parallelism; consider asking for fewer threads.
|
||||
# So use 6 threads here though it's not optimal in performace wise, but ok.
|
||||
compile(
|
||||
verilator_flags2 => ['--stats' . ($Self->{vltmt} ? ' --threads 6' : '')],
|
||||
verilator_flags2 => ['--stats' . ($Self->{vltmt} ? ' --threads 6' : ''),
|
||||
"$Self->{t_dir}/t_split_var_0.vlt"],
|
||||
);
|
||||
|
||||
execute(
|
||||
|
@ -10,7 +10,11 @@ module barshift_1d_unpacked #(parameter DEPTH = 2, localparam WIDTH = 2**DEPTH)
|
||||
(input [WIDTH-1:0] in, input [DEPTH-1:0] shift, output [WIDTH-1:0] out /*verilator split_var*/);
|
||||
|
||||
localparam OFFSET = -3;
|
||||
`ifdef TEST_ATTRIBUTES
|
||||
logic [WIDTH-1:0] tmp[DEPTH+OFFSET:OFFSET] /*verilator split_var*/;
|
||||
`else
|
||||
logic [WIDTH-1:0] tmp[DEPTH+OFFSET:OFFSET];
|
||||
`endif
|
||||
generate
|
||||
for(genvar i = 0; i < DEPTH; ++i) begin
|
||||
always_comb
|
||||
|
9
test_regress/t/t_split_var_0.vlt
Normal file
9
test_regress/t/t_split_var_0.vlt
Normal file
@ -0,0 +1,9 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2020 by Marco Widmer.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
`verilator_config
|
||||
|
||||
split_var -module "barshift_1d_unpacked" -var "tmp"
|
@ -15,7 +15,8 @@ top_filename("t/t_split_var_0.v");
|
||||
# %Warning-UNOPTTHREADS: Thread scheduler is unable to provide requested parallelism; consider asking for fewer threads.
|
||||
# So use 6 threads here though it's not optimal in performace wise, but ok.
|
||||
compile(
|
||||
verilator_flags2 => ['--cc --trace --stats' . ($Self->{vltmt} ? ' --threads 6' : '')],
|
||||
verilator_flags2 => ['--cc --trace --stats' . ($Self->{vltmt} ? ' --threads 6' : ''),
|
||||
'+define+TEST_ATTRIBUTES'],
|
||||
);
|
||||
|
||||
execute(
|
||||
|
Loading…
Reference in New Issue
Block a user