Skip to content

Commit

Permalink
allow backslash in string, fixes issue chipsalliance#45
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Lanius <christian.lanius@rwth-aachen.de>
  • Loading branch information
christian-lanius committed Apr 6, 2021
1 parent e307c81 commit b167e27
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdf_timing/sdflex.py
Expand Up @@ -150,7 +150,7 @@ def t_SLASH(t):


def t_STRING(t):
r'[a-zA-Z0-9_\/.\[\]]+'
r'[a-zA-Z0-9_\/.\[\]\\\\]+'
t.type = reserved.get(t.value, 'STRING')
return t

Expand Down
16 changes: 16 additions & 0 deletions tests/data/escaped_name.sdf
@@ -0,0 +1,16 @@
(DELAYFILE
(SDFVERSION "3.0")
(TIMESCALE 1ps)

(CELL
(CELLTYPE "vpr_interconnect")
(INSTANCE dut/routing_segment_b0_output_0_0_to_c0_input_0_0)
(DELAY
(ABSOLUTE
(INTERCONNECT clk_i TESTENV/clock_generator/clk_mux/CLK1 (1.4:8.4:8.4)(1.6:7.7:7.7))
(INTERCONNECT rstn_i TESTENV/reset_synchronizer_genblk1\[0\]\.ff_1_reg/RESET (3.7:3.5:3.5)(3.8:3.5:3.5))
(INTERCONNECT rstn_i TESTENV/reset_synchronizer_genblk1\[0\]\.ff_2_reg/RESET (3.7:3.5:3.5)(3.8:3.5:3.5))
)
)
)
)
16 changes: 16 additions & 0 deletions tests/data/golden/escaped_name.sdf
@@ -0,0 +1,16 @@
(DELAYFILE
(SDFVERSION "3.0")
(TIMESCALE 1ps)

(CELL
(CELLTYPE "vpr_interconnect")
(INSTANCE dut/routing_segment_b0_output_0_0_to_c0_input_0_0)
(DELAY
(ABSOLUTE
(INTERCONNECT clk_i TESTENV/clock_generator/clk_mux/CLK1 (1.4:8.4:8.4)(1.6:7.7:7.7))
(INTERCONNECT rstn_i TESTENV/reset_synchronizer_genblk1\[0\]\.ff_1_reg/RESET (3.7:3.5:3.5)(3.8:3.5:3.5))
(INTERCONNECT rstn_i TESTENV/reset_synchronizer_genblk1\[0\]\.ff_2_reg/RESET (3.7:3.5:3.5)(3.8:3.5:3.5))
)
)
)
)

0 comments on commit b167e27

Please sign in to comment.