diff options
| author | Jack Koenig | 2019-10-30 22:38:45 -0700 |
|---|---|---|
| committer | Jack Koenig | 2019-10-31 13:44:52 -0700 |
| commit | 28ffacca906c688f01454c4e24768572613e2d00 (patch) | |
| tree | 0cb3be00efe5f48d3bf2d10ff685122b035a4774 /src/main | |
| parent | 68964fed765cd037f3db362a07d4a9ae48c38900 (diff) | |
Guard initial blocks in emitted Verilog with `ifndef SYNTHESIS
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/scala/firrtl/Emitter.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/scala/firrtl/Emitter.scala b/src/main/scala/firrtl/Emitter.scala index c427e0fc..32027f67 100644 --- a/src/main/scala/firrtl/Emitter.scala +++ b/src/main/scala/firrtl/Emitter.scala @@ -878,6 +878,7 @@ class VerilogEmitter extends SeqTransform with Emitter { emit(Seq(s" reg [$width:0] initvar;")) } emit(Seq("`endif")) + emit(Seq("`ifndef SYNTHESIS")) emit(Seq("initial begin")) emit(Seq(" `ifdef RANDOMIZE")) emit(Seq(" `ifdef INIT_RANDOM")) @@ -897,7 +898,8 @@ class VerilogEmitter extends SeqTransform with Emitter { for (x <- initials) emit(Seq(tab, x)) emit(Seq(" `endif // RANDOMIZE")) for (x <- asyncInitials) emit(Seq(tab, x)) - emit(Seq("end")) + emit(Seq("end // initial")) + emit(Seq("`endif // SYNTHESIS")) } for ((clk, content) <- noResetAlwaysBlocks if content.nonEmpty) { |
