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

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [hostSlaveMux/] [hostSlaveMuxBI.v] - Blame information for rev 9

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

Line No. Rev Author Line
1 2 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// hostSlaveMuxBI.v                                             ////
4
////                                                              ////
5
//// This file is part of the usbhostslave opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
//// 
10
////                                                              ////
11
//// To Do:                                                       ////
12
//// 
13
////                                                              ////
14
//// Author(s):                                                   ////
15
//// - Steve Fielding, sfielding@base2designs.com                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2004 Steve Fielding and OPENCORES.ORG          ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE. See the GNU Lesser General Public License for more  ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from <http://www.opencores.org/lgpl.shtml>                   ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44 9 sfielding
`timescale 1ns / 1ps
45 2 sfielding
 
46 9 sfielding
`include "usbHostSlave_h.v"
47
 
48
 module hostSlaveMuxBI (dataIn, dataOut, address, writeEn, strobe_i, clk, rst,
49 5 sfielding
  hostMode, hostSlaveMuxSel);
50 2 sfielding
 
51
input [7:0] dataIn;
52 9 sfielding
input address;
53 2 sfielding
input writeEn;
54
input strobe_i;
55
input clk;
56
input rst;
57
output [7:0] dataOut;
58
input hostSlaveMuxSel;
59
output hostMode;
60
 
61
wire [7:0] dataIn;
62 9 sfielding
wire address;
63 2 sfielding
wire writeEn;
64
wire strobe_i;
65
wire clk;
66
wire rst;
67
reg [7:0] dataOut;
68
wire hostSlaveMuxSel;
69
reg hostMode;
70
 
71
//internal wire and regs
72
 
73
//sync write demux
74
always @(posedge clk)
75
begin
76
  if (rst == 1'b1)
77
    hostMode <= 1'b0;
78
  else begin
79 9 sfielding
    if (writeEn == 1'b1 && hostSlaveMuxSel == 1'b1 && strobe_i == 1'b1 && address == `HOST_SLAVE_CONTROL_REG )
80 5 sfielding
      hostMode <= dataIn[0];
81 2 sfielding
  end
82
end
83
 
84
 
85
// async read mux
86 9 sfielding
always @(address or hostMode)
87 2 sfielding
begin
88 9 sfielding
  case (address)
89
    `HOST_SLAVE_CONTROL_REG: dataOut <= {7'h0, hostMode};
90
    `HOST_SLAVE_VERSION_REG: dataOut <= `USBHOSTSLAVE_VERSION_NUM;
91
  endcase
92 2 sfielding
end
93
 
94
endmodule

powered by: WebSVN 2.1.0

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