OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /open8_urisc/trunk/VHDL
    from Rev 8 to Rev 10
    Reverse comparison

Rev 8 → Rev 10

/Open8.vhd
73,6 → 73,7
-- Author Date Change
------------------ -------- ---------------------------------------------------
-- Seth Henry 07/19/06 Design Start
-- Seth Henry 01/18/11 Fixed BTT instruction to match V8
 
library ieee;
use ieee.std_logic_1164.all;
93,7 → 94,7
Enable_Auto_Increment : std_logic := '0' ); -- Modify indexed instr
port(
Clock : in std_logic;
Reset_n : in std_logic;
Reset : in std_logic;
CPU_Halt : in std_logic;
Interrupts : in INTERRUPT_BUNDLE;
--
133,8 → 134,8
constant ALU_LDX : OPCODE_TYPE := "11110"; -- x"1E"
 
constant ALU_IDLE : OPCODE_TYPE := "10000"; -- x"10"
constant ALU_UPP2 : OPCODE_TYPE := "10010"; -- x"11"
constant ALU_RFLG : OPCODE_TYPE := "10011"; -- x"12"
constant ALU_UPP2 : OPCODE_TYPE := "10010"; -- x"12"
constant ALU_RFLG : OPCODE_TYPE := "10011"; -- x"13"
 
constant FL_ZERO : integer := 0;
constant FL_CARRY : integer := 1;
384,15 → 385,17
Flags_D(FL_NEG) <= Sum(7);
 
when ALU_STP => -- Sets bit(n) in the Flags register
Flags_D(Index) <= '1';
Flags_D(Index) <= '1';
 
when ALU_BTT => -- Tests if R0 is negative or zero. No change to R0
Temp := "0" & Regfile(Index);
Flags_D(FL_ZERO) <= '0';
if( Temp(7 downto 0) = 0 )then
Flags_D(FL_ZERO) <= '1';
end if;
Flags_D(FL_NEG) <= Temp(7);
when ALU_BTT => -- Z = !R0(N), N = R0(7)
Flags_D(FL_ZERO) <= not Regfile(0)(Index);
Flags_D(FL_NEG) <= Regfile(0)(7);
-- Temp := "0" & Regfile(Index);
-- Flags_D(FL_ZERO) <= '0';
-- if( Temp(7 downto 0) = 0 )then
-- Flags_D(FL_ZERO) <= '1';
-- end if;
-- Flags_D(FL_NEG) <= Temp(7);
 
when ALU_CLP => -- Clears bit(n) in the Flags register
Flags_D(Index) <= '0';
417,7 → 420,7
Flags_D(FL_CARRY) <= Sum(8);
Flags_D(FL_NEG) <= Sum(7);
 
when ALU_MUL => -- Stage 1 of 2 {R1:R0} = R0 * Rn : Flags N,Z
when ALU_MUL => -- Stage 1 of 2 {R1:R0} = R0 * Rn : Flags Z
Regfile_D(0) <= Mult(7 downto 0);
Regfile_D(1) <= Mult(15 downto 8);
Flags_D(FL_ZERO) <= '0';
464,9 → 467,9
end if;
end process;
 
S_Regs: process( Reset_n, Clock )
S_Regs: process( Reset, Clock )
begin
if( Reset_n = '0' )then
if( Reset = '1' )then
for i in 0 to 7 loop
Regfile(i) <= (others => '0');
end loop;
503,12 → 506,12
end if;
end process;
 
Program_Counter: process( Reset_n, Clock, Halt, PC_Ctrl, PC_Q, Rewind_1_2n )
Program_Counter: process( Reset, Clock, Halt, PC_Ctrl, PC_Q, Rewind_1_2n )
variable PC_Offset_SX : ADDRESS_TYPE := x"0000";
begin
PC_Offset_SX(15 downto 8):= (others => PC_Ctrl.Offset(7));
PC_Offset_SX(7 downto 0) := PC_Ctrl.Offset;
if( Reset_n = '0' )then
if( Reset = '1' )then
PC_Q <= Program_Start_Addr;
elsif( rising_edge(Clock) )then
if( Halt = '0' )then
539,9 → 542,9
 
SP <= SP_Q;
 
Stack_Pointer: process( Reset_n, Clock )
Stack_Pointer: process( Reset, Clock )
begin
if( Reset_n = '0' )then
if( Reset = '1' )then
SP_Q <= Stack_Start_Addr;
elsif( rising_edge(Clock) )then
if( Halt = '0' )then
666,9 → 669,9
end if;
end process;
 
S_Regs: process( Reset_n, Clock )
S_Regs: process( Reset, Clock )
begin
if( Reset_n = '0' )then
if( Reset = '1' )then
Int_Req <= '0';
Pending <= x"00";
Wait_for_FSM <= '0';
689,16 → 692,16
elsif( Int_Trig = '1' )then
Wait_for_FSM <= '1';
end if;
if( INT_Ctrl.Mask_Set = '1' )then
if( INT_Ctrl.Mask_Set = '1' )then
Mask <= INT_Ctrl.Mask_Data(7 downto 1);
end if;
ISR_Q <= ISR_D;
if( Int_Trig = '1' )then
History(Hist_Ptr+1) <= Hist_Level;
Hist_Ptr <= Hist_Ptr + 1;
elsif( Int_RTI = '1' and Hist_Ptr > 0 )then
Hist_Ptr <= Hist_Ptr - 1;
end if;
end if;
ISR_Q <= ISR_D;
if( Int_Trig = '1' )then
History(Hist_Ptr+1) <= Hist_Level;
Hist_Ptr <= Hist_Ptr + 1;
elsif( Int_RTI = '1' and Hist_Ptr > 0 )then
Hist_Ptr <= Hist_Ptr - 1;
end if;
end if;
end if;
end process;
1325,9 → 1328,9
 
end process;
 
S_Regs: process( Reset_n, Clock )
S_Regs: process( Reset, Clock )
begin
if( Reset_n = '0' )then
if( Reset = '1' )then
CPU_State <= PIPE_FILL_0;
Opcode <= OP_INC;
SubOp <= ACCUM;
1475,9 → 1478,9
end loop;
end process;
 
S_Regs: process( Reset_n, Clock )
S_Regs: process( Reset, Clock )
begin
if( Reset_n = '0' )then
if( Reset = '1' )then
Wr_Data <= (others => '0');
Wr_Enable <= '0';
Rd_Enable <= '1';
1492,4 → 1495,5
 
end block;
 
end rtl;
end rtl;
 
/Open8_pkg.vhd
65,4 → 65,4
end Open8_pkg;
 
package body Open8_pkg is
end package body;
end package body;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.