From ecf508ec235ee1c218bf6e7b216373df653273f4 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 28 Jul 2012 08:25:27 -0400 Subject: [PATCH] Fix replicate verilog dump being backwards --- src/V3AstNodes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 07777aca1..2061b3621 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -3767,6 +3767,7 @@ struct AstConcat : public AstNodeBiop { virtual int instrCount() const { return widthInstrs()*2; } }; struct AstReplicate : public AstNodeBiop { + // Verilog {rhs{lhs}} - Note rhsp() is the replicate value, not the lhsp() AstReplicate(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) { if (AstConst* constp=rhsp->castConst()) { dtypeSetLogicSized(lhsp->width()*constp->toUInt(), lhsp->width()*constp->toUInt(), AstNumeric::UNSIGNED); @@ -3776,7 +3777,7 @@ struct AstReplicate : public AstNodeBiop { : AstNodeBiop(fl, lhsp, new AstConst(fl, repCount)) {} ASTNODE_NODE_FUNCS(Replicate, REPLICATE) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opRepl(lhs,rhs); } - virtual string emitVerilog() { return "%f{%l{%k%r}}"; } + virtual string emitVerilog() { return "%f{%r{%k%l}}"; } virtual string emitC() { return "VL_REPLICATE_%nq%lq%rq(%nw,%lw,%rw, %P, %li, %ri)"; } virtual bool cleanOut() {return false;} virtual bool cleanLhs() {return true;} virtual bool cleanRhs() {return true;}