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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rs232_syscon.v

?? vga ipcore的verilog代碼
?? V
?? 第 1 頁 / 共 3 頁
字號:
          incr_cmd_ptr <= 1;
          cmd_r <= 1;
        end
        else if (char_is_w) begin
          m1_next_state <= m1_scan_adr_whitespace;
          incr_cmd_ptr <= 1;
          cmd_w <= 1;
        end
        else if (char_is_i) begin
          m1_next_state <= m1_start_execution;
          cmd_i <= 1;
        end
        else m1_next_state <= m1_cmd_error_indicator;
      end

    // The only way to determine the end of a valid field is to find
    // whitespace.  Therefore, char_is_whitespace must be used as an exit
    // condition from the "get_xxx_field" states.  So, this state is used to
    // scan through any leading whitespace prior to it.
    m1_scan_adr_whitespace :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_whitespace) begin
          m1_next_state <= m1_scan_adr_whitespace;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else begin
          m1_next_state <= m1_get_adr_field;
          reset_adr <= 1;
        end
      end

    m1_get_adr_field :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_hex) begin
          m1_next_state <= m1_get_adr_field;
          store_adr <= 1;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_whitespace) begin            // Normal exit
          m1_next_state <= m1_scan_dat_whitespace;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else m1_next_state <= m1_adr_error_indicator;
      end

    m1_scan_dat_whitespace :
      begin
        rs232_echo <= 1;          // Don't send message characters
        // There is no DAT field for reads, so skip it.
        if (command == `CMD_R) m1_next_state <= m1_scan_qty_whitespace;
        else if (char_is_whitespace) begin
          m1_next_state <= m1_scan_dat_whitespace;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else begin
          m1_next_state <= m1_get_dat_field;
          reset_dat <= 1;
        end
      end

    m1_get_dat_field :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_hex) begin
          m1_next_state <= m1_get_dat_field;
          store_dat <= 1;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_whitespace) begin            // Normal exit
          m1_next_state <= m1_scan_qty_whitespace;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else m1_next_state <= m1_dat_error_indicator;
      end

    m1_scan_qty_whitespace :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_whitespace) begin
          m1_next_state <= m1_scan_qty_whitespace;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else begin
          m1_next_state <= m1_get_qty_field;
          reset_qty <= 1;
        end
      end

    m1_get_qty_field :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_hex) begin
          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 == " ")    // 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 == "r");
assign char_is_w = (lc_cmd_char == "w");
assign char_is_i = (lc_cmd_char == "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


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人在线影院| 国产亚洲精品免费| 亚洲bt欧美bt精品777| 欧美日韩你懂得| 日一区二区三区| 精品国内片67194| 国产精品77777竹菊影视小说| 亚洲国产精华液网站w| 北条麻妃国产九九精品视频| 国产精品毛片大码女人| 色成人在线视频| 欧美bbbbb| 国产蜜臀97一区二区三区| 国产99久久久国产精品| 一区二区三区日韩精品视频| 欧美肥胖老妇做爰| 国产福利一区二区三区| 国产精品毛片久久久久久久| 欧美日韩免费观看一区二区三区| 免费成人美女在线观看| 国产精品亲子乱子伦xxxx裸| 欧美色精品在线视频| 精品一区二区免费在线观看| 国产精品无圣光一区二区| 在线精品视频小说1| 国产资源在线一区| 亚洲在线免费播放| 欧美精品一区二| 色综合色狠狠综合色| 天天综合网 天天综合色| 国产午夜精品一区二区三区视频 | 卡一卡二国产精品 | 国产精品123区| 亚洲人成网站在线| 日韩一区二区免费在线观看| 成人免费毛片app| 日本aⅴ免费视频一区二区三区| 日本一区二区三区久久久久久久久不| 91成人国产精品| 国产成人在线免费| 亚洲va欧美va天堂v国产综合| 久久久www成人免费无遮挡大片| 欧美视频一二三区| 成人免费看视频| 久国产精品韩国三级视频| 亚洲免费av高清| 国产欧美一区二区精品秋霞影院| 91麻豆精品国产91久久久久久久久| 紧缚奴在线一区二区三区| 亚洲1区2区3区4区| 亚洲欧洲综合另类在线| 日本一区二区视频在线观看| 欧美变态口味重另类| 在线视频欧美精品| 成人精品视频网站| 国产一区二区三区不卡在线观看 | 日韩专区一卡二卡| 日韩毛片在线免费观看| 国产视频一区在线观看| 久久久久久久久久久99999| 3d动漫精品啪啪一区二区竹菊 | 中文字幕在线观看不卡视频| 日韩欧美一级精品久久| 91精品国产色综合久久| 色中色一区二区| 99re8在线精品视频免费播放| 国产精品456| 精品中文字幕一区二区小辣椒| 亚洲福利一二三区| 亚洲妇熟xx妇色黄| 亚洲成人自拍一区| 亚洲成人激情综合网| 亚洲国产日韩综合久久精品| 亚洲精品伦理在线| 亚洲男人电影天堂| 亚洲男帅同性gay1069| 亚洲天堂久久久久久久| 亚洲色图制服诱惑 | 午夜日韩在线观看| 午夜一区二区三区在线观看| 午夜精品视频一区| 日本中文字幕一区二区有限公司| 丝瓜av网站精品一区二区| 婷婷丁香久久五月婷婷| 免费的成人av| 国产一区二区三区免费| 成人黄色在线视频| 日本韩国欧美一区| 在线看日韩精品电影| 欧美日韩dvd在线观看| 日韩视频一区二区在线观看| 欧美刺激脚交jootjob| 久久久99精品久久| 国产精品成人一区二区三区夜夜夜| 国产精品免费人成网站| 亚洲另类在线视频| 日韩国产精品久久| 国产一区二区在线电影| 99精品一区二区三区| 欧美日韩一区 二区 三区 久久精品| 91精品视频网| 久久久精品国产免大香伊| 亚洲天堂a在线| 日韩高清欧美激情| 国产在线不卡视频| 色婷婷综合久久| 91精品黄色片免费大全| 日本一区二区三区高清不卡| 夜夜夜精品看看| 久久精品99国产精品| www.av精品| 欧美精品少妇一区二区三区| 久久亚洲捆绑美女| 亚洲美女视频一区| 日韩高清在线电影| 99re成人精品视频| 欧美不卡视频一区| 亚洲视频一区二区在线| 精品一区二区在线免费观看| www.在线成人| 日韩欧美成人午夜| 中文字幕一区二区三区不卡在线 | 色激情天天射综合网| www激情久久| 亚洲午夜视频在线观看| 国产福利精品导航| 精品1区2区3区| 国产精品久久久久7777按摩| 日韩成人av影视| 一本大道久久a久久综合| 26uuu亚洲综合色| 天天综合色天天综合色h| 99久久精品久久久久久清纯| 久久一区二区视频| 午夜久久久久久久久| 播五月开心婷婷综合| 欧美电影免费观看完整版| 亚洲在线中文字幕| aaa亚洲精品一二三区| 26uuu精品一区二区三区四区在线| 亚洲综合免费观看高清完整版| 国产高清久久久| 91精品国产色综合久久不卡蜜臀 | 国产精品99久久久久久似苏梦涵| 欧美精品国产精品| 亚洲制服丝袜av| 91亚洲国产成人精品一区二三| 久久久久久久电影| 韩国一区二区在线观看| 51精品秘密在线观看| 亚洲成av人片在线观看无码| 欧洲生活片亚洲生活在线观看| 中文字幕亚洲成人| 成人一级片网址| 国产日韩欧美高清在线| 国产一区二区成人久久免费影院 | 亚洲欧美在线另类| 国产suv一区二区三区88区| 精品福利一区二区三区| 蜜臀av在线播放一区二区三区| 欧日韩精品视频| 亚洲国产乱码最新视频| 91福利在线播放| 亚洲黄色性网站| 色欧美片视频在线观看| 亚洲码国产岛国毛片在线| 99国产精品视频免费观看| 亚洲欧洲色图综合| 99这里都是精品| 亚洲三级久久久| 在线视频亚洲一区| 亚洲成av人在线观看| 欧美三级乱人伦电影| 午夜激情一区二区三区| 欧美美女一区二区| 日本麻豆一区二区三区视频| 884aa四虎影成人精品一区| 日韩av不卡在线观看| 欧美精品一区二区三区在线| 精品在线一区二区三区| 久久久精品天堂| 成人精品一区二区三区中文字幕| 亚洲欧洲一区二区在线播放| 色拍拍在线精品视频8848| 亚洲图片欧美色图| 欧美一区二区三区色| 国产自产v一区二区三区c| 中文字幕国产一区二区| 日本高清无吗v一区| 视频一区国产视频| 精品免费日韩av| 99久免费精品视频在线观看| 亚洲一区二区三区四区在线观看| 欧美日韩中文另类| 久久国产精品72免费观看| 亚洲国产精品v| 精品视频在线视频| 国产一区二区主播在线| 一区二区三区精品视频在线| 日韩丝袜美女视频|