Working version with loader from schmidt trigger
This commit is contained in:
+11
-5
@@ -18,7 +18,8 @@ module spectrum(output wire[7:0] LED,
|
||||
output wire VGA_VS,
|
||||
input wire[3:0] SW, // 0 = ROM selection, 1 = enable/disable interrupts, 2 = turbo speed
|
||||
output wire[33:0] GPIO_1, // Exports CPU chip pins,
|
||||
output wire buzzer_out
|
||||
output wire buzzer_out,
|
||||
input wire raw_loader_in
|
||||
);
|
||||
`default_nettype none
|
||||
|
||||
@@ -93,7 +94,10 @@ assign io_we = nIORQ==0 && nRD==1 && nWR==0;
|
||||
always @(*) // always_comb
|
||||
begin
|
||||
case ({nIORQ,nRD,nWR})
|
||||
// -------------------------------- Memory read --------------------------------
|
||||
// --------------------------------
|
||||
|
||||
|
||||
// Memory read --------------------------------
|
||||
3'b101: begin
|
||||
casez (A[15:14])
|
||||
2'b00: D[7:0] = rom_data;
|
||||
@@ -139,13 +143,13 @@ wire[7:0] ram0_data;
|
||||
// "A" port is the CPU side, "B" port is the VGA image generator in the ULA
|
||||
ram16 ram0(
|
||||
.clock(CLOCK_50),
|
||||
|
||||
// .clock_a(clk_cpu),
|
||||
.address_a(A[13:0]),
|
||||
.data_a(D),
|
||||
.q_a(ram0_data),
|
||||
.wren_a(RamWE),
|
||||
// .wren_a(0),
|
||||
|
||||
// .clock_b(clk_vram),
|
||||
.address_b({1'b0, vram_address}),
|
||||
.data_b(8'b0),
|
||||
.q_b(vram_data),
|
||||
@@ -157,7 +161,7 @@ ram16 ram0(
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
wire[7:0] ram1_data;
|
||||
ram32 ram1(
|
||||
.clock(clk_cpu),
|
||||
.clock(clk_vram),
|
||||
|
||||
.address(A[14:0]),
|
||||
.data(D),
|
||||
@@ -170,6 +174,7 @@ ram32 ram1(
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
wire clk_cpu; // Global CPU clock of 3.5 MHz
|
||||
assign LED[2:2] = SW[2:2]; // Glow red when in turbo mode (7.0 MHz)
|
||||
assign LED[3:3] = raw_loader_in; // feedback from audio in
|
||||
wire [12:0] vram_address; // ULA video block requests a byte from the video RAM
|
||||
wire [7:0] vram_data; // ULA video block reads a byte from the video RAM
|
||||
wire vs_nintr; // Generates a vertical retrace interrupt
|
||||
@@ -213,6 +218,7 @@ ula ula_(
|
||||
.AUD_ADCDAT (AUD_ADCDAT),
|
||||
.beeper (beeper),
|
||||
.beep(buzzer_out),
|
||||
.raw_loader_in(raw_loader_in),
|
||||
|
||||
//-------- VGA connector --------------------
|
||||
.VGA_R (VGA_R),
|
||||
|
||||
Reference in New Issue
Block a user