OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [mc/] [boards/] [xsa-xst-3/] [src/] [bio/] [bio.v] - Diff between revs 288 and 290

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,
           ack,
           sw1_1, sw1_2,
           sw1_1, sw1_2,
           sw1_3, sw1_4,
           sw1_3, sw1_4,
           sw2_n, sw3_n);
           sw2_n, sw3_n);
    // 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;
    // external interface
    // external interface
    input sw1_1;
    input sw1_1;
    input sw1_2;
    input sw1_2;
    input sw1_3;
    input sw1_3;
    input sw1_4;
    input sw1_4;
Line 42... Line 46...
  reg sw2_s_n;
  reg sw2_s_n;
  reg sw3_p_n;
  reg sw3_p_n;
  reg sw3_s_n;
  reg sw3_s_n;
 
 
  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;
 
 
  always @(posedge clk) begin
  always @(posedge clk) begin
    sw1_1_p <= sw1_1;
    sw1_1_p <= sw1_1;
    sw1_1_s <= sw1_1_p;
    sw1_1_s <= sw1_1_p;
    sw1_2_p <= sw1_2;
    sw1_2_p <= sw1_2;

powered by: WebSVN 2.1.0

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