convert sdram to get/put
[shakti-peripherals.git] / src / peripherals / sdram / bsvmksdram_model_wrapper.bsv
1 /*
2 Copyright (c) 2013, IIT Madras
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 * Neither the name of IIT Madras nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
11 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
13 */
14 // Bluespec wrapper, created by Import BVI Wizard
15 // Created on: Mon Nov 06 17:30:03 IST 2017
16 // Created by: vishvesh
17 // Bluespec version: 2017.03.beta1 2017-03-16 35049
18
19
20 interface Ifc_sdram_model;
21 interface Inout#(Bit#(32)) dq;
22 (*always_ready*)
23 method Action iAddr (Bit#(11) addr);
24 (*always_ready*)
25 method Action iBa (Bit#(2) ba);
26 (*always_ready*)
27 method Action iCke (bit cke);
28 (*always_ready*)
29 method Action iCs_n (bit cs_n);
30 (*always_ready*)
31 method Action iRas_n (bit ras_n);
32 (*always_ready*)
33 method Action iCas_n (bit cas_n);
34 (*always_ready*)
35 method Action iWe_n (bit we_n);
36 (*always_ready*)
37 method Action iDqm (Bit#(4) dqm);
38 endinterface
39
40 import "BVI" mt48lc2m32b2 =
41 module mksdram_model_wrapper #(String file) (Ifc_sdram_model);
42
43 parameter FILENAME = file;
44 parameter addr_bits = 11;
45 parameter data_bits = 32;
46 parameter col_bits = 8;
47 parameter mem_sizes = 524287;
48 parameter tAC = 5.5;
49 parameter tHZ = 5.5;
50 parameter tOH = 2.5;
51 parameter tMRD = 2.0;
52 parameter tRAS = 42.0;
53 parameter tRC = 60.0;
54 parameter tRCD = 18.0;
55 parameter tRFC = 60.0;
56 parameter tRP = 18.0;
57 parameter tRRD = 12.0;
58 parameter tWRa = 6.0;
59 parameter tWRm = 12.0;
60
61 default_clock clk_old_Clk;
62 default_reset rst;
63
64 input_clock clk_old_Clk (old_Clk) <- exposeCurrentClock;
65 input_reset rst (/* empty */) clocked_by(clk_old_Clk) <- exposeCurrentReset;
66
67 ifc_inout dq(Dq) clocked_by (clk_old_Clk) reset_by (rst);
68
69 method iAddr (Addr /*addr_bits-1:0*/)
70 enable((*inhigh*)iAddr_enable) clocked_by(clk_old_Clk) reset_by(rst);
71 method iBa (Ba /*1:0*/)
72 enable((*inhigh*)iBa_enable) clocked_by(clk_old_Clk) reset_by(rst);
73 method iCke (Cke )
74 enable((*inhigh*)iCke_enable) clocked_by(clk_old_Clk) reset_by(rst);
75 method iCs_n (Cs_n )
76 enable((*inhigh*)iCs_n_enable) clocked_by(clk_old_Clk) reset_by(rst);
77 method iRas_n (Ras_n )
78 enable((*inhigh*)iRas_n_enable) clocked_by(clk_old_Clk) reset_by(rst);
79 method iCas_n (Cas_n)
80 enable((*inhigh*)iCas_n_enable) clocked_by(clk_old_Clk) reset_by(rst);
81 method iWe_n (We_n )
82 enable((*inhigh*)iWe_n_enable) clocked_by(clk_old_Clk) reset_by(rst);
83 method iDqm (Dqm /*3:0*/)
84 enable((*inhigh*)iDqm_enable) clocked_by(clk_old_Clk) reset_by(rst);
85
86 schedule iAddr C iAddr;
87 schedule iAddr CF iBa;
88 schedule iAddr CF iCke;
89 schedule iAddr CF iCs_n;
90 schedule iAddr CF iRas_n;
91 schedule iAddr CF iCas_n;
92 schedule iAddr CF iWe_n;
93 schedule iAddr CF iDqm;
94 schedule iBa C iBa;
95 schedule iBa CF iCke;
96 schedule iBa CF iCs_n;
97 schedule iBa CF iRas_n;
98 schedule iBa CF iCas_n;
99 schedule iBa CF iWe_n;
100 schedule iBa CF iDqm;
101 schedule iCke C iCke;
102 schedule iCke CF iCs_n;
103 schedule iCke CF iRas_n;
104 schedule iCke CF iCas_n;
105 schedule iCke CF iWe_n;
106 schedule iCke CF iDqm;
107 schedule iCs_n C iCs_n;
108 schedule iCs_n CF iRas_n;
109 schedule iCs_n CF iCas_n;
110 schedule iCs_n CF iWe_n;
111 schedule iCs_n CF iDqm;
112 schedule iRas_n C iRas_n;
113 schedule iRas_n CF iCas_n;
114 schedule iRas_n CF iWe_n;
115 schedule iRas_n CF iDqm;
116 schedule iCas_n C iCas_n;
117 schedule iCas_n CF iWe_n;
118 schedule iCas_n CF iDqm;
119 schedule iWe_n C iWe_n;
120 schedule iWe_n CF iDqm;
121 schedule iDqm C iDqm;
122 endmodule
123
124