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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [mc/] [boards/] [xsa-xst-3/] [src/] [bio/] [bio.v] - Blame information for rev 191

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 190 hellwig
//
2
// bio.v -- board specific I/O
3
//
4
 
5
 
6
module bio(clk, reset,
7
           en, wr, addr,
8
           data_in, data_out,
9 191 hellwig
           wt,
10
           sw1_3_n, sw1_4_n,
11
           sw2_n, sw3_n);
12 190 hellwig
    // internal interface
13
    input clk;
14
    input reset;
15
    input en;
16
    input wr;
17
    input addr;
18
    input [31:0] data_in;
19
    output [31:0] data_out;
20
    output wt;
21
    // external interface
22 191 hellwig
    input sw1_3_n;
23
    input sw1_4_n;
24
    input sw2_n;
25
    input sw3_n;
26 190 hellwig
 
27
  reg [31:0] bio_out;
28
  wire [31:0] bio_in;
29
 
30 191 hellwig
  reg sw1_3_p_n;
31
  reg sw1_3_s_n;
32
  reg sw1_4_p_n;
33
  reg sw1_4_s_n;
34
  reg sw2_p_n;
35
  reg sw2_s_n;
36
  reg sw3_p_n;
37
  reg sw3_s_n;
38
 
39 190 hellwig
  always @(posedge clk) begin
40
    if (reset) begin
41
      bio_out[31:0] <= 32'h0;
42
    end else begin
43
      if (en & wr & ~addr) begin
44
        bio_out[31:0] <= data_in[31:0];
45
      end
46
    end
47
  end
48
 
49
  assign data_out[31:0] =
50
    (addr == 0) ? bio_out[31:0] : bio_in[31:0];
51
  assign wt = 0;
52
 
53 191 hellwig
  always @(posedge clk) begin
54
    sw1_3_p_n <= sw1_3_n;
55
    sw1_3_s_n <= sw1_3_p_n;
56
    sw1_4_p_n <= sw1_4_n;
57
    sw1_4_s_n <= sw1_4_p_n;
58
    sw2_p_n <= sw2_n;
59
    sw2_s_n <= sw2_p_n;
60
    sw3_p_n <= sw3_n;
61
    sw3_s_n <= sw3_p_n;
62
  end
63 190 hellwig
 
64 191 hellwig
  assign bio_in[31:0] =
65
    { 28'h0, ~sw1_3_s_n, ~sw1_4_s_n, ~sw2_s_n, ~sw3_s_n };
66
 
67 190 hellwig
endmodule

powered by: WebSVN 2.1.0

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