URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Show entire file |
Details |
Blame |
View Log
Rev 288 |
Rev 290 |
Line 1... |
Line 1... |
//
|
//
|
// bio.v -- board specific I/O
|
// bio.v -- board specific I/O
|
//
|
//
|
|
|
|
|
module bio(clk, reset,
|
`timescale 1ns/10ps
|
en, wr, addr,
|
`default_nettype none
|
|
|
|
|
|
module bio(clk, rst,
|
|
stb, we, addr,
|
data_in, data_out,
|
data_in, data_out,
|
wt, spi_en,
|
ack, spi_en,
|
sw, led,
|
sw, led,
|
lcd_e, lcd_rw, lcd_rs,
|
lcd_e, lcd_rw, lcd_rs,
|
spi_ss_b, fpga_init_b);
|
spi_ss_b, fpga_init_b);
|
// internal interface
|
// internal interface
|
input clk;
|
input clk;
|
input reset;
|
input rst;
|
input en;
|
input stb;
|
input wr;
|
input we;
|
input addr;
|
input addr;
|
input [31:0] data_in;
|
input [31:0] data_in;
|
output [31:0] data_out;
|
output [31:0] data_out;
|
output wt;
|
output ack;
|
output spi_en;
|
output spi_en;
|
// external interface
|
// external interface
|
input [3:0] sw;
|
input [3:0] sw;
|
output [7:0] led;
|
output [7:0] led;
|
output lcd_e;
|
output lcd_e;
|
Line 34... |
Line 38... |
|
|
reg [3:0] sw_p;
|
reg [3:0] sw_p;
|
reg [3:0] sw_s;
|
reg [3:0] sw_s;
|
|
|
always @(posedge clk) begin
|
always @(posedge clk) begin
|
if (reset) begin
|
if (rst) begin
|
bio_out[31:0] <= 32'h0;
|
bio_out[31:0] <= 32'h0;
|
end else begin
|
end else begin
|
if (en & wr & ~addr) begin
|
if (stb & we & ~addr) begin
|
bio_out[31:0] <= data_in[31:0];
|
bio_out[31:0] <= data_in[31:0];
|
end
|
end
|
end
|
end
|
end
|
end
|
|
|
assign data_out[31:0] =
|
assign data_out[31:0] =
|
(addr == 0) ? bio_out[31:0] : bio_in[31:0];
|
(addr == 0) ? bio_out[31:0] : bio_in[31:0];
|
assign wt = 0;
|
assign ack = stb;
|
assign spi_en = bio_out[31];
|
assign spi_en = bio_out[31];
|
|
|
always @(posedge clk) begin
|
always @(posedge clk) begin
|
sw_p[3:0] <= sw[3:0];
|
sw_p[3:0] <= sw[3:0];
|
sw_s[3:0] <= sw_p[3:0];
|
sw_s[3:0] <= sw_p[3:0];
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.