码迷,mamicode.com
首页 > 其他好文 > 详细

短训练序列---Verilog代码

时间:2020-05-15 23:00:30      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:code   eve   input   ali   ilo   tput   bsp   center   for   

短训练序列---Verilog代码

module short_generator(

    input  wire       FFT_CLK,
    input  wire       RESET,
    input  wire       SHORT_ACK,
    output reg  [7:0] SHORT_RE,
    output reg  [7:0] SHORT_IM,
    output reg  [7:0] SHORT_INDEX,
    output reg        SHORT_DV
);


//---------------------------------------------------------------

reg[3:0] i;
reg[3:0] j;
reg [7:0] shortrom_re [15:0];
reg [7:0] shortrom_im [15:0];


always @ (negedge RESET or posedge FFT_CLK)
begin
    if(!RESET)
    begin
        i=0;
        j=0;

        SHORT_RE=0;
        SHORT_IM=0;
        SHORT_INDEX=0;
        SHORT_DV=0;

        shortrom_re[0]=8b00001100;
        shortrom_re[1]=8b11011110;
        shortrom_re[2]=8b11111101;
        shortrom_re[3]=8b00100100;
        shortrom_re[4]=8b00011000;
        shortrom_re[5]=8b00100100;
        shortrom_re[6]=8b11111101;
        shortrom_re[7]=8b11011110;
        shortrom_re[8]=8b00001100;
        shortrom_re[9]=8b00000001;
        shortrom_re[10]=8b11101100;
        shortrom_re[11]=8b11111101;
        shortrom_re[12]=8b00000000;
        shortrom_re[13]=8b11111101;
        shortrom_re[14]=8b11101100;
        shortrom_re[15]=8b00000001;

        shortrom_im[0]=8b00001100;
        shortrom_im[1]=8b00000001;
        shortrom_im[2]=8b11101100;
        shortrom_im[3]=8b11111101;
        shortrom_im[4]=8b00000000;
        shortrom_im[5]=8b11111101;
        shortrom_im[6]=8b11101100;
        shortrom_im[7]=8b00000001;
        shortrom_im[8]=8b00001100;
        shortrom_im[9]=8b11011110;
        shortrom_im[10]=8b11111101;
        shortrom_im[11]=8b00100100;
        shortrom_im[12]=8b00011000;
        shortrom_im[13]=8b00100100;
        shortrom_im[14]=8b11111101;
        shortrom_im[15]=8b11011110;
        
    end
    else 
    begin
        if(SHORT_ACK)
        begin
            if(i<=9)
            begin
                if(j<15)
                begin
                   SHORT_RE=shortrom_re[j];
                      SHORT_IM=shortrom_im[j];
                   SHORT_DV=1;
                   if(i==0&j==0)
                   begin
                        SHORT_RE=SHORT_RE>>1;
                        SHORT_IM=SHORT_IM>>1;
                   end
                   j=j+1;
                   SHORT_INDEX=SHORT_INDEX+1;
                end
                else 
                begin
                    SHORT_RE=shortrom_re[j];
                    SHORT_IM=shortrom_im[j];
                    SHORT_INDEX=SHORT_INDEX+1;
                    SHORT_DV=1;
                    j=0;
                    i=i+1;
                end
            end
            else 
            begin
                i=0;
                SHORT_RE=shortrom_re[j]>>1; 
                SHORT_IM=shortrom_im[j]>>1;
                SHORT_INDEX=SHORT_INDEX+1;
            end
        end
        else 
        begin
            i=0;
            j=0;
            SHORT_RE=0;
            SHORT_IM=0;
            SHORT_INDEX=0;
            SHORT_DV=0;
        end
    end
end

endmodule



/*


add_force {/short_generator/FFT_CLK} -radix hex {1 0ns} {0 50000ps} -repeat_every 100000ps
add_force {/short_generator/RESET} -radix hex {1 0ns} {0 200ns} {1 300ns}
add_force {/short_generator/SHORT_ACK} -radix hex {0 0ns} {1 600ns}



*/

 

短训练序列---Verilog代码

标签:code   eve   input   ali   ilo   tput   bsp   center   for   

原文地址:https://www.cnblogs.com/chensimin1990/p/12897707.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!