From 9dbdb3c87e7ddb75ac937678763b177e0b095523 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Mon, 8 Feb 2016 17:28:09 -0800 Subject: Escape quotes in strings before emitting as Verilog Without this we get failures with the current rocket-chip, when there are assertions with escaped strings in them. --- test/passes/to-verilog/escape-quote.fir | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/passes/to-verilog/escape-quote.fir (limited to 'test') diff --git a/test/passes/to-verilog/escape-quote.fir b/test/passes/to-verilog/escape-quote.fir new file mode 100644 index 00000000..224026a9 --- /dev/null +++ b/test/passes/to-verilog/escape-quote.fir @@ -0,0 +1,18 @@ +; RUN: firrtl -i %s -o %s.v -X verilog ; cat %s.v | FileCheck %s + +;CHECK: module top( +;CHECK: input clk +;CHECK: ); +;CHECK: always @(posedge clk) begin +;CHECK: `ifndef SYNTHESIS +;CHECK: if(1'h1) begin +;CHECK: $fwrite(32'h80000002,"This has an escaped quote (\") in it"); +;CHECK: end +;CHECK: `endif +;CHECK: end +;CHECK: endmodule + +circuit top : + module top : + input clk : Clock + printf(clk, UInt<1>(1), "This has an escaped quote (\") in it") -- cgit v1.2.3