Line 137... |
Line 137... |
ci_instr32_o(instr_imm12_lsb_c + 9) <= ci_instr16_i(10);
|
ci_instr32_o(instr_imm12_lsb_c + 9) <= ci_instr16_i(10);
|
end if;
|
end if;
|
|
|
when "010" | "011" => -- C.LW / C.FLW
|
when "010" | "011" => -- C.LW / C.FLW
|
-- ----------------------------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------------------------
|
if (ci_instr16_i(ci_funct3_lsb_c) = '0') then -- C.LW
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_load_c;
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_load_c;
|
else -- C.FLW
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_flw_c;
|
|
end if;
|
|
ci_instr32_o(21 downto 20) <= "00";
|
ci_instr32_o(21 downto 20) <= "00";
|
ci_instr32_o(22) <= ci_instr16_i(6);
|
ci_instr32_o(22) <= ci_instr16_i(6);
|
ci_instr32_o(23) <= ci_instr16_i(10);
|
ci_instr32_o(23) <= ci_instr16_i(10);
|
ci_instr32_o(24) <= ci_instr16_i(11);
|
ci_instr32_o(24) <= ci_instr16_i(11);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
ci_instr32_o(26) <= ci_instr16_i(5);
|
ci_instr32_o(26) <= ci_instr16_i(5);
|
ci_instr32_o(31 downto 27) <= (others => '0');
|
ci_instr32_o(31 downto 27) <= (others => '0');
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_lw_c;
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_lw_c;
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "01" & ci_instr16_i(ci_rs1_3_msb_c downto ci_rs1_3_lsb_c); -- x8 - x15
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "01" & ci_instr16_i(ci_rs1_3_msb_c downto ci_rs1_3_lsb_c); -- x8 - x15
|
ci_instr32_o(instr_rd_msb_c downto instr_rd_lsb_c) <= "01" & ci_instr16_i(ci_rd_3_msb_c downto ci_rd_3_lsb_c); -- x8 - x15
|
ci_instr32_o(instr_rd_msb_c downto instr_rd_lsb_c) <= "01" & ci_instr16_i(ci_rd_3_msb_c downto ci_rd_3_lsb_c); -- x8 - x15
|
|
if (ci_instr16_i(ci_funct3_lsb_c) = '1') then -- C.FLW
|
|
ci_illegal_o <= '1';
|
|
end if;
|
|
|
when "110" | "111" => -- C.SW / C.FSW
|
when "110" | "111" => -- C.SW / C.FSW
|
-- ----------------------------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------------------------
|
if (ci_instr16_i(ci_funct3_lsb_c) = '0') then -- C.SW
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_store_c;
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_store_c;
|
else -- C.FSW
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_fsw_c;
|
|
end if;
|
|
ci_instr32_o(08 downto 07) <= "00";
|
ci_instr32_o(08 downto 07) <= "00";
|
ci_instr32_o(09) <= ci_instr16_i(6);
|
ci_instr32_o(09) <= ci_instr16_i(6);
|
ci_instr32_o(10) <= ci_instr16_i(10);
|
ci_instr32_o(10) <= ci_instr16_i(10);
|
ci_instr32_o(11) <= ci_instr16_i(11);
|
ci_instr32_o(11) <= ci_instr16_i(11);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
ci_instr32_o(26) <= ci_instr16_i(5);
|
ci_instr32_o(26) <= ci_instr16_i(5);
|
ci_instr32_o(31 downto 27) <= (others => '0');
|
ci_instr32_o(31 downto 27) <= (others => '0');
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_sw_c;
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_sw_c;
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "01" & ci_instr16_i(ci_rs1_3_msb_c downto ci_rs1_3_lsb_c); -- x8 - x15
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "01" & ci_instr16_i(ci_rs1_3_msb_c downto ci_rs1_3_lsb_c); -- x8 - x15
|
ci_instr32_o(instr_rs2_msb_c downto instr_rs2_lsb_c) <= "01" & ci_instr16_i(ci_rs2_3_msb_c downto ci_rs2_3_lsb_c); -- x8 - x15
|
ci_instr32_o(instr_rs2_msb_c downto instr_rs2_lsb_c) <= "01" & ci_instr16_i(ci_rs2_3_msb_c downto ci_rs2_3_lsb_c); -- x8 - x15
|
|
if (ci_instr16_i(ci_funct3_lsb_c) = '1') then -- C.FSW
|
|
ci_illegal_o <= '1';
|
|
end if;
|
|
|
when others => -- undefined
|
when others => -- undefined
|
-- ----------------------------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------------------------
|
ci_illegal_o <= '1';
|
ci_illegal_o <= '1';
|
|
|
Line 370... |
Line 368... |
ci_instr32_o(instr_imm12_lsb_c + 4) <= ci_instr16_i(6);
|
ci_instr32_o(instr_imm12_lsb_c + 4) <= ci_instr16_i(6);
|
ci_illegal_o <= ci_instr16_i(12);
|
ci_illegal_o <= ci_instr16_i(12);
|
|
|
when "010" | "011" => -- C.LWSP / C.FLWSP
|
when "010" | "011" => -- C.LWSP / C.FLWSP
|
-- ----------------------------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------------------------
|
if (ci_instr16_i(ci_funct3_lsb_c) = '0') then -- C.LWSP
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_load_c;
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_load_c;
|
else -- C.FLWSP
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_flw_c;
|
|
end if;
|
|
ci_instr32_o(21 downto 20) <= "00";
|
ci_instr32_o(21 downto 20) <= "00";
|
ci_instr32_o(22) <= ci_instr16_i(4);
|
ci_instr32_o(22) <= ci_instr16_i(4);
|
ci_instr32_o(23) <= ci_instr16_i(5);
|
ci_instr32_o(23) <= ci_instr16_i(5);
|
ci_instr32_o(24) <= ci_instr16_i(6);
|
ci_instr32_o(24) <= ci_instr16_i(6);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
Line 386... |
Line 380... |
ci_instr32_o(27) <= ci_instr16_i(3);
|
ci_instr32_o(27) <= ci_instr16_i(3);
|
ci_instr32_o(31 downto 28) <= (others => '0');
|
ci_instr32_o(31 downto 28) <= (others => '0');
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_lw_c;
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_lw_c;
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "00010"; -- stack pointer
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "00010"; -- stack pointer
|
ci_instr32_o(instr_rd_msb_c downto instr_rd_lsb_c) <= ci_instr16_i(ci_rd_5_msb_c downto ci_rd_5_lsb_c);
|
ci_instr32_o(instr_rd_msb_c downto instr_rd_lsb_c) <= ci_instr16_i(ci_rd_5_msb_c downto ci_rd_5_lsb_c);
|
|
if (ci_instr16_i(ci_funct3_lsb_c) = '1') then -- C.FLWSP
|
|
ci_illegal_o <= '1';
|
|
end if;
|
|
|
when "110" | "111" => -- C.SWSP / C.FSWSP
|
when "110" | "111" => -- C.SWSP / C.FSWSP
|
-- ----------------------------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------------------------
|
if (ci_instr16_i(ci_funct3_lsb_c) = '0') then -- C.SWSP
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_store_c;
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_store_c;
|
else -- C.FSWSP
|
|
ci_instr32_o(instr_opcode_msb_c downto instr_opcode_lsb_c) <= opcode_fsw_c;
|
|
end if;
|
|
ci_instr32_o(08 downto 07) <= "00";
|
ci_instr32_o(08 downto 07) <= "00";
|
ci_instr32_o(09) <= ci_instr16_i(9);
|
ci_instr32_o(09) <= ci_instr16_i(9);
|
ci_instr32_o(10) <= ci_instr16_i(10);
|
ci_instr32_o(10) <= ci_instr16_i(10);
|
ci_instr32_o(11) <= ci_instr16_i(11);
|
ci_instr32_o(11) <= ci_instr16_i(11);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
ci_instr32_o(25) <= ci_instr16_i(12);
|
Line 405... |
Line 398... |
ci_instr32_o(27) <= ci_instr16_i(8);
|
ci_instr32_o(27) <= ci_instr16_i(8);
|
ci_instr32_o(31 downto 28) <= (others => '0');
|
ci_instr32_o(31 downto 28) <= (others => '0');
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_sw_c;
|
ci_instr32_o(instr_funct3_msb_c downto instr_funct3_lsb_c) <= funct3_sw_c;
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "00010"; -- stack pointer
|
ci_instr32_o(instr_rs1_msb_c downto instr_rs1_lsb_c) <= "00010"; -- stack pointer
|
ci_instr32_o(instr_rs2_msb_c downto instr_rs2_lsb_c) <= ci_instr16_i(ci_rs2_5_msb_c downto ci_rs2_5_lsb_c);
|
ci_instr32_o(instr_rs2_msb_c downto instr_rs2_lsb_c) <= ci_instr16_i(ci_rs2_5_msb_c downto ci_rs2_5_lsb_c);
|
|
if (ci_instr16_i(ci_funct3_lsb_c) = '1') then -- C.FSWSP
|
|
ci_illegal_o <= '1';
|
|
end if;
|
|
|
when "100" => -- C.JR, C.JALR, C.MV, C.EBREAK, C.ADD
|
when "100" => -- C.JR, C.JALR, C.MV, C.EBREAK, C.ADD
|
-- ----------------------------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------------------------
|
if (ci_instr16_i(12) = '0') then -- C.JR, C.MV
|
if (ci_instr16_i(12) = '0') then -- C.JR, C.MV
|
if (ci_instr16_i(6 downto 2) = "00000") then -- C.JR
|
if (ci_instr16_i(6 downto 2) = "00000") then -- C.JR
|