gpm module and exec first buggy version.
[calu.git] / cpu / src / gpm_b.vhd
1 library IEEE;
2 use IEEE.std_logic_1164.all;
3 use IEEE.numeric_std.all;
4
5 use work.common_pkg.all;
6 use work.alu_pkg.all;
7
8 entity gpm is
9
10         generic (
11                         -- active reset value
12                         RESET_VALUE : std_logic;
13                         -- active logic value
14                         --LOGIC_ACT : std_logic
15                         
16                         );
17         port(
18                 --System inputs
19                 clk : in std_logic;
20                 reset : in std_logic;
21
22                 --exti : in extmod_rec;
23                 --alu outpus
24                 alu_nxt : in alu_result_rec;
25                 --input
26                 
27                 --output
28                 psw     : out status_rec;
29                 --to memcnt
30                 --addr : out gp_register_t;
31                 --mem_en : out std_logic;
32                 --ldst : out std_logic;
33                 --, hw,byte: std_logic;
34                 --to output bus
35                 --exto : out data_ram_word_t
36                         
37         );
38                 
39 end gpm;
40
41 architecture behaviour of gpm is
42 type gpm_internal is record
43         status : status_rec;
44 end record gpm_internal;
45
46 reg, reg_nxt : gpm_internal;
47
48 begin
49 syn : process (clk, reset)
50         if reset = RESET_VALUE then
51                 reg <= (('0','0','0','0'));
52         elsif rising_edge(clk) then
53                 reg <= reg_nxt;
54         end if;
55 end process syn;
56
57 asyn : process (clk, reset)
58         reg_nxt <= alu_nxt.status;
59 end process asyn;
60
61 psw <= reg;
62         
63 end architecture behaviour;