Skip to content

Commit

Permalink
Merge pull request #46 from christian-lanius/escaped_character_fix
Browse files Browse the repository at this point in the history
allow backslash in string, fixes issue #45
  • Loading branch information
kgugala committed Apr 6, 2021
2 parents e307c81 + 9ad24f9 commit 5b9dc79
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 sdf_timing/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 sdf_timing/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 5b9dc79

Please sign in to comment.