1 ------------------------------------------------------------------------------
3 ---- ZPU Medium connection to the FPGA pins ----
5 ---- http://www.opencores.org/ ----
8 ---- This module connects the ZPU_Med1 (zpu_med1.vhdl) core to a Spartan ----
9 ---- 3 1500 Xilinx FPGA available in the GR-XC3S board from Pender. ----
15 ---- - Salvador E. Tropea, salvador inti.gob.ar ----
17 ------------------------------------------------------------------------------
19 ---- Copyright (c) 2008 Salvador E. Tropea <salvador inti.gob.ar> ----
20 ---- Copyright (c) 2008 Instituto Nacional de TecnologĂa Industrial ----
22 ---- Distributed under the GPL license ----
24 ------------------------------------------------------------------------------
26 ---- Design unit: DMIPS_Med1(FPGA) (Entity and architecture) ----
27 ---- File name: dmips_med1.vhdl ----
29 ---- Limitations: None known ----
30 ---- Errors: None known ----
31 ---- Library: work ----
32 ---- Dependencies: IEEE.std_logic_1164 ----
33 ---- IEEE.numeric_std ----
35 ---- Target FPGA: Spartan 3 (XC3S1500-4-FG456) ----
36 ---- Language: VHDL ----
37 ---- Wishbone: No ----
38 ---- Synthesis tools: Xilinx Release 9.2.03i - xst J.39 ----
39 ---- Simulation tools: N/A ----
40 ---- Text editor: SETEdit 0.5.x ----
42 ------------------------------------------------------------------------------
45 use IEEE.std_logic_1164.all;
46 use IEEE.numeric_std.all;
53 WORD_SIZE : natural:=32; -- 32 bits data path
54 D_CARE_VAL : std_logic:='0'; -- Fill value, I got better results with it
55 CLK_FREQ : positive:=50; -- 50 MHz clock
56 BRATE : positive:=115200; -- RS-232 baudrate
57 ADDR_W : natural:=18; -- 18 bits address space=256 kB, 128 kB I/O
58 BRAM_W : natural:=15); -- 15 bits RAM space=32 kB
60 clk_i : in std_logic; -- CPU clock
61 rst_i : in std_logic; -- Reset
62 rs232_tx_o : out std_logic; -- UART Tx
63 rs232_rx_i : in std_logic); -- UART Rx
65 constant BRD_PB1_I : string:="D19"; -- SWITCH8==S2
66 constant BRD_CLK1_I : string:="AA12"; -- 50 MHz clock
67 --constant BRD_CLK1_I : string:="AB12"; -- 40 MHz clock
68 -- UART: direct 1:1 cable
69 constant BRD_TX_O : string:="L4"; -- UART 1 (J1) TXD1 DB9 pin 2
70 constant BRD_RX_I : string:="L3"; -- UART 1 (J1) RXD1 DB9 pin 3
75 attribute LOC : string;
76 attribute IOSTANDARD : string;
77 constant IOSTD : string:="LVTTL";
79 attribute LOC of rst_i : signal is BRD_PB1_I;
80 attribute IOSTANDARD of rst_i : signal is IOSTD;
81 attribute LOC of clk_i : signal is BRD_CLK1_I;
82 attribute LOC of rs232_tx_o : signal is BRD_TX_O;
83 attribute IOSTANDARD of rs232_tx_o : signal is IOSTD;
84 attribute LOC of rs232_rx_i : signal is BRD_RX_I;
85 attribute IOSTANDARD of rs232_rx_i : signal is IOSTD;
86 end entity DMIPS_Med1;
88 architecture FPGA of DMIPS_Med1 is
91 WORD_SIZE : natural:=32; -- 32 bits data path
92 D_CARE_VAL : std_logic:='X'; -- Fill value
93 CLK_FREQ : positive:=50; -- 50 MHz clock
94 BRATE : positive:=9600; -- RS232 baudrate
95 ADDR_W : natural:=18; -- 18 bits address space=256 kB, 128 kB I/O
96 BRAM_W : natural:=15); -- 15 bits RAM space=32 kB
98 clk_i : in std_logic; -- CPU clock
99 rst_i : in std_logic; -- Reset
100 break_o : out std_logic; -- Break executed
101 dbg_o : out zpu_dbgo_t; -- Debug info
102 rs232_tx_o : out std_logic; -- UART Tx
103 rs232_rx_i : in std_logic; -- UART Rx
104 gpio_in : in std_logic_vector(31 downto 0);
105 gpio_out : out std_logic_vector(31 downto 0);
106 gpio_dir : out std_logic_vector(31 downto 0) -- 1 = in, 0 = out
108 end component ZPU_Med1;
112 WORD_SIZE => WORD_SIZE, D_CARE_VAL => D_CARE_VAL,
113 CLK_FREQ => CLK_FREQ, BRATE => BRATE, ADDR_W => ADDR_W,
116 clk_i => clk_i, rst_i => rst_i, rs232_tx_o => rs232_tx_o,
117 rs232_rx_i => rs232_rx_i, dbg_o => open, gpio_in => (others => '0'));
118 end architecture FPGA; -- Entity: DMIPS_Med1