블로그 이미지
stluck

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday

'정규식 verilog VHDL 포트 변환'에 해당되는 글 1건

  1. 2009.06.17 VHDL entity를 Verilog에서 Instancation 정규식 이용하기 1
2009. 6. 17. 00:50 Programming/Verilog(A)/SVerilog
 ts_top_tx_mpw fts_top_tx_mpw(
    .clk    :    in std_logic;
    .reset    :    in std_logic;
   
    .c_reset : in std_logic;
    .c_reset_out : out std_logic;

    .da_out_i : out std_logic_vector(7 downto 0);
    .da_out_q : out std_logic_vector(7 downto 0);
    .dac_clk_i : out std_logic;
    .dac_clk_q : out std_logic;
    .wrt_out_i : out std_logic;
    .wrt_out_q : out std_logic;

위와 같은 VHDL 코드가 있을 경우,, (Port Instance를 쉽게하기위하여 .을 미리 붙여준다. 물론 Ctrl+q . [ESC] 를 이용하여,, 또는 : 앞의 포트이름만 선택해서 .을 붙여줘도 좋을듯하다.)


%s/\.\(\([a-zA-Z_0-9]\)*\)\s*:\s*\([a-zA-Z0-9_" "();]\)*/\.\1(p_\1),/g

하면,,

ts_top_tx_mpw fts_top_tx_mpw(
    .clk(clk),
    .reset(reset),
   
    .c_reset(c_reset),
    .c_reset_out(c_reset_out),

    .da_out_i(da_out_i),
    .da_out_q(da_out_q),
    .dac_clk_i(dac_clk_i),
    .dac_clk_q(dac_clk_q),
    .wrt_out_i(wrt_out_i),
    .wrt_out_q(wrt_out_q),

로 바꿔준다.  ^_^ ㅋㅋㅋ


7,39s/\.\(\([a-zA-Z_0-9]\)*\)\s*:\s*\(\([a-zA-Z0-9_" "();]\)*\)/\.\1(tx_\1),\t\t\/\/\3/g

ts_top_tx_mpw fts_top_tx_mpw(
    .clk(tx_clk),        //in std_logic;
    .reset(tx_reset),        //in std_logic;
   
    .c_reset(tx_c_reset),        //in std_logic;
    .c_reset_out(tx_c_reset_out),        //out std_logic;
---------------------------------------
    .da_out_i(tx_da_out_i),        //out std_logic_vector(7 downto 0);
    .da_out_q(tx_da_out_q),        //out std_logic_vector(7 downto 0);
    .dac_clk_i(tx_dac_clk_i),        //out std_logic;
    .dac_clk_q(tx_dac_clk_q),        //out std_logic;
    .wrt_out_i(tx_wrt_out_i),        //out std_logic;
    .wrt_out_q(tx_wrt_out_q),        //out std_logic;

posted by stluck