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

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

?? rs232_syscon_v.htm

?? This a state-machine driven rs232 serial port interface to a "Wishbone" // type of bus.
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
          m1_next_state <= m1_get_qty_field;
          store_qty <= 1;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_whitespace || char_is_enter) begin  // Normal exit
          m1_next_state <= m1_start_execution;
        end
        else m1_next_state <= m1_qty_error_indicator;
      end

    // This state seeks to obtain master_bg_i, which grants the bus to
    // rs232_syscon.
    m1_start_execution :
      begin
        rs232_echo <= 1;           // Don't send message characters
        reset_watchdog <= 1;       // Reset the timer.
        reset_adr_offset <= 1;     // Reset the address offset.
        reset_rd_field_count <= 1; // Reset the rd_field_count.
        m1_next_state <= m1_request_bus;
      end

    m1_request_bus :
      begin
        rs232_echo <= 1;          // Don't send message characters
        master_br_o <= 1;         // Request the bus.
        if (master_bg_i) m1_next_state <= m1_bus_granted;
        else if (watchdog_timer_done) begin
          m1_next_state <= m1_bg_error_indicator;
        end
        else m1_next_state <= m1_request_bus;
      end

    m1_bus_granted :
      begin
        rs232_echo <= 1;          // Don't send message characters
        master_br_o <= 1;         // Keep holding the bus
        reset_watchdog <= 1;      // Reset the timer.
        if (adr_offset != qty_sr) m1_next_state <= m1_execute;
        else m1_next_state <= m1_send_ok;
      end

    // This single state does reset/write/read depending upon the value
    // contained in "command"!
    m1_execute :
      begin
        rs232_echo <= 1;          // Don't send message characters
        master_br_o <= 1;         // Keep holding the bus
        stb_l <= 1'b1;            // Show that a bus cycle is happening
        case (command)            // Assert the appropriate signals
          `CMD_I : rst_o <= 1;
          `CMD_R : capture_dat <= ack_i;
          `CMD_W : we_l <= 1;
          default: ;
        endcase
        if (watchdog_timer_done || err_i) begin
          m1_next_state <= m1_ack_error_indicator;
        end
        else if (ack_i
                 && (command == `CMD_R)
                 && (rd_field_count == 0)
                 )
        begin
          m1_next_state <= m1_rd_send_adr_sr; // Leads to a new address line.
          reset_rd_digit_count <= 1;
          incr_adr_offset <= 1;               // move to the next address
        end
        else if (ack_i && (command == `CMD_R)) begin
          m1_next_state <= m1_rd_send_dat_sr; // Leads to a new data field.
          reset_rd_digit_count <= 1;
          reset_msg_offset <= 1;
          incr_adr_offset <= 1;             // move to the next address
        end
        else if (ack_i) begin
          m1_next_state <= m1_bus_granted;  // continue to the next cycle
          incr_adr_offset <= 1;             // move to the next address
        end
        else m1_next_state <= m1_execute;
      end

    m1_rd_send_adr_sr :
      begin
        msg_base <= {1'b0,rd_adr_sr[`NIBBLE_SIZE*ADR_DIGITS_PP-1:
                                    `NIBBLE_SIZE*(ADR_DIGITS_PP-1)]};
        if ((rd_digit_count == ADR_DIGITS_PP-1) && rs232_tx_load) begin
          m1_next_state <= m1_rd_send_separator;
          reset_msg_offset <= 1;
        end
        else if (rs232_tx_load) begin
          shift_rd_adr <= 1;
          incr_rd_digit_count <= 1;
          m1_next_state <= m1_rd_send_adr_sr;
        end
        else m1_next_state <= m1_rd_send_adr_sr;
      end

    m1_rd_send_separator :
      begin
        msg_base <= 5'b10000;    // Address of the separator message
        incr_msg_offset <= rs232_tx_load;
        if ((msg_offset == 2) && rs232_tx_load)
        begin
          m1_next_state <= m1_rd_send_dat_sr;
          reset_rd_digit_count <= 1;
          reset_msg_offset <= 1;
        end
        else m1_next_state <= m1_rd_send_separator;
      end

    m1_rd_send_dat_sr :
      begin
        msg_base <= {1'b0,dat_sr[`NIBBLE_SIZE*DAT_DIGITS_PP-1:
                                 `NIBBLE_SIZE*(DAT_DIGITS_PP-1)]};
        if (
            (rd_digit_count == DAT_DIGITS_PP-1)
            && (rd_field_count == RD_FIELDS_PP-1)
            && rs232_tx_load
            )
        begin
          m1_next_state <= m1_rd_send_crlf;
          reset_rd_field_count <= 1;
        end
        else if ((rd_digit_count == DAT_DIGITS_PP-1) && rs232_tx_load) begin
          m1_next_state <= m1_rd_send_space;
          incr_rd_field_count <= 1;
        end
        else if (rs232_tx_load) begin
            store_dat <= 1;
            incr_rd_digit_count <= 1;
            m1_next_state <= m1_rd_send_dat_sr;
        end
        else m1_next_state <= m1_rd_send_dat_sr;
      end

    m1_rd_send_space :
      begin
        msg_base <= 5'b10000;    // Address of the space
        incr_msg_offset <= rs232_tx_load;
        if ((msg_offset == 0) && rs232_tx_load) begin
          m1_next_state <= m1_bus_granted;
          reset_msg_offset <= 1;
        end
        else m1_next_state <= m1_rd_send_space;
      end

    m1_rd_send_crlf :
      begin
        msg_base <= 5'b10111;     // Address of the cr/lf message
        incr_msg_offset <= rs232_tx_load;
        if ((msg_offset == 1) && rs232_tx_load) begin
          m1_next_state <= m1_bus_granted;
          reset_msg_offset <= 1;
        end
        else m1_next_state <= m1_rd_send_crlf;
      end

    default : m1_next_state <= m1_initial_state;
  endcase
end


// This is the counter for incrementing or loading the cmd_ptr
always @(posedge clk_i)
begin
  if (reset_i || reset_cmd_ptr) cmd_ptr <= 0;
  else if (decr_cmd_ptr) cmd_ptr <= cmd_ptr - 1;
  else if (incr_cmd_ptr) cmd_ptr <= cmd_ptr + 1;
end


// This is the command buffer writing section
always @(posedge clk_i)
begin
  if (rs232_echo && cmd_buffer_write) cmd_buffer[cmd_ptr] <= rs232_rx_char;
end
// This is the command buffer reading section
assign cmd_char = cmd_buffer[cmd_ptr];
assign lc_cmd_char = (cmd_buffer[cmd_ptr] | 8'h20); // lowercase



// These assigments are for detecting whether the cmd_char is
// anything of special interest.
assign char_is_enter = (cmd_char == 8'h0d);          // enter
assign char_is_whitespace = (
                                (cmd_char == 8'h20)  // space
                             || (cmd_char == 8'h09)  // tab
                             );
assign char_is_num = ((cmd_char>=8'h30)&&(cmd_char<=8'h39));
assign char_is_a_f = ((lc_cmd_char>=8'h61)&&(lc_cmd_char<=8'h66));
assign char_is_hex = ( char_is_num || char_is_a_f );
assign char_is_r = (lc_cmd_char == 8'h72); // "r"
assign char_is_w = (lc_cmd_char == 8'h77); // "w"
assign char_is_i = (lc_cmd_char == 8'h69); // "i"

assign hex_digit = char_is_num?cmd_char[3:0]:(cmd_char[3:0]+9);

// This is the command register.  It stores the type of command to execute.
// This is so that the state machine can parse address, data and qty
// into "generic" storage locations, and then when it executes the command,
// it refers back to this register in order to determine what type of
// operation to perform.

always @(posedge clk_i)
begin
  if (reset_i) command <= `CMD_0;
  else if (cmd_i) command <= `CMD_I;
  else if (cmd_r) command <= `CMD_R;
  else if (cmd_w) command <= `CMD_W;
end

// This is the "nibble" shift register for the address which is sent character
// by character to the user.  It is loaded each time the adr_offset is
// incremented, in order to save the previous address for use in printing
// to the user.
always @(posedge clk_i)
begin
  if (reset_i || reset_adr) rd_adr_sr <= 0;
  else if (incr_adr_offset) rd_adr_sr <= adr_ptr;
  else if (shift_rd_adr) begin
    rd_adr_sr[`NIBBLE_SIZE*ADR_DIGITS_PP-1:`NIBBLE_SIZE] <=
      rd_adr_sr[`NIBBLE_SIZE*(ADR_DIGITS_PP-1)-1:0];
    rd_adr_sr[`NIBBLE_SIZE-1:0] <= {`NIBBLE_SIZE{1'b0}};
  end
end

// These are the "nibble" shift registers.  They handle loading the
// hexadecimal digits from the command line.
always @(posedge clk_i)
begin
  if (reset_i || reset_adr) adr_sr <= 0;
  else if (store_adr) begin
    adr_sr[`NIBBLE_SIZE*ADR_DIGITS_PP-1:`NIBBLE_SIZE] <=
      adr_sr[`NIBBLE_SIZE*(ADR_DIGITS_PP-1)-1:0];
    adr_sr[`NIBBLE_SIZE-1:0] <= hex_digit;
  end
end

always @(posedge clk_i)
begin
  if (reset_i || reset_dat) dat_sr <= 0;
  else if (capture_dat) dat_sr <= dat_io;
  else if (store_dat) begin
    dat_sr[`NIBBLE_SIZE*DAT_DIGITS_PP-1:`NIBBLE_SIZE] <=
      dat_sr[`NIBBLE_SIZE*(DAT_DIGITS_PP-1)-1:0];
    dat_sr[`NIBBLE_SIZE-1:0] <= hex_digit;
  end
end

always @(posedge clk_i)
begin
  if (reset_i || reset_qty) qty_sr <= 0;
  else if (init_qty) qty_sr <= 1;
  else if (store_qty) begin
    qty_sr[`NIBBLE_SIZE*QTY_DIGITS_PP-1:`NIBBLE_SIZE] <=
      qty_sr[`NIBBLE_SIZE*(QTY_DIGITS_PP-1)-1:0];
    qty_sr[`NIBBLE_SIZE-1:0] <= hex_digit;
  end
end

// This is the rd_digit_count counter.  It is used for counting digits
// displayed of both the adr_sr and dat_sr, so it must be able to count up
// to the extent of the larger of the two...
always @(posedge clk_i)
begin
  if (reset_i || reset_rd_digit_count) rd_digit_count <= 0;
  else if (incr_rd_digit_count) rd_digit_count <= rd_digit_count + 1;
end

// This is the rd_field_count counter.  It is used for counting dat_sr fields
// displayed per line.
always @(posedge clk_i)
begin
  if (reset_i || reset_rd_field_count) rd_field_count <= 0;
  else if (incr_rd_field_count) rd_field_count <= rd_field_count + 1;
end


// This is the watchdog timer counter
// The watchdog timer is always "enabled" to operate.
always @(posedge clk_i)
begin
  if (reset_i || reset_watchdog) watchdog_timer_count <= 0;
  else if (~watchdog_timer_done)
    watchdog_timer_count <= watchdog_timer_count + 1;
end
assign watchdog_timer_done = (watchdog_timer_count==WATCHDOG_TIMER_VALUE_PP);


endmodule


</PRE></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线不卡一区二区| 久久草av在线| 国产精品久久久久久久久图文区 | 久久久久久亚洲综合影院红桃| 色婷婷精品大视频在线蜜桃视频| 国产精品综合在线视频| 国产成人夜色高潮福利影视| 黄色资源网久久资源365| 蜜臀a∨国产成人精品| 激情成人综合网| 国产成人精品免费网站| 成人h动漫精品一区二| av网站免费线看精品| 色婷婷激情久久| 欧美在线观看视频一区二区| 欧美日本在线观看| 精品少妇一区二区三区日产乱码 | 久久精品99久久久| 韩国成人精品a∨在线观看| 国产·精品毛片| 99久久777色| 欧日韩精品视频| 日韩你懂的在线播放| 久久精品视频在线看| 亚洲欧美电影一区二区| 亚洲一区二区三区在线| 久久成人免费网站| 欧美视频日韩视频| 精品粉嫩aⅴ一区二区三区四区| 国产日韩高清在线| 亚洲电影第三页| 国产91在线观看| 欧美少妇bbb| 中文字幕av一区二区三区| 亚洲综合免费观看高清完整版在线 | 久久久天堂av| 亚洲人精品午夜| 麻豆国产精品官网| 91麻豆国产精品久久| 欧美一级高清片在线观看| 中文文精品字幕一区二区| 亚洲高清视频在线| 成人午夜av电影| 欧美一区二区三区日韩视频| 欧美激情综合网| 蜜桃av噜噜一区| 色网站国产精品| 国产精品久久看| 国产伦精品一区二区三区免费| 日本高清视频一区二区| 久久影院午夜论| 日本欧美一区二区在线观看| 99国产一区二区三精品乱码| 26uuu国产在线精品一区二区| 亚洲精品国产a| 成人av在线一区二区三区| 欧美一级二级在线观看| 亚洲韩国精品一区| 91亚洲精华国产精华精华液| 精品福利一二区| 玖玖九九国产精品| 欧美一区二区三区人| 香蕉久久一区二区不卡无毒影院 | 中文字幕五月欧美| 国产一区二区三区免费播放| 91精品国产综合久久福利 | 欧美日韩国产综合一区二区| 亚洲欧美日韩一区二区三区在线观看| 九九视频精品免费| 精品福利在线导航| 经典一区二区三区| 日韩精品资源二区在线| 亚洲超碰97人人做人人爱| 色成年激情久久综合| 国产精品成人一区二区三区夜夜夜| 久久激情五月激情| 精品国产乱码久久久久久夜甘婷婷| 日韩精品三区四区| 日韩欧美精品在线视频| 美女爽到高潮91| 欧美一卡二卡在线观看| 日韩精品国产精品| 日韩一区二区电影在线| 久久国产尿小便嘘嘘尿| 久久久91精品国产一区二区精品| 国产精品一区二区免费不卡 | 免费在线看成人av| 欧美精品一区二区三区蜜桃视频| 久久99精品国产麻豆不卡| 久久久青草青青国产亚洲免观| 国产福利91精品一区二区三区| 天堂影院一区二区| 欧美一区二区视频在线观看2022| 麻豆精品视频在线观看免费| 日韩欧美在线综合网| 国产成人小视频| 一区二区三区四区乱视频| 91精品婷婷国产综合久久竹菊| 日本最新不卡在线| 国产女主播一区| 在线免费观看日本欧美| 日本va欧美va欧美va精品| 久久久三级国产网站| 色成年激情久久综合| 久久精品国产一区二区三区免费看| 欧美精品一区二区三区蜜桃| 91麻豆视频网站| 青青草97国产精品免费观看无弹窗版 | 91香蕉国产在线观看软件| 亚洲一区二区三区爽爽爽爽爽| 日韩亚洲国产中文字幕欧美| 国产99久久久国产精品| 亚洲大片一区二区三区| 国产欧美一区二区三区在线老狼| 99精品国产91久久久久久| 男女男精品网站| 伊人开心综合网| 精品不卡在线视频| 在线看国产日韩| 国产一区高清在线| 午夜av电影一区| 国产精品麻豆网站| 日韩欧美一区二区在线视频| 白白色亚洲国产精品| 韩国在线一区二区| 亚洲线精品一区二区三区八戒| 欧美成人精品3d动漫h| 91麻豆国产精品久久| 国产一区二区三区在线看麻豆| 亚洲国产cao| 亚洲色图欧美偷拍| 久久丝袜美腿综合| 91精品欧美福利在线观看| 色综合中文字幕| 国产成a人亚洲精| 国产精品综合一区二区三区| 日本不卡中文字幕| 亚洲综合丝袜美腿| 亚洲丝袜精品丝袜在线| 亚洲国产精品av| 国产日韩欧美一区二区三区综合 | 国内成人精品2018免费看| 亚洲va欧美va人人爽| 亚洲日本在线a| 国产精品福利在线播放| 久久久精品中文字幕麻豆发布| 精品国内二区三区| 日韩写真欧美这视频| 日韩色视频在线观看| 欧美一区三区二区| 欧美美女激情18p| 欧美日韩一级片在线观看| 91国产成人在线| 日本电影欧美片| 欧美日韩一区二区三区在线看| 91视频一区二区三区| 色综合色综合色综合色综合色综合 | 欧美一级二级三级蜜桃| 欧美日韩精品一区二区天天拍小说| 色成年激情久久综合| 欧美日韩成人综合天天影院 | 91免费在线播放| 色香蕉久久蜜桃| 欧美羞羞免费网站| 欧美日韩一区二区三区视频| 欧美丝袜第三区| 日韩免费一区二区三区在线播放| 欧美一区二区三区成人| 日韩精品中午字幕| 国产欧美一区二区三区沐欲| 日本一区二区三区四区| 中文字幕一区二区三区在线不卡 | 国产精品久久久久婷婷| 亚洲欧美另类小说| 亚洲在线一区二区三区| 免费日本视频一区| 成人午夜精品一区二区三区| 色网站国产精品| 日韩欧美你懂的| 成人欧美一区二区三区| 一区二区欧美精品| 九九在线精品视频| 色婷婷久久一区二区三区麻豆| 欧美精品乱码久久久久久| 久久久午夜精品理论片中文字幕| 中文字幕一区二区视频| 青青草97国产精品免费观看无弹窗版 | 亚洲精品免费一二三区| 麻豆一区二区在线| 成人一区二区在线观看| 欧美在线色视频| 国产调教视频一区| 五月天一区二区| 成人性生交大片| 日韩亚洲欧美一区二区三区| 亚洲婷婷综合色高清在线| 免费人成网站在线观看欧美高清| 丁香天五香天堂综合| 91精品国产91久久综合桃花| 综合在线观看色|