Let's say there is a TOP module, one logic (logic1) and one test logic (logic2) like in the left picture.
I want to exclude test logic like in the right picture (all verilog form).
At first, If we suppose all the logics (logic and test logic) are instantiated inside the TOP module,
The left side of verilog code would be something like this. (Let's say a-> blue, b-> yellow, c-> red, d-> green, signal b penetrates test logic)
module TOP (
input a1,
input b1,
input c1,
output d1
);
wire b2;
wire c2;
logic1 U_logic(
.A (a1),
.B (b2),
.C (c2),
.D (d1),
);
logic2 U_testlogic(
.B (b2),
.C_IN (c1),
.C (c2),
);
endmodule
The right side of verilog code would be something like this.
module TOP (
input a1,
input b1,
input c1,
output d1
);
logic1 U_logic(
.A (a1),
.B (b1),
.C (c1),
.D (d1),
);
endmodule
If the number of logics and test logics are more than 100, and it is hard to exclude all the test logic manually, How can I deal with this automatically by using Python code (The number of logics and test logics are same)?
The main goal is to convert port signal of test logic (logic2) to port signal of logic (logic1) and remove test logic. [ex. c2->c1 (.C port signal -> .C_IN port signal), b2->b1 (penetrating signal -> specific input), remove logic2]
.B_IN (b1)
intest_logic
? - TomerikooU_logic
's interface and change the portsx2
tox1
. The question is what is the real criteria for replacement - Tomerikooa
,b
, etc. And the outputs from the test logic are pre/suffixed like let's saya_test
,b_test
, etc. then all you need to do is something likere.sub(r"(w+)_test", "\1", line)
for each line of the interface - Tomerikoo