Skip to content

Commit

Permalink
Merge pull request #5961 from htfab/master
Browse files Browse the repository at this point in the history
ppl: escape backslashes in python tests
  • Loading branch information
maliberty authored Oct 16, 2024
2 parents eca4b23 + 8ed9ff2 commit 786d57a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
30 changes: 15 additions & 15 deletions src/ppl/test/group_pins7.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@

ppl_aux.set_io_pin_constraint(
design,
pin_names="req_msg\[10\] req_msg\[11\] req_msg\[12\] req_msg\[13\] "
+ "req_msg\[14\] req_msg\[15\] req_msg\[16\] req_msg\[17\] "
+ "req_msg\[18\] req_msg\[19\] req_msg\[20\] req_msg\[21\] "
+ "req_msg\[22\] req_msg\[23\] req_msg\[0\] req_msg\[1\]",
pin_names=r"req_msg\[10\] req_msg\[11\] req_msg\[12\] req_msg\[13\] "
+ r"req_msg\[14\] req_msg\[15\] req_msg\[16\] req_msg\[17\] "
+ r"req_msg\[18\] req_msg\[19\] req_msg\[20\] req_msg\[21\] "
+ r"req_msg\[22\] req_msg\[23\] req_msg\[0\] req_msg\[1\]",
region="left:*",
)

ppl_aux.set_io_pin_constraint(
design,
pin_names="req_msg\[24\] req_msg\[25\] req_msg\[26\] "
+ "req_msg\[27\] req_msg\[28\] req_msg\[29\] req_msg\[2\] "
+ "req_msg\[30\] req_msg\[31\] req_msg\[3\] req_msg\[4\] "
+ "req_msg\[5\] req_msg\[6\] req_msg\[7\] req_msg\[8\] req_msg\[9\]",
pin_names=r"req_msg\[24\] req_msg\[25\] req_msg\[26\] "
+ r"req_msg\[27\] req_msg\[28\] req_msg\[29\] req_msg\[2\] "
+ r"req_msg\[30\] req_msg\[31\] req_msg\[3\] req_msg\[4\] "
+ r"req_msg\[5\] req_msg\[6\] req_msg\[7\] req_msg\[8\] req_msg\[9\]",
region="bottom:*",
)

ppl_aux.set_io_pin_constraint(
design,
pin_names="clk req_rdy req_val reset resp_msg\[0\] "
+ "resp_msg\[10\] resp_msg\[11\] resp_msg\[12\] "
+ "resp_msg\[13\] resp_msg\[14\] resp_msg\[15\]",
pin_names=r"clk req_rdy req_val reset resp_msg\[0\] "
+ r"resp_msg\[10\] resp_msg\[11\] resp_msg\[12\] "
+ r"resp_msg\[13\] resp_msg\[14\] resp_msg\[15\]",
region="top:*",
)

ppl_aux.set_io_pin_constraint(
design,
pin_names="resp_rdy resp_val resp_msg\[1\] "
+ "resp_msg\[2\] resp_msg\[3\] resp_msg\[4\] "
+ "resp_msg\[5\] resp_msg\[6\] resp_msg\[7\] "
+ "resp_msg\[8\] resp_msg\[9\]",
pin_names=r"resp_rdy resp_val resp_msg\[1\] "
+ r"resp_msg\[2\] resp_msg\[3\] resp_msg\[4\] "
+ r"resp_msg\[5\] resp_msg\[6\] resp_msg\[7\] "
+ r"resp_msg\[8\] resp_msg\[9\]",
region="right:*",
)

Expand Down
6 changes: 5 additions & 1 deletion src/ppl/test/place_pin2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
design, pin_name="resp_val", layer="metal4", location=[12, 50], pin_size=[2, 2]
)
ppl_aux.place_pin(
design, pin_name="req_msg\[0\]", layer="metal10", location=[25, 70], pin_size=[4, 4]
design,
pin_name=r"req_msg\[0\]",
layer="metal10",
location=[25, 70],
pin_size=[4, 4],
)

ppl_aux.place_pins(
Expand Down
2 changes: 1 addition & 1 deletion src/ppl/test/ppl_aux.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def set_io_pin_constraint(
direction -- "input" | "output" | "inout" | "feedthru"
pin_names -- string list of pins to constrain, can contain regex.
Note that we need to escape regex characters for exact matching,
ie, use "rqst\[23\]" instead of "rqst[23]"
ie, use "rqst\\[23\\]" instead of "rqst[23]"
region -- region constraint, e.g. "top:*" or "left:1.2-3.4"
"up" takes an area spec, ie "up:10 10 300 300" or specify
entire area with "up:*"
Expand Down
2 changes: 1 addition & 1 deletion src/ppl/test/random4.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)
ppl_aux.set_io_pin_constraint(
design,
pin_names="req_msg\[15\] req_msg\[14\] resp_msg\[15\] resp_msg\[14\]",
pin_names=r"req_msg\[15\] req_msg\[14\] resp_msg\[15\] resp_msg\[14\]",
region="top:*",
)

Expand Down

0 comments on commit 786d57a

Please sign in to comment.