Internals: Defer AstCast into V3LinkDot, in preparation for future parser
This commit is contained in:
parent
f983ce4875
commit
5083972536
|
@ -2082,6 +2082,12 @@ class WidthVisitor final : public VNVisitor {
|
|||
nodep->replaceWith(newp);
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
userIterate(newp, m_vup);
|
||||
} else if (AstNodeDType* const refp = VN_CAST(nodep->dtp(), NodeDType)) {
|
||||
refp->unlinkFrBack();
|
||||
AstNode* const newp = new AstCast{nodep->fileline(), nodep->lhsp()->unlinkFrBack(),
|
||||
VFlagChildDType{}, refp};
|
||||
nodep->replaceWith(newp);
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
} else {
|
||||
nodep->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: Cast to " << nodep->dtp()->prettyTypeName());
|
||||
|
|
|
@ -5150,8 +5150,7 @@ expr<nodeExprp>: // IEEE: part of expression/constant_expression/
|
|||
// // expanded from simple_type ps_type_identifier (part of simple_type)
|
||||
// // expanded from simple_type ps_parameter_identifier (part of simple_type)
|
||||
| packageClassScopeE idType yP_TICK '(' expr ')'
|
||||
{ $$ = new AstCast{$3, $5, VFlagChildDType{},
|
||||
new AstRefDType{$<fl>2, *$2, $1, nullptr}}; }
|
||||
{ $$ = new AstCastParse{$3, $5, new AstRefDType{$<fl>2, *$2, $1, nullptr}}; }
|
||||
//
|
||||
| yTYPE__ETC '(' exprOrDataType ')' yP_TICK '(' expr ')'
|
||||
{ $$ = new AstCast{$1, $7, VFlagChildDType{},
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2025 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
import vltest_bootstrap
|
||||
|
||||
test.scenarios('simulator')
|
||||
|
||||
test.compile()
|
||||
|
||||
test.passes()
|
|
@ -0,0 +1,33 @@
|
|||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2025 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
`define stop $stop
|
||||
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0);
|
||||
|
||||
typedef enum {
|
||||
UVM_TLM_READ_COMMAND,
|
||||
UVM_TLM_WRITE_COMMAND,
|
||||
UVM_TLM_IGNORE_COMMAND
|
||||
} uvm_tlm_command_e;
|
||||
|
||||
module t(/*AUTOARG*/);
|
||||
|
||||
initial begin
|
||||
bit array[] = new [8];
|
||||
int unsigned m_length;
|
||||
uvm_tlm_command_e m_command;
|
||||
|
||||
m_length = 2;
|
||||
array = '{0, 0, 0, 0, 0, 0, 1, 0};
|
||||
array = new [$bits(m_length)] (array);
|
||||
m_command = uvm_tlm_command_e'({ << bit { array }});
|
||||
|
||||
`checkh(m_command, 'h40)
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Reference in New Issue