OpenCores
Issue List
VHDL RS_SYSCON #3
Open openhardcore opened this issue over 10 years ago
openhardcore commented over 10 years ago

I was using vhdl version

and I added qty_sr <= to_unsigned(1,qty_sr'length); in two places

becasue

write commad (without qty fields) sets qty_sr to the limit, a then if read is done without qty fields then it reads a whole block

here what I did:

first place ########### when GET_ADR_FIELD => if (sys_clk_en='1') then if (char_is_hex='1') then adr_sr <= adr_sr(NIBBLE_SIZE*(ADR_DIGITS-1)-1 downto 0) & hex_digit; cmd_ptr <= cmd_ptr+1; elsif (char_is_whitespace='1') then -- Normal exit fsm_state <= SCAN_DAT_WHITESPACE; elsif (cmd_char=ENTER_CHAR) then

    --added
    --added
        qty_sr    <= to_unsigned(1,qty_sr'length);
    --added
    --added

        fsm_state <= START_EXECUTION; -- Using last values
      else
        msg_pointer <= "01010";    -- Address of message
        fsm_tx_load <= '1';
        fsm_state   <= SEND_QUESTION;
      end if;
    end if;

#############

second place ########### when SCAN_QTY_WHITESPACE => if (sys_clk_en='1') then if (char_is_whitespace='1') then cmd_ptr <= cmd_ptr+1; elsif (cmd_char=ENTER_CHAR) then --added --added qty_sr <= to_unsigned(1,qty_sr'length); --added --added

        fsm_state <= START_EXECUTION; -- Using last values
      else
        fsm_state <= GET_QTY_FIELD;
        qty_sr    <= to_unsigned(0,qty_sr'length);
      end if;
    end if;

###########

this way the "last values" are never used but it is clumsy

more likely rs_syscon is used with qty_fileds leaved blank, so this idea fits well

BTW verilog version had such feature?

openhardcore commented over 10 years ago

it does not print properly

first place ########### when GET_ADR_FIELD => if (sys_clk_en='1') then if (char_is_hex='1') then adr_sr <= adr_sr(NIBBLE_SIZE*(ADR_DIGITS-1)-1 downto 0) & hex_digit; cmd_ptr <= cmd_ptr+1; elsif (char_is_whitespace='1') then -- Normal exit fsm_state <= SCAN_DAT_WHITESPACE; elsif (cmd_char=ENTER_CHAR) then

    --added
    --added
        qty_sr    <= to_unsigned(1,qty_sr'length);
    --added
    --added

        fsm_state <= START_EXECUTION; -- Using last values
      else
        msg_pointer <= "01010";    -- Address of message
        fsm_tx_load <= '1';
        fsm_state   <= SEND_QUESTION;
      end if;
    end if;

#############

second place ########### when SCAN_QTY_WHITESPACE => if (sys_clk_en='1') then if (char_is_whitespace='1') then cmd_ptr <= cmd_ptr+1; elsif (cmd_char=ENTER_CHAR) then --added --added qty_sr <= to_unsigned(1,qty_sr'length); --added --added

        fsm_state <= START_EXECUTION; -- Using last values
      else
        fsm_state <= GET_QTY_FIELD;
        qty_sr    <= to_unsigned(0,qty_sr'length);
      end if;
    end if;

###########

openhardcore commented over 10 years ago

should be "qty_sr <= to_unsigned(1,qty_sr'length);"

openhardcore commented over 10 years ago
<code>

I was using vhdl version of http://opencores.org/project,rs232_syscon

and I added qty_sr <= to_unsigned(1,qty_sr'length); in two places:

write commad (without qty fields) sets qty_sr to the limit, a then if read is done without qty fields then it reads a whole block

here what I did:

first place ########### when GET_ADR_FIELD => if (sys_clk_en='1') then if (char_is_hex='1') then adr_sr <= adr_sr(NIBBLE_SIZE*(ADR_DIGITS-1)-1 downto 0) & hex_digit; cmd_ptr <= cmd_ptr+1; elsif (char_is_whitespace='1') then -- Normal exit fsm_state <= SCAN_DAT_WHITESPACE; elsif (cmd_char=ENTER_CHAR) then

    --added
    --added
        qty_sr    <= to_unsigned(1,qty_sr'length);
    --added
    --added

        fsm_state <= START_EXECUTION; -- Using last values
      else
        msg_pointer <= "01010";    -- Address of message
        fsm_tx_load <= '1';
        fsm_state   <= SEND_QUESTION;
      end if;
    end if;

#############

second place ########### when SCAN_QTY_WHITESPACE => if (sys_clk_en='1') then if (char_is_whitespace='1') then cmd_ptr <= cmd_ptr+1; elsif (cmd_char=ENTER_CHAR) then --added --added qty_sr <= to_unsigned(1,qty_sr'length); --added --added

        fsm_state <= START_EXECUTION; -- Using last values
      else
        fsm_state <= GET_QTY_FIELD;
        qty_sr    <= to_unsigned(0,qty_sr'length);
      end if;
    end if;

###########

this way the last values are never used but it is clumsy

there was when I once (or two) used the verilog version and I had no such feature

</code>
openhardcore commented over 10 years ago

I give up, sorry

qingdaofox commented about 8 years ago

Type your text here

jclaytons commented about 8 years ago

Thanks for this idea! I was using the VHDL version today, and I realized that what I would really like is to preserve the "last quantity" values for reads, even during a write or fill command. Then, if a read is issued with quantity X, then a write or fill can be issued, but a following 'r' command would re-use the existing quantity X from the last read.


Assignee
No one
Labels
Idea