Fixed some bugs.
[calu.git] / cpu / src / gpm_b.vhd
index 081830471f9d9f36c9df855d6c610bff530e1e72..7327a9f6c0b62f1778a27345cbf85b8a14bd226b 100644 (file)
@@ -5,59 +5,28 @@ use IEEE.numeric_std.all;
 use work.common_pkg.all;
 use work.alu_pkg.all;
 
-entity gpm is
-
-       generic (
-                       -- active reset value
-                       RESET_VALUE : std_logic;
-                       -- active logic value
-                       --LOGIC_ACT : std_logic
-                       
-                       );
-       port(
-               --System inputs
-                clk : in std_logic;
-               reset : in std_logic;
-
-                --exti : in extmod_rec;
-                --alu outpus
-                alu_nxt : in alu_result_rec;
-                --input
-                
-                --output
-                psw     : out status_rec;
-                --to memcnt
-                --addr : out gp_register_t;
-                --mem_en : out std_logic;
-                --ldst : out std_logic;
-                --, hw,byte: std_logic;
-                --to output bus
-                --exto : out data_ram_word_t
-                        
-        );
-               
-end gpm;
-
 architecture behaviour of gpm is
 type gpm_internal is record
         status : status_rec;
 end record gpm_internal;
 
-reg, reg_nxt : gpm_internal;
+signal reg, reg_nxt : gpm_internal;
 
 begin
 syn : process (clk, reset)
-        if reset = RESET_VALUE then
-                reg <= (('0','0','0','0'));
+begin
+        if (reset = RESET_VALUE) then
+                reg.status <= ('0','0','0','0');
         elsif rising_edge(clk) then
                 reg <= reg_nxt;
         end if;
 end process syn;
 
 asyn : process (clk, reset)
-        reg_nxt <= alu_nxt.status;
+begin
+        reg_nxt.status <= alu_nxt.status;
 end process asyn;
 
-psw <= reg;
+psw <= reg.status;
         
 end architecture behaviour;