Reputation: 499
I have a following line:
set_property LOC DSP48E2_X0Y0 [get_cells{name[0].dut/mm1/dsp_chain[0].dsp_inst}];
I want to replace DSP48E2_X0Y{number}
to DSP48E2_X0Y{number+5}
I followed a thread on Stack overflow and I tried to use awk command:
echo "set_property LOC DSP48E2_X0Y0 [get_cells {name[0].dut/mm1/dsp_chain[0].dsp_inst}];" | awk `{ printf "%s %s %s_X%dY%d", $1, $2, $3, $4, $5+5}`
but I am getting errors:
bad math expression: operand expected at `,'
Upvotes: 2
Views: 235
Reputation: 85897
To answer the question in your title: Yes, just start the replacement with \=
.
In your case,
:s/DSP48E2_X0Y\zs\d\+/\=submatch(0)+5/
would do it.
(No idea what all that awk stuff is about.)
Upvotes: 3