亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? auto_baud_with_tracking.v

?? ALTERA NIOS處理器實驗
?? V
?? 第 1 頁 / 共 2 頁
字號:


// This is the CLOCK_FACTOR_PP prescaler and also mid_bit_count counter
assign enable_clock_count = measure || (verify && main_count_rollover);
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) clock_count <= 0;
  else if (clear_counters) clock_count <= 0;
  else if (enable_clock_count)
  begin  // Must have been clk_i edge
    if (clock_count_rollover) clock_count <= 0;
    else clock_count <= clock_count + 1;
  end
end
// Counter rollover condition
assign clock_count_rollover = (clock_count == (CLOCK_FACTOR_PP-1));
// This condition signals the middle of a bit time, for use during the
// verify stage.  Also, this signal is used to advance the main count,
// instead of "clock_count_rollover."  This produces an effective "rounding"
// operation for the measurement (which would otherwise "truncate" any
// fraction of time contained in this counter at the instant the measurement
// is finished.
// (The "enable_clock_count" is included in order to make the pulse narrow,
//  only one clock wide...)
assign mid_bit_count = (
                        (clock_count == ((CLOCK_FACTOR_PP>>1)-1))
                        && enable_clock_count
                        );

// This is the main counter.  During measurement, it advances once for
// each CLOCK_FACTOR_PP cycles of clk_i.  This accumulated measurement
// is then latched into "measurement" when the state machine determines that
// the measurement interval is finished.
// During verify time (when the new candidate baud rate clock is being tested)
// this counter is allowed to run freely, advancing once each clk_i, but being
// reset when it reaches a total count of "measurement" clock cycles.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) main_count <= 0;
  else // must have been clk_i edge
  begin
    // Clear main count when measurement is done
    if (clear_counters) main_count <= 0;
    // If measuring, advance once per CLOCK_FACTOR_PP clk_i pulses.
    else if (measure && mid_bit_count) main_count <= main_count + 1;
    // If verifying or running, check reset conditions, 
    // otherwise advance always.
    else if (verify)
    begin
      if (main_count_rollover) main_count <= 0;
      else main_count <= main_count + 1;
    end
  end
end
// This is the "verify" baud clock signal... not the final output one.
assign main_count_rollover = (main_count == measurement);


// This is the BAUD counter.  Once a measurement has been verified, it is
// stored in "baud" and the signal "run" goes high.  From then on, this
// counter is allowed to run freely, advancing once each clk_i, but being
// reset when it reaches a total count of "baud" clock cycles.  This
// counter's reset signal is the output baud rate clock.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) baud_count <= 0;
  else // must have been clk_i edge
  begin
    // If running, advance freely
    if (run)
    begin
      if (baud_count_rollover) baud_count <= 0;
      else baud_count <= baud_count + 1;
    end
  end
end
assign baud_count_rollover = (baud_count == baud);

