1

I am trying a search and replace because I am using some macros in my code. I want to replace tb.DUT.genblk4[0].U_rap_cisfd_wrapper this with `RAP_CISFD_WRAP_I in vim.

I tried using

:%s/tb\.DUT\.genblk4[0\]\.U_rap_cisfd_wrapper/`RAP_CISFD_WRAP_I/gc

But it is saying pattern not found. Help?

Sample code:

begin   

    force tb.DUT.genblk4[0].U_rap_cisfd_wrapper.agent_ops_mem_inst_0.u_ops_mem.wbe_a = 8'hFF;
    force tb.DUT.genblk4[0].U_rap_cisfd_wrapper.agent_ops_mem_inst_0.u_ops_mem.wr_rd_en_a = 1'b1;
    force tb.DUT.genblk4[0].U_rap_cisfd_wrapper.agent_ops_mem_inst_0.u_ops_mem.addr_a = 15'h0000 + 15'h1*d0;
    force tb.DUT.genblk4[0].U_rap_cisfd_wrapper.agent_ops_mem_inst_0.u_ops_mem.data_inp_a = data_ops;
    d0=d0+1;
    @(posedge tb.DUT.genblk4[0].U_rap_cisfd_wrapper.agent_ops_mem_inst_0.u_ops_mem.clk);
end
1

1 Answer 1

2

You need to also escape the [ character otherwise Vim consider it as the beginning of the /[] pattern atom which create a group containing the characters between [ and ]

%s;tb\.DUT\.genblk4\[0\]\.U_rap_cisfd_wrapper;`RAP_CISFD_WRAP;gc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.