OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 10 to Rev 9
    Reverse comparison

Rev 10 → Rev 9

/a-z80/trunk/host/zxspectrum_de1/ula/video.sv
1,5 → 1,5
//============================================================================
// Sinclair ZX Spectrum ULA
// Implementation of the Sinclair ZX Spectrum ULA
//
// This module contains video support.
//
/a-z80/trunk/host/zxspectrum_de1/ula/test_ula.sv
1,5 → 1,5
//============================================================================
// Test Sinclair ZX Spectrum ULA
// Test the implementation of the Sinclair ZX Spectrum ULA
//
// Copyright (C) 2014-2016 Goran Devic
//
/a-z80/trunk/host/zxspectrum_de1/ula/zx_kbd.sv
1,16 → 1,15
//============================================================================
// ZX Spectrum keyboard input
// Implementation of the ZX Spectrum keyboard input generator
// This module takes scan-codes from the PS/2 keyboard input and sets
// corresponding ZX key bitfields which are read by IN (FE) instructions.
//
// This module takes scan-codes from the attached PS/2 keyboard and sets
// corresponding ZX key bitfields which are read by the 'IN' instructions.
//
// PS/2 | ZX Spectrum
// ----------+-----------------
// CTRL | CAPS SHIFT
// ALT | SYMBOL SHIFT
//
// For convenience, in addition to regular alpha-numeric keys, this code
// simulates several other standard symbols on the PS/2 keyboard.
// In addition to regular alpha-numeric keys, this code simulates many standard
// symbols on the PS/2 keyboard for convenience.
//
// PS/2 | ZX Spectrum
// ----------+-----------------
17,7 → 16,7
// BACKSPACE | DELETE
// Arrows Left, Right, Up, Down
// ESC | BREAK (CAPS+SPACE)
// SHIFT => PS/2 shift for additional keys: -_ += ;: "' <, >. ?/
// SHIFT => PS/2 shift for these separate additional keys: -_ += ;: "' <, >. ?/
//
// Copyright (C) 2014-2016 Goran Devic
//
38,7 → 37,7
module zx_keyboard
(
input wire clk,
input wire nreset, // Active low reset
input wire reset, // Reset (negative logic)
 
// Output ZX-specific keyboard codes when requested by the ULA access
input wire [15:0] A, // Address bus
64,19 → 63,25
assign pressed = ~(&keys[7] & &keys[6] & &keys[5] & &keys[4] & &keys[3] & &keys[2] & &keys[1] & &keys[0]);
 
// Output requested row of keys continously
assign key_row =
(~A[8] ? keys[0] : 5'b11111) &
(~A[9] ? keys[1] : 5'b11111) &
(~A[10] ? keys[2] : 5'b11111) &
(~A[11] ? keys[3] : 5'b11111) &
(~A[12] ? keys[4] : 5'b11111) &
(~A[13] ? keys[5] : 5'b11111) &
(~A[14] ? keys[6] : 5'b11111) &
(~A[15] ? keys[7] : 5'b11111);
always @(*) // always_comb
begin
case (A[15:8])
8'b11111110: key_row = keys[0];
8'b11111101: key_row = keys[1];
8'b11111011: key_row = keys[2];
8'b11110111: key_row = keys[3];
8'b11101111: key_row = keys[4];
8'b11011111: key_row = keys[5];
8'b10111111: key_row = keys[6];
8'b01111111: key_row = keys[7];
default:
key_row = 5'b11111;
endcase
end
 
always @(posedge clk or negedge nreset)
always @(posedge clk or negedge reset)
begin
if (!nreset) begin
if (!reset) begin
released <= 0;
extended <= 0;
shifted <= 0;
/a-z80/trunk/host/zxspectrum_de1/ula/ula.sv
1,5 → 1,5
//============================================================================
// Sinclair ZX Spectrum ULA
// The implementation of the Sinclair ZX Spectrum ULA
//
// Copyright (C) 2014-2016 Goran Devic
//
24,7 → 24,7
input wire CLOCK_24, // Input clock 24 MHz
input wire turbo, // Turbo speed (3.5 MHz x 2 = 7.0 MHz)
output wire clk_vram,
input wire nreset, // Active low reset
input wire reset, // KEY0 is reset
output wire locked, // PLL is locked signal
 
//-------- CPU control ----------------------
104,7 → 104,7
wire audio_done;
wire audio_error;
 
i2c_loader i2c_loader_( .CLK(CLOCK_24), .nRESET(nreset), .I2C_SCL(I2C_SCLK), .I2C_SDA(I2C_SDAT), .IS_DONE(audio_done), .IS_ERROR(audio_error) );
i2c_loader i2c_loader_( .CLK(CLOCK_24), .nRESET(reset), .I2C_SCL(I2C_SCLK), .I2C_SDA(I2C_SDAT), .IS_DONE(audio_done), .IS_ERROR(audio_error) );
 
assign AUD_DACLRCK = AUD_ADCLRCK;
wire [15:0] pcm_inl;
112,11 → 112,11
reg [15:0] pcm_outl;
reg [15:0] pcm_outr;
 
i2s_intf i2s_intf_( .CLK(CLOCK_24), .nRESET(nreset),
i2s_intf i2s_intf_( .CLK(CLOCK_24), .nRESET(reset),
.PCM_INL(pcm_inl[15:0]), .PCM_INR(pcm_inr[15:0]), .PCM_OUTL(pcm_outl[15:0]), .PCM_OUTR(pcm_outr[15:0]),
.I2S_MCLK(AUD_XCK), .I2S_LRCLK(AUD_ADCLRCK), .I2S_BCLK(AUD_BCLK), .I2S_DOUT(AUD_DACDAT), .I2S_DIN(AUD_ADCDAT) );
 
// Show the beeper visually by dividing the frequency with some factor to generate LED blinks
// Show the beeper visually by dividing the frequency with some factor to generate blinks
reg beep; // Beeper latch
reg [6:0] beepcnt; // Beeper counter
always @(posedge beep)
142,7 → 142,7
wire [4:0] key_row;
zx_keyboard zx_keyboard_( .*, .clk(clk_cpu) );
 
always_comb
always @(*) // always_comb
begin
ula_data = 8'hFF;
// Regular IO at every odd address: line-in and keyboard
/a-z80/trunk/host/zxspectrum_de1/ula/ps2_kbd.sv
1,5 → 1,5
//============================================================================
// PS/2 keyboard scan-code reader
// Implementation of the PS/2 keyboard scan-code reader
//
// Copyright (C) 2014-2016 Goran Devic
//
20,7 → 20,7
module ps2_keyboard
(
input wire clk,
input wire nreset, // Active low reset
input wire reset, // Reset (negative logic)
input wire PS2_CLK, // PS/2 keyboard clock line
input wire PS2_DAT, // PS/2 keyboard data line
 
47,9 → 47,9
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Filter the PS/2 clock signal since it might have a noise (false '1')
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
always @(posedge clk or negedge nreset)
always @(posedge clk or negedge reset)
begin
if (!nreset) begin
if (!reset) begin
ps2_clk_in <= 1;
clk_filter <= 8'b1;
clk_edge <= 0;
73,9 → 73,9
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// State machine to process bits of PS/2 data
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
always @(posedge clk or negedge nreset)
always @(posedge clk or negedge reset)
begin
if (!nreset) begin
if (!reset) begin
bit_count <= '0;
shiftreg <= '0;
scan_code_ready <= 0;
/a-z80/trunk/host/zxspectrum_de1/zxspectrum_de1.sv
22,7 → 22,7
//-------- Clocks and reset -----------------
input wire CLOCK_27, // Input clock 27 MHz
input wire CLOCK_24, // Input clock 24 MHz
input wire KEY0, // RESET button; on DE1, keys are active low!
input wire KEY0, // RESET button
input wire KEY1, // NMI button
 
//-------- PS/2 Keyboard --------------------
202,7 → 202,7
.CLOCK_24 (CLOCK_24), // Input clock 24 MHz
.turbo (SW2), // Turbo speed (3.5 MHz x 2 = 7.0 MHz)
.clk_vram (clk_vram),
.nreset (reset), // KEY0 is reset; on DE1, keys are active low!
.reset (reset), // KEY0 is reset
.locked (locked), // PLL is locked signal
 
//-------- CPU control ----------------------

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.