// This is a shift register used to provide "target" character bits one at
// a time for verification as they are "received" (sampled) using the
// candidate baud clock.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) target_bits <= `TEMPLATE_BITS;
  else // must have been a clock edge
  begin
    if (~verify) target_bits <= `TEMPLATE_BITS;
    if (verify && mid_bit_count) target_bits <= {0,(target_bits>>1)};
  end
end
// It is done when only the stop bit is left in the shift register.
assign verify_done = (
                       (target_bits == 1)
                       && verify
                       && mid_bit_count
                      );

// This is a flip-flop used to keep track of whether the verify operation
// is succeeding or not.  Any target bits that do not match the received
// data at the sampling edge, will cause the verify_failed bit to go high.
// This is what the state machine looks at to determine whether it passed
// or not.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) character_miscompare <= 0;
  else  // Must have been a clock edge
  begin
    if (idle) character_miscompare <= 0;
    if (verify && mid_bit_count
        && (target_bits[0] ^ serial_dat_i)) character_miscompare <= 1;
  end
end


// This is the measurement storage latch.  The final measured time count
// from main_count is stored in this latch upon completion of the measurement
// interval.  The value stored in this latch is used for the baud clock
// generated during verify, but a different register holds the actual value
// being used to generate output.
always @(posedge clk_i or posedge idle)
begin
  // Set to all ones during idle (asynchronous).
  if (idle) measurement <= -1;
  // Otherwise, there must have been a clk_i edge
  // When the measurement is done, the counters are cleared, and the time
  // interval must be stored before it is cleared away...
  // This also causes a store following a failed verify state on the way back
  // into idle, but the idle state clears out the false measurement anyway.
  else if (clear_counters) measurement <= (main_count>>1);
end

// This is the BAUD storage latch.  The final verified time count
// from the "measurement" register is stored in this register after a good
// verify.  The value stored in this latch is used in conjunction with
// baud_count to produce the baud clock which is sent to the output.
always @(posedge clk_i or posedge reset_i)
begin
  // Set to all ones during reset (asynchronous).
  if (reset_i) baud <= -1;
  // Otherwise, there must have been a clk_i edge
  // When the measurement is done, the counters are cleared, and the time
  // interval must be stored before it is cleared away...
  // This also causes a store following a failed verify state on the way back
  // into idle, but the idle state clears out the false measurement anyway.
  else if (verify_good) baud <= measurement;
end

// This is a flip-flop used to keep track of whether the unit is producing
// a baud clock or not.  Initially following reset, there is no baud clock
// being produced.  But, once a single measurement is verified, then the
// clock is produced and tracking changes are made over time.  Thus, this
// bit goes high as a result of the first "verify_good" pulse, and it remains
// high forever, until the unit is reset.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) run <= 0;
  else  // Must have been a clock edge
  begin
    if (verify_good) run <= 1;
  end
end

assign baud_clk_o = baud_count_rollover;


// This is state machine m1.  It checks the status of the serial_dat_i line
// and coordinates the measurement of the time interval of the first two
// bits of the received character, which is the "measurement interval."
// Following the measurement interval, the state machine enters a new
// phase of bit verification.  If the measured time interval is accurate
// enough to measure the remaining 8 bits of the character correctly, then
// the measurement is accepted, and the baud rate clock is driven onto
// the baud_clk_o output pin.  Incidentally, the process of verification
// effectively filters out all characters which are not the desired target
// character for measurement.  In this case, the target character is the
// carriage return.


// State register
always @(posedge clk_i or posedge reset_i)
begin : m1_state_register
  if (reset_i) m1_state <= m1_idle;          // asynchronous reset
  else m1_state <= m1_next_state;
end

// State transition logic
always @(m1_state
         or mid_bit_count
         or serial_dat_i
         or verify_done
         or character_miscompare
         )
begin : m1_state_logic

  // Default values for outputs.  The individual states can override these.
  idle <= 1'b0;
  verify_good <= 1'b0;
  measure <= 1'b0;
  clear_counters <= 1'b0;
  verify <= 1'b0;

  case (m1_state) // synthesis parallel_case

    m1_idle :
      begin
        idle <= 1'b1;
        if (serial_dat_i == 0) m1_next_state <= m1_measure_0;
        else m1_next_state <= m1_idle;
      end

    m1_measure_0 :
      begin
        measure <= 1'b1;
        // Check at mid bit time, to make sure serial line is still low...
        // (At this time, "mid_bit_count" is simply CLOCK_FACTOR_PP>>1 clk_i's.)
        if (mid_bit_count && ~serial_dat_i) m1_next_state <= m1_measure_1;
        // If it is not low, then it must have been a "glitch"...
        else if (mid_bit_count && serial_dat_i) m1_next_state <= m1_idle;
        else m1_next_state <= m1_measure_0;
      end

    m1_measure_1 :
      begin
        measure <= 1'b1;
        // Look for first data bit (high).
        if (serial_dat_i) m1_next_state <= m1_measure_2;
        // If it is not high keep waiting...
        // (Put detection of measurement overflow in here if necessary...)
        else m1_next_state <= m1_measure_1;
      end

    m1_measure_2 :
      begin
        measure <= 1'b1;
        // Check using mid bit time, to make sure serial line is still high...
        // (At this time, "mid_bit_count" is simply CLOCK_FACTOR_PP>>1 clk_i's.)
        if (mid_bit_count && serial_dat_i) m1_next_state <= m1_measure_3;
        // If it is not high, then it must have been a "glitch"...
        else if (mid_bit_count && ~serial_dat_i) m1_next_state <= m1_idle;
        else m1_next_state <= m1_measure_2;
      end

    m1_measure_3 :
      begin
        measure <= 1'b1;
        // Look for end of measurement interval (low)
        if (!serial_dat_i) m1_next_state <= m1_measure_4;
        // If it is not high keep waiting...
        // (Put detection of measurement overflow in here if necessary...)
        else m1_next_state <= m1_measure_3;
      end

    // This state outputs a reset pulse, to clear counters and store the
    // measurement from main_count.
    m1_measure_4 :
      begin
        clear_counters <= 1'b1; // Clears counters, stores measurement
        m1_next_state <= m1_verify_0;
      end

    m1_verify_0 :  // Wait for verify operations to finish
      begin
        verify <= 1'b1;
        if (verify_done) m1_next_state <= m1_verify_1;
        else m1_next_state <= m1_verify_0;
      end

    // NOTE: This "extra" state is needed because the character_miscompare
    //       information is not valid until 1 cycle after verify_done is
    //       active.
    m1_verify_1 :  // Checks for character miscompare
      begin
        if (character_miscompare) m1_next_state <= m1_verify_failed;
        else m1_next_state <= m1_run;
      end

    m1_verify_failed : // Resets counters on the way back to idle
      begin
        clear_counters <= 1'b1;
        m1_next_state <= m1_idle;
      end

    // This state is for successful verification results!
    // Since this is a tracking unit, the "run" output is used as a pulse
    // to store the now verified rate.
    m1_run :       
      begin
        verify_good <= 1'b1;
        m1_next_state <= m1_idle;
      end

    default : m1_next_state <= m1_idle;
  endcase
end


assign auto_baud_locked_o = run;


endmodule

//`undef LOG2_MAX_CLOCK_FACTOR

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区三区香蕉蜜桃| 678五月天丁香亚洲综合网| 国内精品久久久久影院薰衣草| 天堂蜜桃一区二区三区| 亚洲国产日韩综合久久精品| 一区二区在线电影| 一区二区三区日韩精品视频| 一区二区三区精品视频在线| 一区二区三区在线播放| 亚洲一区二区三区爽爽爽爽爽| 成人一道本在线| 白白色 亚洲乱淫| 色综合网色综合| 欧美人动与zoxxxx乱| 6080亚洲精品一区二区| 精品国产制服丝袜高跟| 久久免费视频色| 中文字幕中文字幕在线一区| 亚洲婷婷综合久久一本伊一区| 亚洲欧美激情插| 日韩国产欧美在线播放| 国产一区福利在线| www.综合网.com| 欧美日韩黄视频| 久久午夜电影网| 国产精品国产三级国产aⅴ中文| 亚洲精品成人天堂一二三| 日韩精品久久久久久| 九九九精品视频| 成人免费视频视频在线观看免费| 91婷婷韩国欧美一区二区| 欧洲日韩一区二区三区| 日韩一区二区三区四区| 久久精品欧美一区二区三区不卡| 中文字幕欧美一区| 日本最新不卡在线| 成人午夜短视频| 一区二区三区欧美在线观看| 日韩成人午夜电影| 国产成人精品一区二区三区四区| 色哟哟一区二区三区| 欧美一区二区三区四区五区| 国产欧美一区二区三区在线看蜜臀 | 亚洲成人在线免费| 开心九九激情九九欧美日韩精美视频电影| 粉嫩aⅴ一区二区三区四区| 在线观看视频一区| 久久综合久久综合亚洲| 一级日本不卡的影视| 久久精品国产色蜜蜜麻豆| hitomi一区二区三区精品| 欧美一区三区四区| 亚洲日本在线视频观看| 麻豆视频一区二区| 99精品热视频| 精品粉嫩超白一线天av| 亚洲国产毛片aaaaa无费看| 国产裸体歌舞团一区二区| 欧美日韩国产成人在线91 | 国产在线精品一区二区 | 依依成人精品视频| 国产一区二区福利视频| 91国内精品野花午夜精品 | 激情综合色综合久久综合| 色哟哟日韩精品| 中文字幕不卡的av| 精品一区二区三区久久| 欧美视频一区二区三区| 中文字幕一区在线| 国产精品一区二区久久精品爱涩| 欧美精品99久久久**| 亚洲天天做日日做天天谢日日欢| 精品一区二区三区在线观看 | 欧美日韩一级大片网址| 国产精品―色哟哟| 国产一区二区0| 日韩欧美色综合网站| 亚洲精品国久久99热| 成人免费电影视频| 精品成人免费观看| 青青国产91久久久久久| 欧美性欧美巨大黑白大战| 亚洲乱码国产乱码精品精可以看| 国产乱码精品一区二区三区忘忧草| 6080亚洲精品一区二区| 午夜婷婷国产麻豆精品| 色呦呦网站一区| 亚洲激情校园春色| 国产精品久久久久久久久免费桃花| 美国十次了思思久久精品导航| 欧美日韩不卡一区二区| 亚洲一卡二卡三卡四卡五卡| aaa亚洲精品一二三区| 欧美国产精品一区| 成人午夜视频网站| 国产精品久久一级| 成人免费毛片片v| 中文字幕中文字幕中文字幕亚洲无线| 国产91精品一区二区| 中文字幕成人av| 成人免费观看视频| 亚洲欧美在线视频| 色婷婷综合久久久中文字幕| 一区二区三区在线视频观看58| 色婷婷av一区二区三区大白胸 | 91视频国产资源| 亚洲视频在线观看一区| 本田岬高潮一区二区三区| 自拍偷拍亚洲激情| 色一情一伦一子一伦一区| 一区二区三区不卡在线观看 | 欧美一级午夜免费电影| 男男视频亚洲欧美| 久久婷婷综合激情| 成人黄色免费短视频| 国产精品美女www爽爽爽| 99久久精品免费看国产 | www.日韩精品| 亚洲黄一区二区三区| 欧美日韩三级在线| 捆绑变态av一区二区三区| 国产欧美日韩不卡免费| 99在线热播精品免费| 亚洲午夜免费视频| 日韩无一区二区| 国产电影一区二区三区| 亚洲视频在线观看三级| 欧美日韩国产美女| 久久网这里都是精品| 亚洲欧美色一区| 99久久精品国产毛片| 亚洲精品一二三四区| 欧美日韩黄色一区二区| 精品亚洲aⅴ乱码一区二区三区| 国产三级一区二区| 91麻豆免费观看| 日韩精品久久久久久| 国产午夜亚洲精品理论片色戒| 91视频国产观看| 久久精品国产亚洲a| 中文字幕在线观看不卡视频| 欧美日韩国产一级| 奇米综合一区二区三区精品视频| 1000精品久久久久久久久| 中文字幕免费不卡| 久久这里只有精品视频网| 亚洲欧美另类图片小说| 日韩一区在线免费观看| 麻豆精品在线看| 日韩精品一区在线| eeuss影院一区二区三区| 午夜精品免费在线| 久久婷婷成人综合色| 亚洲二区在线观看| 精品一区精品二区高清| 色综合久久六月婷婷中文字幕| 欧美亚洲综合另类| 亚洲人成精品久久久久| 色香蕉久久蜜桃| 亚洲r级在线视频| 91在线一区二区三区| 一本色道综合亚洲| 欧美精品一区二区三区四区| 26uuu另类欧美亚洲曰本| 亚洲人成在线观看一区二区| 九色综合狠狠综合久久| 在线视频你懂得一区二区三区| 亚洲蜜臀av乱码久久精品| 日韩一区精品视频| jvid福利写真一区二区三区| 亚洲日本成人在线观看| 狠狠色丁香久久婷婷综合_中 | 中文字幕欧美一| 国产一区二区免费看| 日本二三区不卡| 中文字幕的久久| 免费观看久久久4p| 69av一区二区三区| 久久99精品国产麻豆婷婷洗澡| 欧美群妇大交群中文字幕| 亚洲午夜在线视频| 3atv在线一区二区三区| 亚洲国产欧美日韩另类综合| 成人爽a毛片一区二区免费| 国产精品色婷婷| 国产大陆a不卡| 91精品国产一区二区| 丝袜美腿亚洲综合| 欧洲精品视频在线观看| 国产精品美女一区二区三区| 成人午夜精品一区二区三区| 日韩天堂在线观看| 日本不卡在线视频| 6080亚洲精品一区二区| 日本美女一区二区三区视频| 欧美一区二区三区的| 亚洲一区二区欧美| 在线91免费看| 国产电影一区二区三区| 亚洲成a天堂v人片|