Add range specifier support in setuphold
Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
This commit is contained in:
parent
1b908d6360
commit
3e07b14ffc
|
|
@ -1382,17 +1382,38 @@ class WidthVisitor final : public VNVisitor {
|
||||||
|
|
||||||
AstAssignW* newp = nullptr;
|
AstAssignW* newp = nullptr;
|
||||||
|
|
||||||
if (nodep->delrefp() != nullptr) {
|
if (nodep->delrefp()) {
|
||||||
AstNodeVarRef* lhsp = VN_AS(nodep->delrefp()->cloneTreePure(false), VarRef);
|
AstNodeExpr* const lhsp = nodep->delrefp()->cloneTreePure(false);
|
||||||
lhsp->access(VAccess::WRITE);
|
AstNodeExpr* const rhsp = nodep->refevp()->cloneTreePure(false);
|
||||||
AstNodeVarRef* rhsp = VN_AS(nodep->refevp()->cloneTreePure(false), VarRef);
|
if (AstNodeVarRef* varRefp = VN_CAST(lhsp, NodeVarRef)) {
|
||||||
|
varRefp->access(VAccess::WRITE);
|
||||||
|
varRefp->varp()->setForcedByCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AstNodePreSel* selp = VN_CAST(lhsp, NodePreSel)) {
|
||||||
|
if (AstNodeVarRef* varRefp = VN_CAST(selp->fromp(), NodeVarRef)) {
|
||||||
|
varRefp->access(VAccess::WRITE);
|
||||||
|
varRefp->varp()->setForcedByCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newp = new AstAssignW{flp, lhsp, rhsp};
|
newp = new AstAssignW{flp, lhsp, rhsp};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodep->deldatap() != nullptr) {
|
if (nodep->deldatap()) {
|
||||||
AstNodeVarRef* lhsp = VN_AS(nodep->deldatap()->cloneTreePure(false), VarRef);
|
AstNodeExpr* const lhsp = nodep->deldatap()->cloneTreePure(false);
|
||||||
lhsp->access(VAccess::WRITE);
|
AstNodeExpr* const rhsp = nodep->dataevp()->cloneTreePure(false);
|
||||||
AstNodeVarRef* rhsp = VN_AS(nodep->dataevp()->cloneTreePure(false), VarRef);
|
if (AstNodeVarRef* varRefp = VN_CAST(lhsp, NodeVarRef)) {
|
||||||
|
varRefp->access(VAccess::WRITE);
|
||||||
|
varRefp->varp()->setForcedByCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AstNodePreSel* selp = VN_CAST(lhsp, NodePreSel)) {
|
||||||
|
if (AstNodeVarRef* varRefp = VN_CAST(selp->fromp(), NodeVarRef)) {
|
||||||
|
varRefp->access(VAccess::WRITE);
|
||||||
|
varRefp->varp()->setForcedByCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (newp == nullptr) {
|
if (newp == nullptr) {
|
||||||
newp = new AstAssignW{flp, lhsp, rhsp};
|
newp = new AstAssignW{flp, lhsp, rhsp};
|
||||||
|
|
|
||||||
|
|
@ -5792,8 +5792,8 @@ setuphold_timing_check<nodep>: // ==IEEE: $setuphold_timing_check
|
||||||
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ')' ';' { $$ = nullptr; }
|
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ')' ';' { $$ = nullptr; }
|
||||||
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ')' ';' { $$ = nullptr; }
|
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ')' ';' { $$ = nullptr; }
|
||||||
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ',' minTypMaxE ')' ';' { $$ = nullptr; }
|
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ',' minTypMaxE ')' ';' { $$ = nullptr; }
|
||||||
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ',' minTypMaxE ',' terminal_identifierE ')' ';' { $$ = new AstSetuphold{$1, $3, $5, $17}; }
|
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ',' minTypMaxE ',' delayed_referenceE ')' ';' { $$ = new AstSetuphold{$1, $3, $5, $17}; }
|
||||||
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ',' minTypMaxE ',' terminal_identifierE ',' terminal_identifierE ')' ';' { $$ = new AstSetuphold{$1, $3, $5, $17, $19}; }
|
| yD_SETUPHOLD '(' timing_check_event ',' timing_check_event ',' expr ',' expr ',' idAnyE ',' minTypMaxE ',' minTypMaxE ',' delayed_referenceE ',' delayed_referenceE ')' ';' { $$ = new AstSetuphold{$1, $3, $5, $17, $19}; }
|
||||||
;
|
;
|
||||||
|
|
||||||
timing_check_event<nodeExprp>: // ==IEEE: $timing_check_event
|
timing_check_event<nodeExprp>: // ==IEEE: $timing_check_event
|
||||||
|
|
@ -5807,13 +5807,13 @@ timing_check_event<nodeExprp>: // ==IEEE: $timing_check_event
|
||||||
| yEDGE terminal_identifier yP_ANDANDAND expr { $$ = $2; }
|
| yEDGE terminal_identifier yP_ANDANDAND expr { $$ = $2; }
|
||||||
;
|
;
|
||||||
|
|
||||||
terminal_identifier<nodeExprp>:
|
delayed_referenceE<nodeExprp>:
|
||||||
id { $$ = new AstParseRef{$<fl>1, VParseRefExp::PX_TEXT, *$1, nullptr, nullptr}; }
|
/*empty*/ { $$ = nullptr; }
|
||||||
|
| terminal_identifier { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
terminal_identifierE<nodeExprp>:
|
terminal_identifier<nodeExprp>:
|
||||||
/*empty*/ { $$ = nullptr; }
|
idArrayed { $$ = $1; }
|
||||||
| terminal_identifier { $$ = $1; }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
idAnyE<strp>:
|
idAnyE<strp>:
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ module t (/*AUTOARG*/
|
||||||
wire delayed_CLK;
|
wire delayed_CLK;
|
||||||
wire delayed_D;
|
wire delayed_D;
|
||||||
reg notifier;
|
reg notifier;
|
||||||
|
wire [1:0] BL_X = 2'b11;
|
||||||
|
wire [5:0] BL_X2;
|
||||||
|
wire BL_0;
|
||||||
|
wire [3:0] BL_1 = 4'b1100;
|
||||||
|
|
||||||
logic[3:0] sh1 = 1;
|
logic[3:0] sh1 = 1;
|
||||||
logic[3:0] sh2 = 2;
|
logic[3:0] sh2 = 2;
|
||||||
|
|
@ -27,13 +31,19 @@ module t (/*AUTOARG*/
|
||||||
$setuphold (posedge clk, negedge d, 0, 0, notifier,,, delayed_CLK, delayed_D);
|
$setuphold (posedge clk, negedge d, 0, 0, notifier,,, delayed_CLK, delayed_D);
|
||||||
$setuphold (posedge sh1, negedge sh3, 0, 0, notifier,,, sh2, sh4);
|
$setuphold (posedge sh1, negedge sh3, 0, 0, notifier,,, sh2, sh4);
|
||||||
$setuphold (posedge clk, negedge d, 0, 0);
|
$setuphold (posedge clk, negedge d, 0, 0);
|
||||||
|
$setuphold (posedge clk, negedge d, (0:0:0), (0:0:0));
|
||||||
$setuphold (posedge clk, negedge d, 0, 0,,,,,);
|
$setuphold (posedge clk, negedge d, 0, 0,,,,,);
|
||||||
|
$setuphold (posedge clk &&& sh1, BL_X[0], 0, 0, ,,,delayed_CLK, BL_0);
|
||||||
|
$setuphold (posedge clk &&& sh1, BL_1, 0, 0, ,,,delayed_CLK, BL_X2[4:1]);
|
||||||
endspecify
|
endspecify
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
if (sh1 != sh2 || sh3 != sh4) begin
|
if (sh1 != sh2 || sh3 != sh4) begin
|
||||||
$stop;
|
$stop;
|
||||||
end
|
end
|
||||||
|
if (BL_0 != BL_X[0] || BL_1 != BL_X2[4:1]) begin
|
||||||
|
$stop;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
always @(posedge clk) begin
|
always @(posedge clk) begin
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue