Merge branch '77-add-axi-cpu-and-ram' into 'AXI-Rewrite'
Resolve "Add axi cpu and ram" Closes #77 See merge request bslathi19/super6502!66
This commit is contained in:
15
.gitlab-ci.yml
Normal file
15
.gitlab-ci.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
build hw:
|
||||
stage: build
|
||||
tags:
|
||||
- efinity
|
||||
- linux
|
||||
script:
|
||||
- source init_env.sh
|
||||
- make hw
|
||||
|
||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[submodule "hw/super6502_fpga/src/sub/rtl-common"]
|
||||
path = hw/super6502_fpga/src/sub/rtl-common
|
||||
url = ../rtl-common.git
|
||||
[submodule "hw/super6502_fpga/src/sub/axi_crossbar"]
|
||||
path = hw/super6502_fpga/src/sub/axi_crossbar
|
||||
url = ../axi_crossbar.git
|
||||
9
Makefile
Normal file
9
Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
all: hw
|
||||
|
||||
.PHONY: hw
|
||||
hw:
|
||||
$(MAKE) -C hw
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(MAKE) -C hw $@
|
||||
6
hw/Makefile
Normal file
6
hw/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
all:
|
||||
$(MAKE) -C super6502_fpga
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(MAKE) -C super6502_fpga $@
|
||||
3
hw/super6502_fpga/.gitignore
vendored
Normal file
3
hw/super6502_fpga/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
outflow
|
||||
work_*
|
||||
.lock
|
||||
15
hw/super6502_fpga/Makefile
Normal file
15
hw/super6502_fpga/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
SUPER6502_FPGA_SOURCES=$(shell cat sources.list)
|
||||
|
||||
SUPER6502_FPGA_BITSTREAM=outflow/super6502_fpga.hex
|
||||
|
||||
SUPER6502_FPGA_PROJECT=super6502_fpga.xml
|
||||
|
||||
all: $(SUPER6502_FPGA_BITSTREAM)
|
||||
|
||||
$(SUPER6502_FPGA_BITSTREAM): $(SUPER6502_FPGA_SOURCES) $(SUPER6502_FPGA_PROJECT)
|
||||
efx_run.py $(SUPER6502_FPGA_PROJECT)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf work_*
|
||||
rm -rf outflow
|
||||
5
hw/super6502_fpga/addr_map.mem
Normal file
5
hw/super6502_fpga/addr_map.mem
Normal file
@@ -0,0 +1,5 @@
|
||||
@00000000
|
||||
00000000
|
||||
000001ff
|
||||
0000ff00
|
||||
0000ffff
|
||||
5
hw/super6502_fpga/constraints/constraints.sdc
Normal file
5
hw/super6502_fpga/constraints/constraints.sdc
Normal file
@@ -0,0 +1,5 @@
|
||||
create_clock -period 5.00 i_sdrclk
|
||||
create_clock -period 5.00 i_tACclk
|
||||
create_clock -period 10.00 i_sysclk
|
||||
|
||||
create_generated_clock -source i_sysclk -divide_by 50 clk_cpu
|
||||
65
hw/super6502_fpga/init_hex.mem
Normal file
65
hw/super6502_fpga/init_hex.mem
Normal file
@@ -0,0 +1,65 @@
|
||||
@00000000
|
||||
8d00a9
|
||||
200cd02
|
||||
801a03d0
|
||||
fe80f5
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
ff000000
|
||||
ff00ff00
|
||||
14
hw/super6502_fpga/sources.list
Normal file
14
hw/super6502_fpga/sources.list
Normal file
@@ -0,0 +1,14 @@
|
||||
src/rtl/super_6502_fpga.sv
|
||||
src/sub/axi_crossbar/src/rtl/axi_crossbar.sv
|
||||
src/sub/axi_crossbar/src/rtl/axi_master.sv
|
||||
src/sub/axi_crossbar/src/rtl/axi_slave.sv
|
||||
src/sub/axi_crossbar/src/rtl/rr_scheduler.sv
|
||||
src/sub/axi_crossbar/src/rtl/slave_addr_decoder.sv
|
||||
src/sub/cpu_wrapper/cpu_wrapper.sv
|
||||
src/sub/rtl-common/src/rtl/async_fifo.sv
|
||||
src/sub/rtl-common/src/rtl/axi4_lite_ram.sv
|
||||
src/sub/rtl-common/src/rtl/axi4_lite_rom.sv
|
||||
src/sub/rtl-common/src/rtl/ff_cdc.sv
|
||||
src/sub/rtl-common/src/rtl/shallow_async_fifo.sv
|
||||
src/sub/rtl-common/src/rtl/sync_fifo.sv
|
||||
|
||||
257
hw/super6502_fpga/src/rtl/super_6502_fpga.sv
Normal file
257
hw/super6502_fpga/src/rtl/super_6502_fpga.sv
Normal file
@@ -0,0 +1,257 @@
|
||||
module super6502_fpga(
|
||||
input logic i_sysclk, // Controller Clock (100MHz)
|
||||
input logic i_sdrclk, // t_su and t_wd clock (200MHz)
|
||||
input logic i_tACclk, // t_ac clock (200MHz)
|
||||
input clk_cpu,
|
||||
|
||||
input button_reset,
|
||||
|
||||
input pll_cpu_locked,
|
||||
output logic pll_cpu_reset,
|
||||
|
||||
input i_pll_locked,
|
||||
output logic o_pll_reset,
|
||||
|
||||
input [7:0] i_cpu0_data_from_cpu,
|
||||
input i_cpu0_sync,
|
||||
input i_cpu0_rwb,
|
||||
input logic [15:0] i_cpu0_addr,
|
||||
output logic [7:0] o_cpu0_data_from_dut,
|
||||
output logic [7:0] o_cpu0_data_oe,
|
||||
output logic o_cpu0_irqb,
|
||||
output logic o_cpu0_nmib,
|
||||
output logic o_cpu0_rdy,
|
||||
output logic o_cpu0_reset,
|
||||
output logic o_clk_phi2
|
||||
);
|
||||
|
||||
|
||||
localparam ADDR_WIDTH = 32;
|
||||
localparam DATA_WIDTH = 32;
|
||||
|
||||
assign pll_cpu_reset = '1;
|
||||
assign o_pll_reset = '1;
|
||||
|
||||
assign o_cpu0_nmib = '1;
|
||||
|
||||
assign o_clk_phi2 = clk_cpu;
|
||||
|
||||
assign o_cpu0_data_oe = {8{i_cpu0_rwb}};
|
||||
|
||||
|
||||
logic master_reset;
|
||||
|
||||
assign master_reset = button_reset;
|
||||
|
||||
logic cpu0_AWVALID;
|
||||
logic cpu0_AWREADY;
|
||||
logic [ADDR_WIDTH-1:0] cpu0_AWADDR;
|
||||
logic cpu0_WVALID;
|
||||
logic cpu0_WREADY;
|
||||
logic [DATA_WIDTH-1:0] cpu0_WDATA;
|
||||
logic [DATA_WIDTH/8-1:0] cpu0_WSTRB;
|
||||
logic cpu0_BVALID;
|
||||
logic cpu0_BREADY;
|
||||
logic [1:0] cpu0_BRESP;
|
||||
logic cpu0_ARVALID;
|
||||
logic cpu0_ARREADY;
|
||||
logic [ADDR_WIDTH-1:0] cpu0_ARADDR;
|
||||
logic cpu0_RVALID;
|
||||
logic cpu0_RREADY;
|
||||
logic [DATA_WIDTH-1:0] cpu0_RDATA;
|
||||
logic [1:0] cpu0_RRESP;
|
||||
|
||||
|
||||
logic ram_awvalid;
|
||||
logic ram_awready;
|
||||
logic [ADDR_WIDTH-1:0] ram_awaddr;
|
||||
logic ram_wvalid;
|
||||
logic ram_wready;
|
||||
logic [DATA_WIDTH-1:0] ram_wdata;
|
||||
logic [DATA_WIDTH/8-1:0] ram_wstrb;
|
||||
logic ram_bvalid;
|
||||
logic ram_bready;
|
||||
logic [1:0] ram_bresp;
|
||||
logic ram_arvalid;
|
||||
logic ram_arready;
|
||||
logic [ADDR_WIDTH-1:0] ram_araddr;
|
||||
logic ram_rvalid;
|
||||
logic ram_rready;
|
||||
logic [DATA_WIDTH-1:0] ram_rdata;
|
||||
logic [1:0] ram_rresp;
|
||||
|
||||
logic rom_awvalid;
|
||||
logic rom_awready;
|
||||
logic [ADDR_WIDTH-1:0] rom_awaddr;
|
||||
logic rom_wvalid;
|
||||
logic rom_wready;
|
||||
logic [DATA_WIDTH-1:0] rom_wdata;
|
||||
logic [DATA_WIDTH/8-1:0] rom_wstrb;
|
||||
logic rom_bvalid;
|
||||
logic rom_bready;
|
||||
logic [1:0] rom_bresp;
|
||||
logic rom_arvalid;
|
||||
logic rom_arready;
|
||||
logic [ADDR_WIDTH-1:0] rom_araddr;
|
||||
logic rom_rvalid;
|
||||
logic rom_rready;
|
||||
logic [DATA_WIDTH-1:0] rom_rdata;
|
||||
logic [1:0] rom_rresp;
|
||||
|
||||
|
||||
cpu_wrapper u_cpu_wrapper_0(
|
||||
.i_clk_cpu (clk_cpu),
|
||||
.i_clk_100 (i_sysclk),
|
||||
.i_rst (~master_reset),
|
||||
|
||||
.o_cpu_rst (o_cpu0_reset),
|
||||
.o_cpu_rdy (o_cpu0_rdy),
|
||||
.o_cpu_be (),
|
||||
.o_cpu_irqb (o_cpu0_irqb),
|
||||
.o_cpu_nmib (),
|
||||
.o_cpu_sob (),
|
||||
|
||||
.i_cpu_rwb (i_cpu0_rwb),
|
||||
.i_cpu_sync (i_cpu0_sync),
|
||||
.i_cpu_vpb ('0),
|
||||
.i_cpu_mlb ('0),
|
||||
|
||||
.i_cpu_addr (i_cpu0_addr),
|
||||
.i_cpu_data (i_cpu0_data_from_cpu),
|
||||
.o_cpu_data (o_cpu0_data_from_dut),
|
||||
|
||||
.o_AWVALID (cpu0_AWVALID),
|
||||
.i_AWREADY (cpu0_AWREADY),
|
||||
.o_AWADDR (cpu0_AWADDR),
|
||||
.o_WVALID (cpu0_WVALID),
|
||||
.i_WREADY (cpu0_WREADY),
|
||||
.o_WDATA (cpu0_WDATA),
|
||||
.o_WSTRB (cpu0_WSTRB),
|
||||
.i_BVALID (cpu0_BVALID),
|
||||
.o_BREADY (cpu0_BREADY),
|
||||
.i_BRESP (cpu0_BRESP),
|
||||
.o_ARVALID (cpu0_ARVALID),
|
||||
.i_ARREADY (cpu0_ARREADY),
|
||||
.o_ARADDR (cpu0_ARADDR),
|
||||
.i_RVALID (cpu0_RVALID),
|
||||
.o_RREADY (cpu0_RREADY),
|
||||
.i_RDATA (cpu0_RDATA),
|
||||
.i_RRESP (cpu0_RRESP),
|
||||
|
||||
.i_irq('0),
|
||||
.i_nmi('0)
|
||||
);
|
||||
|
||||
|
||||
axi_crossbar #(
|
||||
.N_INITIATORS(1),
|
||||
.N_TARGETS(2)
|
||||
) u_crossbar (
|
||||
.clk(i_sysclk),
|
||||
.rst(~master_reset),
|
||||
|
||||
.ini_araddr ({cpu0_ARADDR }),
|
||||
.ini_arvalid ({cpu0_ARVALID }),
|
||||
.ini_arready ({cpu0_ARREADY }),
|
||||
.ini_rdata ({cpu0_RDATA }),
|
||||
.ini_rresp ({cpu0_RRESP }),
|
||||
.ini_rvalid ({cpu0_RVALID }),
|
||||
.ini_rready ({cpu0_RREADY }),
|
||||
.ini_awaddr ({cpu0_AWADDR }),
|
||||
.ini_awready ({cpu0_AWREADY }),
|
||||
.ini_awvalid ({cpu0_AWVALID }),
|
||||
.ini_wvalid ({cpu0_WVALID }),
|
||||
.ini_wready ({cpu0_WREADY }),
|
||||
.ini_wdata ({cpu0_WDATA }),
|
||||
.ini_wstrb ({cpu0_WSTRB }),
|
||||
.ini_bresp ({cpu0_BRESP }),
|
||||
.ini_bvalid ({cpu0_BVALID }),
|
||||
.ini_bready ({cpu0_BREADY }),
|
||||
|
||||
.tgt_araddr ({ram_araddr, rom_araddr }),
|
||||
.tgt_arvalid ({ram_arvalid, rom_arvalid }),
|
||||
.tgt_arready ({ram_arready, rom_arready }),
|
||||
.tgt_rdata ({ram_rdata, rom_rdata }),
|
||||
.tgt_rresp ({ram_rresp, rom_rresp }),
|
||||
.tgt_rvalid ({ram_rvalid, rom_rvalid }),
|
||||
.tgt_rready ({ram_rready, rom_rready }),
|
||||
.tgt_awaddr ({ram_awaddr, rom_awaddr }),
|
||||
.tgt_awvalid ({ram_awvalid, rom_awvalid }),
|
||||
.tgt_awready ({ram_awready, rom_awready }),
|
||||
.tgt_wdata ({ram_wdata, rom_wdata }),
|
||||
.tgt_wvalid ({ram_wvalid, rom_wvalid }),
|
||||
.tgt_wready ({ram_wready, rom_wready }),
|
||||
.tgt_wstrb ({ram_wstrb, rom_wstrb }),
|
||||
.tgt_bresp ({ram_bresp, rom_bresp }),
|
||||
.tgt_bvalid ({ram_bvalid, rom_bvalid }),
|
||||
.tgt_bready ({ram_bready, rom_bready })
|
||||
);
|
||||
|
||||
axi4_lite_rom #(
|
||||
.ROM_SIZE(8),
|
||||
.ROM_INIT_FILE("init_hex.mem")
|
||||
) u_rom (
|
||||
.i_clk(i_sysclk),
|
||||
.i_rst(~master_reset),
|
||||
|
||||
.o_AWREADY(rom_awready),
|
||||
.o_WREADY(rom_wready),
|
||||
|
||||
.o_BVALID(rom_bvalid),
|
||||
.i_BREADY(rom_bready),
|
||||
.o_BRESP(rom_bresp),
|
||||
|
||||
.i_ARVALID(rom_arvalid),
|
||||
.o_ARREADY(rom_arready),
|
||||
.i_ARADDR(rom_araddr),
|
||||
.i_ARPROT('0),
|
||||
|
||||
.o_RVALID(rom_rvalid),
|
||||
.i_RREADY(rom_rready),
|
||||
.o_RDATA(rom_rdata),
|
||||
.o_RRESP(rom_rresp),
|
||||
|
||||
.i_AWVALID(rom_awvalid),
|
||||
.i_AWADDR(rom_awaddr),
|
||||
.i_AWPROT('0),
|
||||
|
||||
.i_WVALID(rom_wvalid),
|
||||
.i_WDATA(rom_wdata),
|
||||
.i_WSTRB(rom_wstrb)
|
||||
);
|
||||
|
||||
axi4_lite_ram #(
|
||||
.RAM_SIZE(9)
|
||||
) u_ram(
|
||||
.i_clk(i_sysclk),
|
||||
.i_rst(~master_reset),
|
||||
|
||||
.o_AWREADY(ram_awready),
|
||||
.o_WREADY(ram_wready),
|
||||
|
||||
.o_BVALID(ram_bvalid),
|
||||
.i_BREADY(ram_bready),
|
||||
.o_BRESP(ram_bresp),
|
||||
|
||||
.i_ARVALID(ram_arvalid),
|
||||
.o_ARREADY(ram_arready),
|
||||
.i_ARADDR(ram_araddr),
|
||||
.i_ARPROT('0),
|
||||
|
||||
.o_RVALID(ram_rvalid),
|
||||
.i_RREADY(ram_rready),
|
||||
.o_RDATA(ram_rdata),
|
||||
.o_RRESP(ram_rresp),
|
||||
|
||||
.i_AWVALID(ram_awvalid),
|
||||
.i_AWADDR(ram_awaddr),
|
||||
.i_AWPROT('0),
|
||||
|
||||
.i_WVALID(ram_wvalid),
|
||||
.i_WDATA(ram_wdata),
|
||||
.i_WSTRB(ram_wstrb)
|
||||
);
|
||||
|
||||
|
||||
|
||||
endmodule
|
||||
1
hw/super6502_fpga/src/sub/axi_crossbar
Submodule
1
hw/super6502_fpga/src/sub/axi_crossbar
Submodule
Submodule hw/super6502_fpga/src/sub/axi_crossbar added at 5c61f56e7b
391
hw/super6502_fpga/src/sub/cpu_wrapper/cpu_wrapper.sv
Normal file
391
hw/super6502_fpga/src/sub/cpu_wrapper/cpu_wrapper.sv
Normal file
@@ -0,0 +1,391 @@
|
||||
module cpu_wrapper #(
|
||||
parameter ADDR_WIDTH = 32,
|
||||
parameter DATA_WIDTH = 32
|
||||
)(
|
||||
/* Clocks and Reset */
|
||||
input logic i_clk_cpu,
|
||||
input logic i_clk_100,
|
||||
input logic i_rst,
|
||||
|
||||
/* CPU Control Signals */
|
||||
output logic o_cpu_rst,
|
||||
output logic o_cpu_rdy,
|
||||
output logic o_cpu_be,
|
||||
output logic o_cpu_irqb,
|
||||
output logic o_cpu_nmib,
|
||||
output logic o_cpu_sob,
|
||||
|
||||
/* CPU Status Signals */
|
||||
input logic i_cpu_rwb,
|
||||
input logic i_cpu_sync,
|
||||
input logic i_cpu_vpb,
|
||||
input logic i_cpu_mlb,
|
||||
|
||||
/* CPU Address and Data */
|
||||
input logic [15:0] i_cpu_addr,
|
||||
input logic [7:0] i_cpu_data,
|
||||
output logic [7:0] o_cpu_data,
|
||||
|
||||
/* AXI4-Lite signals */
|
||||
output logic o_AWVALID,
|
||||
input logic i_AWREADY,
|
||||
output logic [ADDR_WIDTH-1:0] o_AWADDR,
|
||||
output logic [2:0] o_AWPROT,
|
||||
|
||||
output logic o_WVALID,
|
||||
input logic i_WREADY,
|
||||
output logic [DATA_WIDTH-1:0] o_WDATA,
|
||||
output logic [DATA_WIDTH/8-1:0] o_WSTRB,
|
||||
|
||||
input logic i_BVALID,
|
||||
output logic o_BREADY,
|
||||
input logic [1:0] i_BRESP,
|
||||
|
||||
output logic o_ARVALID,
|
||||
input logic i_ARREADY,
|
||||
output logic [ADDR_WIDTH-1:0] o_ARADDR,
|
||||
output logic [2:0] o_ARPROT,
|
||||
|
||||
input logic i_RVALID,
|
||||
output logic o_RREADY,
|
||||
input logic [DATA_WIDTH-1:0] i_RDATA,
|
||||
input logic [1:0] i_RRESP,
|
||||
|
||||
/* interrupt signals */
|
||||
input logic i_irq,
|
||||
input logic i_nmi
|
||||
);
|
||||
|
||||
typedef enum logic [3:0] {
|
||||
RESET,
|
||||
IDLE,
|
||||
ADDR_CONTROL,
|
||||
READ_VALID,
|
||||
READ_DATA,
|
||||
WRITE_VALID,
|
||||
GET_WRITE_DATA,
|
||||
WRITE_DATA,
|
||||
STALL
|
||||
} state_t;
|
||||
|
||||
state_t state, state_next;
|
||||
|
||||
logic w_status_empty;
|
||||
logic w_status_r_en;
|
||||
|
||||
logic r_rwb, r_sync, r_vpb, r_mlb;
|
||||
logic r_rwb_next, r_sync_next, r_vpb_next, r_mlb_next;
|
||||
|
||||
logic [15:0] r_addr, r_addr_next;
|
||||
|
||||
logic w_write_data_en;
|
||||
logic [7:0] r_write_data, r_write_data_next;
|
||||
logic w_write_data_empty;
|
||||
|
||||
logic [2:0] counter;
|
||||
logic w_reset;
|
||||
|
||||
always @(posedge i_clk_cpu) begin
|
||||
if (i_rst) begin
|
||||
counter <= '1;
|
||||
end else if (counter) begin
|
||||
counter <= counter - 3'd1;
|
||||
end
|
||||
end
|
||||
|
||||
assign w_reset = |counter;
|
||||
|
||||
ff_cdc #(
|
||||
.RESET_VAL(0)
|
||||
) u_cpu_rst_cdc (
|
||||
.rst(i_rst),
|
||||
.clk(i_clk_cpu),
|
||||
.data_a(~w_reset),
|
||||
.data_b(o_cpu_rst)
|
||||
);
|
||||
|
||||
ff_cdc u_cpu_irq_cdc (
|
||||
.rst(i_rst),
|
||||
.clk(i_clk_cpu),
|
||||
.data_a(~i_irq),
|
||||
.data_b(o_cpu_irqb)
|
||||
);
|
||||
|
||||
ff_cdc u_cpu_nmi_cdc (
|
||||
.rst(i_rst),
|
||||
.clk(i_clk_cpu),
|
||||
.data_a(~i_nmi),
|
||||
.data_b(o_cpu_nmib)
|
||||
);
|
||||
|
||||
// This fifo says it has a bug with back to back writes, but maybe that
|
||||
// is only for fast -> slow? this is slow -> fast.
|
||||
// async_fifo #(
|
||||
// .WIDTH(20),
|
||||
// .A_SIZE(3)
|
||||
// ) u_status_addr_fifo (
|
||||
// .i_rst_a(o_cpu_rst),
|
||||
// .i_clk_a(i_clk_cpu),
|
||||
// .i_rst_b(i_rst),
|
||||
// .i_clk_b(i_clk_100),
|
||||
// .w_en('1), // investigate this
|
||||
// .i_data({i_cpu_rwb, i_cpu_sync, i_cpu_vpb, i_cpu_mlb, i_cpu_addr}),
|
||||
// .o_full(),
|
||||
// .r_en(w_status_r_en),
|
||||
// .o_data({r_rwb_next, r_sync_next, r_vpb_next, r_mlb_next, r_addr_next}),
|
||||
// .o_empty(w_status_empty)
|
||||
// );
|
||||
|
||||
|
||||
logic [1:0] flag;
|
||||
|
||||
assign w_status_empty = ~flag[0];
|
||||
|
||||
assign r_rwb_next = i_cpu_rwb;
|
||||
assign r_sync_next = i_cpu_sync;
|
||||
assign r_vpb_next = i_cpu_vpb;
|
||||
assign r_mlb_next = i_cpu_mlb;
|
||||
assign r_addr_next = i_cpu_addr;
|
||||
|
||||
always @(posedge i_clk_100 or posedge i_rst) begin
|
||||
if (i_rst) begin
|
||||
flag <= '0;
|
||||
end else begin
|
||||
if (i_clk_cpu) begin
|
||||
if (flag == '0) begin
|
||||
flag <= 2'h1;
|
||||
end else if (flag == 2'h1) begin
|
||||
flag <= 2'h2;
|
||||
end
|
||||
end else begin
|
||||
flag <= '0;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
// // This uses inverted clock, remember in sdc?
|
||||
// async_fifo #(
|
||||
// .WIDTH(8),
|
||||
// .A_SIZE(3)
|
||||
// ) u_write_data_fifo (
|
||||
// .i_rst_a(o_cpu_rst),
|
||||
// .i_clk_a(~i_clk_cpu),
|
||||
// .i_rst_b(i_rst),
|
||||
// .i_clk_b(i_clk_100),
|
||||
// .w_en('1),
|
||||
// .i_data(i_cpu_data),
|
||||
// .o_full(),
|
||||
// .r_en(w_write_data_en),
|
||||
// .o_data(r_write_data_next),
|
||||
// .o_empty(w_write_data_empty)
|
||||
// );
|
||||
|
||||
|
||||
// Really bad double flop bus
|
||||
always @(negedge i_clk_cpu) begin
|
||||
r_write_data_next <= i_cpu_data;
|
||||
end
|
||||
|
||||
|
||||
logic [1:0] flag2;
|
||||
|
||||
assign w_write_data_empty = ~flag2[0];
|
||||
|
||||
always @(posedge i_clk_100 or posedge i_rst) begin
|
||||
if (i_rst) begin
|
||||
flag2 <= '0;
|
||||
end else begin
|
||||
if (~i_clk_cpu) begin
|
||||
if (flag2 == '0) begin
|
||||
flag2 <= 2'h1;
|
||||
end else if (flag2 == 2'h1) begin
|
||||
flag2 <= 2'h2;
|
||||
end
|
||||
end else begin
|
||||
flag2 <= '0;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
localparam MAX_DELAY = 4;
|
||||
|
||||
logic [7:0] cycle_counter;
|
||||
logic too_late;
|
||||
|
||||
logic [2:0] rdy_dly;
|
||||
logic potential_rdy;
|
||||
logic did_delay, did_delay_next;
|
||||
|
||||
assign potential_rdy = |rdy_dly;
|
||||
|
||||
assign too_late = cycle_counter > MAX_DELAY ? 1 : 0;
|
||||
|
||||
always_ff @(posedge i_clk_100 or posedge i_rst) begin
|
||||
if (i_rst) begin
|
||||
cycle_counter <= '0;
|
||||
rdy_dly <= '0;
|
||||
end else begin
|
||||
if (i_clk_cpu) begin
|
||||
cycle_counter <= cycle_counter + 1;
|
||||
end else begin
|
||||
cycle_counter <= '0;
|
||||
end
|
||||
|
||||
rdy_dly <= {rdy_dly[1:0], too_late};
|
||||
end
|
||||
end
|
||||
|
||||
logic [7:0] read_data, read_data_next;
|
||||
assign o_cpu_data = read_data;
|
||||
|
||||
always_comb begin
|
||||
state_next = state;
|
||||
|
||||
// Set defaults
|
||||
o_AWVALID = '0;
|
||||
o_AWADDR = '0;
|
||||
o_AWPROT = '0;
|
||||
o_WVALID = '0;
|
||||
o_WDATA = '0;
|
||||
o_WSTRB = '0;
|
||||
o_BREADY = '0;
|
||||
o_ARVALID = '0;
|
||||
o_ARADDR = '0;
|
||||
o_ARPROT = '0;
|
||||
o_RREADY = '0;
|
||||
|
||||
o_cpu_rdy = '1;
|
||||
|
||||
read_data_next = read_data;
|
||||
did_delay_next = did_delay;
|
||||
|
||||
case (state)
|
||||
RESET: begin
|
||||
// Is this a CDC violation?
|
||||
if (i_cpu_addr == 16'hFFFC) begin
|
||||
state_next = IDLE;
|
||||
end
|
||||
end
|
||||
|
||||
IDLE: begin
|
||||
if (~w_status_empty) begin
|
||||
state_next = ADDR_CONTROL;
|
||||
end
|
||||
|
||||
did_delay_next = '0;
|
||||
end
|
||||
|
||||
ADDR_CONTROL: begin
|
||||
if (r_rwb) begin
|
||||
state_next = READ_VALID;
|
||||
end else begin
|
||||
state_next = WRITE_VALID;
|
||||
end
|
||||
end
|
||||
|
||||
READ_VALID: begin
|
||||
o_ARVALID = '1;
|
||||
// $display("%x %x %x", o_ARVALID, i_ARREADY, o_ARVALID & i_ARREADY);
|
||||
|
||||
if (o_ARVALID & i_ARREADY) begin
|
||||
// $display("AHHHHHH");
|
||||
state_next = READ_DATA;
|
||||
// $display("next state: %x", state_next);
|
||||
end
|
||||
|
||||
o_ARADDR = {r_addr[15:2], 2'b0};
|
||||
end
|
||||
|
||||
READ_DATA: begin
|
||||
if (potential_rdy) begin
|
||||
state_next = READ_DATA;
|
||||
o_cpu_rdy = ~potential_rdy;
|
||||
did_delay_next = '1;
|
||||
end
|
||||
|
||||
if (i_RVALID) begin
|
||||
if (did_delay || potential_rdy) begin
|
||||
state_next = STALL;
|
||||
end else begin
|
||||
state_next = IDLE;
|
||||
end
|
||||
read_data_next = i_RDATA[8*r_addr[1:0] +: 8];
|
||||
end
|
||||
|
||||
o_RREADY = '1;
|
||||
end
|
||||
|
||||
WRITE_VALID: begin
|
||||
if (~w_write_data_empty) begin
|
||||
state_next = WRITE_DATA;
|
||||
end
|
||||
end
|
||||
|
||||
GET_WRITE_DATA: begin
|
||||
$error("GET_WRITE_DATA not implemented");
|
||||
state_next = IDLE;
|
||||
end
|
||||
|
||||
WRITE_DATA: begin
|
||||
o_AWVALID = '1;
|
||||
o_AWADDR = {r_addr[15:2], 2'b0};
|
||||
o_WVALID = '1;
|
||||
o_WSTRB = 4'b1 << r_addr[1:0];
|
||||
o_WDATA = r_write_data << 8*r_addr[1:0];
|
||||
|
||||
o_BREADY = '1;
|
||||
if (i_BVALID) begin
|
||||
state_next = IDLE;
|
||||
end
|
||||
end
|
||||
|
||||
STALL: begin
|
||||
// kind of dumb
|
||||
if (cycle_counter == 1) begin
|
||||
state_next = IDLE;
|
||||
end
|
||||
|
||||
o_cpu_rdy = ~potential_rdy;
|
||||
end
|
||||
|
||||
default: begin
|
||||
// $error("Invalid state");
|
||||
state_next = IDLE;
|
||||
end
|
||||
|
||||
endcase
|
||||
end
|
||||
|
||||
always_ff @(posedge i_clk_100 or posedge i_rst) begin
|
||||
if (i_rst) begin
|
||||
r_rwb <= '1; // start as 1 to indicate read.
|
||||
r_sync <= '0;
|
||||
r_vpb <= '0;
|
||||
r_mlb <= '0;
|
||||
r_addr <= '0;
|
||||
read_data <= '0;
|
||||
r_write_data <= '0;
|
||||
did_delay <= '0;
|
||||
|
||||
state <= RESET;
|
||||
end else begin
|
||||
if (~w_status_empty) begin
|
||||
w_status_r_en <= '1;
|
||||
r_rwb <= r_rwb_next;
|
||||
r_sync <= r_sync_next;
|
||||
r_vpb <= r_vpb_next;
|
||||
r_mlb <= r_mlb_next;
|
||||
r_addr <= r_addr_next;
|
||||
end else begin
|
||||
w_status_r_en <= '0;
|
||||
end
|
||||
|
||||
read_data <= read_data_next;
|
||||
state <= state_next;
|
||||
did_delay <= did_delay_next;
|
||||
|
||||
r_write_data <= r_write_data_next;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
1
hw/super6502_fpga/src/sub/rtl-common
Submodule
1
hw/super6502_fpga/src/sub/rtl-common
Submodule
Submodule hw/super6502_fpga/src/sub/rtl-common added at 170285d7ab
155
hw/super6502_fpga/super6502_fpga.peri.xml
Normal file
155
hw/super6502_fpga/super6502_fpga.peri.xml
Normal file
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<efxpt:design_db name="super6502_fpga" device_def="T20F256" location="/home/byron/Projects/super6502/hw/super6502_fpga" version="2023.1.150" db_version="20231999" last_change_date="Sun Mar 3 09:38:42 2024" xmlns:efxpt="http://www.efinixinc.com/peri_design_db" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.efinixinc.com/peri_design_db peri_design_db.xsd ">
|
||||
<efxpt:device_info>
|
||||
<efxpt:iobank_info>
|
||||
<efxpt:iobank name="1A" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="1B_1C" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="1D_1E" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="3A_3B_3C" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="3D_3E" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="4A" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="4B" iostd="3.3 V LVTTL / LVCMOS"/>
|
||||
<efxpt:iobank name="BR" iostd="1.2 V"/>
|
||||
<efxpt:iobank name="TL" iostd="1.2 V"/>
|
||||
<efxpt:iobank name="TR" iostd="1.2 V"/>
|
||||
</efxpt:iobank_info>
|
||||
<efxpt:ctrl_info>
|
||||
<efxpt:ctrl name="cfg" ctrl_def="CONFIG_CTRL0" clock_name="" is_clk_invert="false" cbsel_bus_name="cfg_CBSEL" config_ctrl_name="cfg_CONFIG" ena_capture_name="cfg_ENA" error_status_name="cfg_ERROR" um_signal_status_name="cfg_USR_STATUS" is_remote_update_enable="false" is_user_mode_enable="false"/>
|
||||
</efxpt:ctrl_info>
|
||||
</efxpt:device_info>
|
||||
<efxpt:gpio_info device_def="T20F256">
|
||||
<efxpt:gpio name="button_reset" gpio_def="GPIOL_02" mode="input" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="button_reset" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[0]" gpio_def="GPIOL_68" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[0]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[0]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[0]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[1]" gpio_def="GPIOL_66" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[1]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[1]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[1]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[2]" gpio_def="GPIOL_64" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[2]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[2]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[2]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[3]" gpio_def="GPIOL_61" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[3]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[3]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[3]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[4]" gpio_def="GPIOL_59" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[4]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[4]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[4]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[5]" gpio_def="GPIOL_57" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[5]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[5]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[5]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[6]" gpio_def="GPIOL_55" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[6]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[6]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[6]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="cpu_data[7]" gpio_def="GPIOL_53" mode="inout" bus_name="cpu_data" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_data_from_cpu[7]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
<efxpt:output_config name="o_cpu0_data_from_dut[7]" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
<efxpt:output_enable_config name="o_cpu0_data_oe[7]" is_register="false" clock_name="" is_clock_inverted="false"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[0]" gpio_def="GPIOL_65" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[0]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[10]" gpio_def="GPIOL_46" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[10]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[11]" gpio_def="GPIOL_44" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[11]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[12]" gpio_def="GPIOL_45" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[12]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[13]" gpio_def="GPIOL_47" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[13]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[14]" gpio_def="GPIOL_49" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[14]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[15]" gpio_def="GPIOL_51" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[15]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[1]" gpio_def="GPIOL_63" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[1]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[2]" gpio_def="GPIOL_62" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[2]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[3]" gpio_def="GPIOL_60" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[3]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[4]" gpio_def="GPIOL_58" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[4]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[5]" gpio_def="GPIOL_56" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[5]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[6]" gpio_def="GPIOL_54" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[6]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[7]" gpio_def="GPIOL_52" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[7]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[8]" gpio_def="GPIOL_50" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[8]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_addr[9]" gpio_def="GPIOL_48" mode="input" bus_name="cpu_addr" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_addr[9]" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_rwb" gpio_def="GPIOL_70" mode="input" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_rwb" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="i_cpu0_sync" gpio_def="GPIOL_67" mode="input" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="i_cpu0_sync" name_ddio_lo="" conn_type="normal" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="o_clk_phi2" gpio_def="GPIOL_71" mode="output" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:output_config name="o_clk_phi2" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="1"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="o_cpu0_irqb" gpio_def="GPIOL_72" mode="output" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:output_config name="o_cpu0_irqb" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="o_cpu0_nmib" gpio_def="GPIOL_69" mode="output" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:output_config name="o_cpu0_nmib" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="o_cpu0_rdy" gpio_def="GPIOL_74" mode="output" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:output_config name="o_cpu0_rdy" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="o_cpu0_reset" gpio_def="GPIOL_73" mode="output" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:output_config name="o_cpu0_reset" name_ddio_lo="" register_option="none" clock_name="" is_clock_inverted="false" is_slew_rate="false" tied_option="none" ddio_type="none" drive_strength="3"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:gpio name="pll_in" gpio_def="GPIOR_157" mode="input" bus_name="" is_lvds_gpio="false" io_standard="3.3 V LVTTL / LVCMOS">
|
||||
<efxpt:input_config name="pll_in" name_ddio_lo="" conn_type="pll_clkin" is_register="false" clock_name="" is_clock_inverted="false" pull_option="none" is_schmitt_trigger="false" ddio_type="none"/>
|
||||
</efxpt:gpio>
|
||||
<efxpt:global_unused_config state="input with weak pullup"/>
|
||||
<efxpt:bus name="cpu_data" mode="inout" msb="7" lsb="0"/>
|
||||
<efxpt:bus name="cpu_addr" mode="input" msb="15" lsb="0"/>
|
||||
</efxpt:gpio_info>
|
||||
<efxpt:pll_info>
|
||||
<efxpt:pll name="pll_cpu_clk" pll_def="PLL_TR1" ref_clock_name="i_sysclk" ref_clock_freq="100.0000" multiplier="16" pre_divider="2" post_divider="4" reset_name="pll_cpu_reset" locked_name="pll_cpu_locked" is_ipfrz="false" is_bypass_lock="true">
|
||||
<efxpt:output_clock name="clk_50" number="0" out_divider="4" adv_out_phase_shift="0"/>
|
||||
<efxpt:output_clock name="clk_cpu" number="1" out_divider="100" adv_out_phase_shift="0"/>
|
||||
<efxpt:adv_prop ref_clock_mode="core" ref_clock1_name="" ext_ref_clock_id="2" clksel_name="" feedback_clock_name="" feedback_mode="internal"/>
|
||||
</efxpt:pll>
|
||||
<efxpt:pll name="pll_sdram_clk" pll_def="PLL_BR0" ref_clock_name="" ref_clock_freq="50.0000" multiplier="8" pre_divider="4" post_divider="2" reset_name="o_pll_reset" locked_name="i_pll_locked" is_ipfrz="false" is_bypass_lock="true">
|
||||
<efxpt:output_clock name="i_sdrclk" number="0" out_divider="2" adv_out_phase_shift="0"/>
|
||||
<efxpt:output_clock name="i_tACclk" number="1" out_divider="2" adv_out_phase_shift="0"/>
|
||||
<efxpt:output_clock name="i_sysclk" number="2" out_divider="4" adv_out_phase_shift="0"/>
|
||||
<efxpt:adv_prop ref_clock_mode="external" ref_clock1_name="" ext_ref_clock_id="3" clksel_name="" feedback_clock_name="i_sysclk" feedback_mode="core"/>
|
||||
</efxpt:pll>
|
||||
</efxpt:pll_info>
|
||||
<efxpt:lvds_info/>
|
||||
<efxpt:jtag_info/>
|
||||
</efxpt:design_db>
|
||||
89
hw/super6502_fpga/super6502_fpga.xml
Normal file
89
hw/super6502_fpga/super6502_fpga.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<efx:project xmlns:efx="http://www.efinixinc.com/enf_proj" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="super6502_fpga" description="" last_change_date="Sat Mar 02 2024 10:46:33 PM" location="/home/byron/Projects/super6502/hw/super6502_fpga" sw_version="2023.1.150" last_run_state="pass" last_run_tool="efx_pgm" last_run_flow="bitstream" config_result_in_sync="sync" design_ood="sync" place_ood="sync" route_ood="sync" xsi:schemaLocation="http://www.efinixinc.com/enf_proj enf_proj.xsd">
|
||||
<efx:device_info>
|
||||
<efx:family name="Trion" />
|
||||
<efx:device name="T20F256" />
|
||||
<efx:timing_model name="I4" />
|
||||
</efx:device_info>
|
||||
<efx:design_info def_veri_version="sv_09" def_vhdl_version="vhdl_2008">
|
||||
<efx:top_module name="super6502_fpga" />
|
||||
<efx:design_file name="src/rtl/super_6502_fpga.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/cpu_wrapper/cpu_wrapper.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/rtl-common/src/rtl/axi4_lite_rom.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/rtl-common/src/rtl/axi4_lite_ram.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/rtl-common/src/rtl/ff_cdc.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/axi_crossbar/src/rtl/axi_master.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/axi_crossbar/src/rtl/axi_slave.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/axi_crossbar/src/rtl/slave_addr_decoder.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/axi_crossbar/src/rtl/axi_crossbar.sv" version="default" library="default" />
|
||||
<efx:design_file name="src/sub/axi_crossbar/src/rtl/rr_scheduler.sv" version="default" library="default" />
|
||||
<efx:top_vhdl_arch name="" />
|
||||
</efx:design_info>
|
||||
<efx:constraint_info>
|
||||
<efx:sdc_file name="constraints/constraints.sdc" />
|
||||
<efx:inter_file name="" />
|
||||
</efx:constraint_info>
|
||||
<efx:sim_info />
|
||||
<efx:misc_info />
|
||||
<efx:ip_info />
|
||||
<efx:synthesis tool_name="efx_map">
|
||||
<efx:param name="work_dir" value="work_syn" value_type="e_string" />
|
||||
<efx:param name="write_efx_verilog" value="on" value_type="e_bool" />
|
||||
<efx:param name="allow-const-ram-index" value="0" value_type="e_option" />
|
||||
<efx:param name="blackbox-error" value="1" value_type="e_option" />
|
||||
<efx:param name="blast_const_operand_adders" value="1" value_type="e_option" />
|
||||
<efx:param name="bram_output_regs_packing" value="1" value_type="e_option" />
|
||||
<efx:param name="create-onehot-fsms" value="0" value_type="e_option" />
|
||||
<efx:param name="fanout-limit" value="0" value_type="e_integer" />
|
||||
<efx:param name="hdl-compile-unit" value="1" value_type="e_option" />
|
||||
<efx:param name="infer-clk-enable" value="3" value_type="e_option" />
|
||||
<efx:param name="infer-sync-set-reset" value="1" value_type="e_option" />
|
||||
<efx:param name="max_ram" value="-1" value_type="e_integer" />
|
||||
<efx:param name="max_mult" value="-1" value_type="e_integer" />
|
||||
<efx:param name="min-sr-fanout" value="0" value_type="e_integer" />
|
||||
<efx:param name="min-ce-fanout" value="0" value_type="e_integer" />
|
||||
<efx:param name="mult-decomp-retime" value="0" value_type="e_option" />
|
||||
<efx:param name="mode" value="speed" value_type="e_option" />
|
||||
<efx:param name="operator-sharing" value="0" value_type="e_option" />
|
||||
<efx:param name="optimize-adder-tree" value="0" value_type="e_option" />
|
||||
<efx:param name="optimize-zero-init-rom" value="1" value_type="e_option" />
|
||||
<efx:param name="retiming" value="1" value_type="e_option" />
|
||||
<efx:param name="seq_opt" value="1" value_type="e_option" />
|
||||
<efx:param name="seq-opt-sync-only" value="0" value_type="e_option" />
|
||||
<efx:param name="mult_input_regs_packing" value="1" value_type="e_option" />
|
||||
<efx:param name="mult_output_regs_packing" value="1" value_type="e_option" />
|
||||
</efx:synthesis>
|
||||
<efx:place_and_route tool_name="efx_pnr">
|
||||
<efx:param name="work_dir" value="work_pnr" value_type="e_string" />
|
||||
<efx:param name="verbose" value="off" value_type="e_bool" />
|
||||
<efx:param name="load_delaym" value="on" value_type="e_bool" />
|
||||
<efx:param name="optimization_level" value="NULL" value_type="e_option" />
|
||||
<efx:param name="seed" value="1" value_type="e_integer" />
|
||||
<efx:param name="placer_effort_level" value="2" value_type="e_option" />
|
||||
<efx:param name="max_threads" value="-1" value_type="e_integer" />
|
||||
</efx:place_and_route>
|
||||
<efx:bitstream_generation tool_name="efx_pgm">
|
||||
<efx:param name="mode" value="active" value_type="e_option" />
|
||||
<efx:param name="width" value="1" value_type="e_option" />
|
||||
<efx:param name="enable_roms" value="smart" value_type="e_option" />
|
||||
<efx:param name="spi_low_power_mode" value="on" value_type="e_bool" />
|
||||
<efx:param name="io_weak_pullup" value="on" value_type="e_bool" />
|
||||
<efx:param name="oscillator_clock_divider" value="DIV8" value_type="e_option" />
|
||||
<efx:param name="bitstream_compression" value="off" value_type="e_bool" />
|
||||
<efx:param name="enable_external_master_clock" value="off" value_type="e_bool" />
|
||||
<efx:param name="active_capture_clk_edge" value="posedge" value_type="e_option" />
|
||||
<efx:param name="jtag_usercode" value="0xFFFFFFFF" value_type="e_string" />
|
||||
<efx:param name="release_tri_then_reset" value="on" value_type="e_bool" />
|
||||
<efx:param name="four_byte_addressing" value="off" value_type="e_bool" />
|
||||
<efx:param name="generate_bit" value="on" value_type="e_bool" />
|
||||
<efx:param name="generate_bitbin" value="off" value_type="e_bool" />
|
||||
<efx:param name="generate_hex" value="on" value_type="e_bool" />
|
||||
<efx:param name="generate_hexbin" value="off" value_type="e_bool" />
|
||||
<efx:param name="cold_boot" value="off" value_type="e_bool" />
|
||||
<efx:param name="cascade" value="off" value_type="e_option" />
|
||||
</efx:bitstream_generation>
|
||||
<efx:debugger>
|
||||
<efx:param name="work_dir" value="work_dbg" value_type="e_string" />
|
||||
<efx:param name="auto_instantiation" value="off" value_type="e_bool" />
|
||||
<efx:param name="profile" value="NONE" value_type="e_string" />
|
||||
</efx:debugger>
|
||||
</efx:project>
|
||||
Reference in New Issue
Block a user