| 1 |
1327 |
jcastillo |
/**********************************************************************************
|
| 2 |
|
|
* *
|
| 3 |
|
|
* This verilog file is a part of the Boundary Scan Implementation and comes in *
|
| 4 |
|
|
* a pack with several other files. It is fully IEEE 1149.1 compliant. *
|
| 5 |
|
|
* For details check www.opencores.org (pdf files, bsdl file, etc.) *
|
| 6 |
|
|
* *
|
| 7 |
|
|
* Copyright (C) 2000 Igor Mohor (igorm@opencores.org) and OPENCORES.ORG *
|
| 8 |
|
|
* *
|
| 9 |
|
|
* This program is free software; you can redistribute it and/or modify *
|
| 10 |
|
|
* it under the terms of the GNU General Public License as published by *
|
| 11 |
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
| 12 |
|
|
* (at your option) any later version. *
|
| 13 |
|
|
* *
|
| 14 |
|
|
* See the file COPYING for the full details of the license. *
|
| 15 |
|
|
* *
|
| 16 |
|
|
* OPENCORES.ORG is looking for new open source IP cores and developers that *
|
| 17 |
|
|
* would like to help in our mission. *
|
| 18 |
|
|
* *
|
| 19 |
|
|
**********************************************************************************/
|
| 20 |
|
|
|
| 21 |
|
|
|
| 22 |
|
|
|
| 23 |
|
|
/**********************************************************************************
|
| 24 |
|
|
* *
|
| 25 |
|
|
* Output Cell: *
|
| 26 |
|
|
* *
|
| 27 |
|
|
* FromCore: Value that comes from on-chip logic and goes to pin *
|
| 28 |
|
|
* FromPreviousBSCell: Value from previous boundary scan cell *
|
| 29 |
|
|
* ToNextBSCell: Value for next boundary scan cell *
|
| 30 |
|
|
* CaptureDR, ShiftDR, UpdateDR: TAP states *
|
| 31 |
|
|
* extest: Instruction Register Command *
|
| 32 |
|
|
* TCK: Test Clock *
|
| 33 |
|
|
* TristatedPin: Signal from core is connected to this output pin via BS *
|
| 34 |
|
|
* FromOutputEnable: This pin comes from core or ControlCell *
|
| 35 |
|
|
* *
|
| 36 |
|
|
* Signal that is connected to TristatedPin comes from core or BS chain. *
|
| 37 |
|
|
* Tristate control is generated in core or BS chain (ControlCell). *
|
| 38 |
|
|
* *
|
| 39 |
|
|
**********************************************************************************/
|
| 40 |
|
|
|
| 41 |
|
|
// This is not a top module
|
| 42 |
|
|
module OutputCell( FromCore, FromPreviousBSCell, CaptureDR, ShiftDR, UpdateDR, extest, TCK, ToNextBSCell, FromOutputEnable, TristatedPin);
|
| 43 |
|
|
input FromCore;
|
| 44 |
|
|
input FromPreviousBSCell;
|
| 45 |
|
|
input CaptureDR;
|
| 46 |
|
|
input ShiftDR;
|
| 47 |
|
|
input UpdateDR;
|
| 48 |
|
|
input extest;
|
| 49 |
|
|
input TCK;
|
| 50 |
|
|
input FromOutputEnable;
|
| 51 |
|
|
|
| 52 |
|
|
reg Latch;
|
| 53 |
|
|
|
| 54 |
|
|
output ToNextBSCell;
|
| 55 |
|
|
reg ToNextBSCell;
|
| 56 |
|
|
|
| 57 |
|
|
output TristatedPin;
|
| 58 |
|
|
|
| 59 |
|
|
reg ShiftedControl;
|
| 60 |
|
|
|
| 61 |
|
|
wire SelectedInput = CaptureDR? FromCore : FromPreviousBSCell;
|
| 62 |
|
|
|
| 63 |
|
|
always @ (posedge TCK)
|
| 64 |
|
|
begin
|
| 65 |
|
|
if(CaptureDR | ShiftDR)
|
| 66 |
|
|
Latch<=SelectedInput;
|
| 67 |
|
|
end
|
| 68 |
|
|
|
| 69 |
|
|
always @ (negedge TCK)
|
| 70 |
|
|
begin
|
| 71 |
|
|
ToNextBSCell<=Latch;
|
| 72 |
|
|
end
|
| 73 |
|
|
|
| 74 |
|
|
always @ (negedge TCK)
|
| 75 |
|
|
begin
|
| 76 |
|
|
if(UpdateDR)
|
| 77 |
|
|
ShiftedControl<=ToNextBSCell;
|
| 78 |
|
|
end
|
| 79 |
|
|
|
| 80 |
|
|
wire MuxedSignal = extest? ShiftedControl : FromCore;
|
| 81 |
|
|
assign TristatedPin = FromOutputEnable? MuxedSignal : 1'bz;
|
| 82 |
|
|
|
| 83 |
|
|
endmodule // OutputCell
|