-
Notifications
You must be signed in to change notification settings - Fork 30
HyperRAM clocking scheme, HBMC bring up and W956 simulation model #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e7e1b5e
Patch to add support for multiple disparate clock signals
alees24 0559aa4
The modified simulator test bench files from the preceding patch.
alees24 4bbced1
Modelling of different clock signals within the Sonata system.
alees24 ab5f033
HyperRAM in simulation
alees24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright lowRISC contributors. | ||
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // This is a crude model of the Xilinx IOBUF primitive; enough to make the | ||
| // OpenHBMC implementation simulate correctly. | ||
| module IOBUF #( | ||
| parameter DRIVE = 0, | ||
| parameter SLEW = "SLOW" | ||
| ) ( | ||
| output O, | ||
| inout IO, | ||
| input I, | ||
| input T | ||
| ); | ||
|
|
||
| assign O = IO; | ||
| assign IO = T ? 1'bZ : I; | ||
|
|
||
| endmodule | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| // Copyright lowRISC contributors. | ||
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // This is a crude model of the Xilinx ISERDESE2 primitive; enough to make the | ||
| // OpenHBMC implementation simulate correctly. | ||
| module ISERDESE2 #( | ||
| parameter SERDES_MODE = "MASTER", | ||
| parameter INTERFACE_TYPE = "NETWORKING", | ||
| parameter DATA_RATE = "DDR", | ||
| parameter DATA_WIDTH = 6, | ||
| parameter DYN_CLKDIV_INV_EN = "FALSE", | ||
| parameter DYN_CLK_INV_EN = "FALSE", | ||
| parameter OFB_USED = "NONE", | ||
| parameter IOBDELAY = 0, | ||
| parameter NUM_CE = 1, | ||
| parameter INIT_Q1 = 1'b0, | ||
| parameter INIT_Q2 = 1'b0, | ||
| parameter INIT_Q3 = 1'b0, | ||
| parameter INIT_Q4 = 1'b0, | ||
| parameter SRVAL_Q1 = 1'b0, | ||
| parameter SRVAL_Q2 = 1'b0, | ||
| parameter SRVAL_Q3 = 1'b0, | ||
| parameter SRVAL_Q4 = 1'b0 | ||
| ) ( | ||
| output O, | ||
|
|
||
| output Q1, | ||
| output Q2, | ||
| output Q3, | ||
| output Q4, | ||
| output Q5, | ||
| output Q6, | ||
| output Q7, | ||
| output Q8, | ||
|
|
||
| input BITSLIP, | ||
|
|
||
| input CE1, | ||
| input CE2, | ||
|
|
||
| input CLK, | ||
| input CLKB, | ||
|
|
||
| input CLKDIV, | ||
| input CLKDIVP, | ||
| input OCLK, | ||
| input OCLKB, | ||
|
|
||
| input D, | ||
| input DDLY, | ||
|
|
||
| input OFB, | ||
| input RST, | ||
|
|
||
| input DYNCLKDIVSEL, | ||
| input DYNCLKSEL, | ||
|
|
||
| output SHIFTOUT1, | ||
| output SHIFTOUT2, | ||
|
|
||
| input SHIFTIN1, | ||
| input SHIFTIN2 | ||
| ); | ||
|
|
||
| reg [8:1] iserdes_int; | ||
| always @(edge CLK or posedge RST) begin | ||
| if (RST) begin | ||
| iserdes_int <= {2{SRVAL_Q4, SRVAL_Q3, SRVAL_Q2, SRVAL_Q1}}; | ||
| end else begin | ||
| iserdes_int <= {iserdes_int[7:1], D}; | ||
| end | ||
| end | ||
|
|
||
| // In the ISERDESE2 module, Q8 is the oldest bit received. | ||
| assign {Q8,Q7,Q6,Q5,Q4,Q3,Q2,Q1} = iserdes_int; | ||
| assign O = D; | ||
|
|
||
| // These outputs are unused. | ||
| assign {SHIFTOUT2, SHIFTOUT1} = 2'b0; | ||
|
|
||
| endmodule | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Copyright lowRISC contributors. | ||
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // This is a crude model of the Xilinx OBUF primitive; enough to make the | ||
| // OpenHBMC implementation simulate correctly. | ||
| module OBUF #( | ||
| parameter DRIVE = 0, | ||
| parameter SLEW = "SLOW" | ||
| ) ( | ||
| input I, | ||
| output O | ||
| ); | ||
|
|
||
| assign O = I; | ||
|
|
||
| endmodule | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Copyright lowRISC contributors. | ||
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // This is a crude model of the Xilinx ODDR primitive; enough to make the | ||
| // OpenHBMC implementation simulate correctly. | ||
| module ODDR #( | ||
| parameter DDR_CLK_EDGE = "SAME_EDGE", | ||
| parameter INIT = 1'b0, | ||
| parameter SRTYPE = "ASYNC" | ||
| ) ( | ||
| output Q, // DDR output. | ||
| input C, // Clock input. | ||
| input CE, // Clock Enable. | ||
| input D1, // Two data inputs. | ||
| input D2, | ||
| input R, // ReSet inputs. | ||
| input S | ||
| ); | ||
|
|
||
| // Phase detection; PH is asserted during the second (negative edge) | ||
| // phase of the clock 'C.' | ||
| // ___ ___ | ||
| // C ___/ \___/ \___ | ||
| // PH 1 0 1 0 1 | ||
|
|
||
| reg PH, PC, NC; | ||
| always @(posedge C) PC <= !PC; | ||
| always @(negedge C) NC <= !NC; | ||
| assign PH = !(PC ^ NC); | ||
|
|
||
| reg S2; | ||
| if (DDR_CLK_EDGE == "SAME_EDGE") begin : gen_same_edge | ||
| // Both data inputs are presented together on posedge. | ||
| always @(posedge C) begin | ||
| if (CE) S2 <= D2; | ||
| end | ||
| end else begin : gen_opposite_edge | ||
| // Inputs are presented on opposite edges. | ||
| assign S2 = D2; | ||
| end | ||
|
|
||
| // Output is clocked on both edges of clock input 'C'. | ||
| reg OUT; | ||
| always @(edge C, posedge R, posedge S) begin | ||
| if (R || S) OUT <= S & ~R; | ||
| else if (CE) OUT <= PH ? D1 : S2; | ||
| end | ||
| assign Q = OUT; | ||
|
|
||
| endmodule | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.