SummerCart64/fw/rtl/cpu/cpu_soc.sv

70 lines
1.3 KiB
Systemverilog
Raw Normal View History

2021-08-12 21:07:47 +02:00
module cpu_soc (
if_system.sys system_if,
2021-08-05 19:50:29 +02:00
2021-08-12 21:07:47 +02:00
input [7:0] gpio_i,
output [7:0] gpio_o,
output [7:0] gpio_oe,
2021-08-05 19:50:29 +02:00
2021-08-12 21:07:47 +02:00
output usb_clk,
output usb_cs,
input usb_miso,
inout [3:0] usb_miosi,
2021-08-05 19:50:29 +02:00
2021-08-15 21:49:02 +02:00
inout i2c_scl,
inout i2c_sda
2021-08-05 19:50:29 +02:00
);
2021-08-15 21:49:02 +02:00
enum bit [3:0] {
RAM,
BOOTLOADER,
GPIO,
I2C,
USB,
__NUM_DEVICES
} e_address_map;
if_cpu_bus #(
.NUM_DEVICES(__NUM_DEVICES)
) bus (
2021-08-05 19:50:29 +02:00
.clk(system_if.clk),
2021-08-15 21:49:02 +02:00
.reset(system_if.reset)
2021-08-05 19:50:29 +02:00
);
2021-08-15 21:49:02 +02:00
cpu_wrapper # (
.ENTRY_DEVICE(BOOTLOADER)
) cpu_wrapper_inst (
.bus(bus)
);
2021-08-05 19:50:29 +02:00
2021-08-15 21:49:02 +02:00
cpu_ram cpu_ram_inst (
.bus(bus.at[RAM].device)
);
2021-08-05 19:50:29 +02:00
2021-08-15 21:49:02 +02:00
cpu_bootloader cpu_bootloader_inst (
.bus(bus.at[BOOTLOADER].device)
);
2021-08-05 19:50:29 +02:00
2021-08-12 21:07:47 +02:00
cpu_gpio cpu_gpio_inst (
2021-08-15 21:49:02 +02:00
.bus(bus.at[GPIO].device),
2021-08-12 21:07:47 +02:00
.gpio_i(gpio_i),
.gpio_o(gpio_o),
.gpio_oe(gpio_oe)
);
cpu_i2c cpu_i2c_inst (
2021-08-15 21:49:02 +02:00
.bus(bus.at[I2C].device),
.i2c_scl(i2c_scl),
.i2c_sda(i2c_sda)
2021-08-12 21:07:47 +02:00
);
cpu_usb cpu_usb_inst (
2021-08-15 21:49:02 +02:00
.system_if(system_if),
.bus(bus.at[USB].device),
2021-08-12 21:07:47 +02:00
.usb_clk(usb_clk),
.usb_cs(usb_cs),
.usb_miso(usb_miso),
.usb_miosi(usb_miosi)
);
2021-08-05 19:50:29 +02:00
endmodule