CDL Modules
riscv_modules.h
Go to the documentation of this file.
1 
19 /*a Includes */
20 include "apb.h"
21 include "riscv.h"
22 include "riscv_internal_types.h"
23 include "srams.h"
24 
25 /*a Implementations */
26 /*m riscv_i32_minimal
27 
28  riscv_config should be HARDWIRED (not off registers) to force logic to be
29  discarded at synthesis
30 
31  alternatively submodules may be built with appropriate force's set to
32  force discard of logic.
33 
34  */
35 extern
36 module riscv_i32_minimal( clock clk,
37  input bit reset_n,
38  input bit proc_reset_n,
39  input t_riscv_irqs irqs "Interrupts in to the CPU",
40  output t_riscv_mem_access_req data_access_req,
41  input t_riscv_mem_access_resp data_access_resp,
42  input t_sram_access_req sram_access_req,
43  output t_sram_access_resp sram_access_resp,
44  input t_riscv_config riscv_config,
45  output t_riscv_i32_trace trace
46 )
47 {
48  timing from rising clock clk data_access_req;
49  timing to rising clock clk data_access_resp;
50  timing to rising clock clk sram_access_req;
51  timing from rising clock clk sram_access_resp;
52  timing to rising clock clk riscv_config;
53  timing to rising clock clk irqs;
54  timing from rising clock clk trace;
55  timing comb input riscv_config;
56  timing comb input data_access_resp;
57  timing comb output trace;
58 }
59 
60 /*m riscv_i32c_pipeline
61  */
62 extern
63 module riscv_i32c_pipeline( clock clk,
64  input bit reset_n,
65  input t_riscv_irqs irqs "Interrupts in to the CPU",
66  output t_riscv_fetch_req ifetch_req,
67  input t_riscv_fetch_resp ifetch_resp,
68  output t_riscv_mem_access_req dmem_access_req,
69  input t_riscv_mem_access_resp dmem_access_resp,
70  output t_riscv_i32_coproc_controls coproc_controls,
71  input t_riscv_i32_coproc_response coproc_response,
72  input t_riscv_config riscv_config,
73  output t_riscv_i32_trace trace
74 )
75 {
76  timing from rising clock clk dmem_access_req, ifetch_req, coproc_controls;
77  timing to rising clock clk dmem_access_resp, ifetch_resp, coproc_response;
78  timing to rising clock clk irqs;
79  timing to rising clock clk riscv_config;
80  timing from rising clock clk trace;
81  timing comb input riscv_config, coproc_response;
82  timing comb output dmem_access_req, ifetch_req, coproc_controls;
83  timing comb input dmem_access_resp;
84  timing comb output trace;
85 }
86 
87 /*m riscv_i32c_pipeline3
88  */
89 extern
90 module riscv_i32c_pipeline3( clock clk,
91  input bit reset_n,
92  input t_riscv_irqs irqs "Interrupts in to the CPU",
93  output t_riscv_fetch_req ifetch_req,
94  input t_riscv_fetch_resp ifetch_resp,
95  output t_riscv_mem_access_req dmem_access_req,
96  input t_riscv_mem_access_resp dmem_access_resp,
97  output t_riscv_i32_coproc_controls coproc_controls,
98  input t_riscv_i32_coproc_response coproc_response,
99  input t_riscv_config riscv_config,
100  output t_riscv_i32_trace trace
101 )
102 {
103  timing from rising clock clk dmem_access_req, ifetch_req, coproc_controls;
104  timing to rising clock clk dmem_access_resp, ifetch_resp, coproc_response;
105  timing to rising clock clk irqs;
106  timing to rising clock clk riscv_config;
107  timing comb input riscv_config, coproc_response;
108  timing comb output ifetch_req, coproc_controls;
109  timing from rising clock clk trace;
110 }
111 
112 /*a Interfaces */
113 /*m riscv_i32_minimal_apb */
114 extern
115 module riscv_i32_minimal_apb( clock clk,
116  input bit reset_n,
117  input t_riscv_mem_access_req data_access_req,
118  output t_riscv_mem_access_resp data_access_resp,
119  output t_apb_request apb_request,
120  input t_apb_response apb_response
121 )
122 {
123  timing comb input apb_response, data_access_req;
124  timing comb output data_access_resp;
125  timing to rising clock clk data_access_req, apb_response;
126  timing from rising clock clk data_access_resp, apb_request;
127 }
128 
129 /*a Trace, debug */
130 /*m riscv_jtag_apb_dm */
131 extern module riscv_jtag_apb_dm( clock jtag_tck "JTAG TCK signal, used as a clock",
132  input bit reset_n "Reset that drives all the logic",
133 
134  input bit[5] ir "JTAG IR which is to be matched against t_jtag_addr",
135  input t_jtag_action dr_action "Action to perform with DR (capture or update, else ignore)",
136  input bit[50]dr_in "Data register in; used in update, replaced by dr_out in capture, shift",
137  output bit[50]dr_tdi_mask "One-hot mask indicating which DR bit TDI should replace (depends on IR)",
138  output bit[50]dr_out "Data register out; same as data register in, except during capture when it is replaced by correct data dependent on IR, or shift when it goes right by one",
139 
140  clock apb_clock "APB clock signal, asynchronous to JTAG TCK",
141  output t_apb_request apb_request "APB request out",
142  input t_apb_response apb_response "APB response"
143  )
144 {
145  timing to rising clock jtag_tck ir, dr_action, dr_in;
146  timing from rising clock jtag_tck dr_tdi_mask, dr_out;
147  timing from rising clock apb_clock apb_request;
148  timing to rising clock apb_clock apb_response;
149  timing comb input dr_in, dr_action, ir;
150  timing comb output dr_out, dr_tdi_mask;
151 }
152 
153 /*m riscv_i32_debug */
154 extern module riscv_i32_debug( clock clk "System clock",
155  input bit reset_n "Active low reset",
156 
157  input t_apb_request apb_request "APB request",
158  output t_apb_response apb_response "APB response",
159 
160  output t_riscv_debug_mst debug_mst "Debug master to PDMs",
161  input t_riscv_debug_tgt debug_tgt "Debug target from PDMs"
162  )
163 {
164  timing to rising clock clk apb_request, debug_tgt;
165  timing from rising clock clk apb_response, debug_mst;
166 }
167 
168 /*m riscv_i32_pipeline_debug */
169 extern module riscv_i32_pipeline_debug( clock clk,
170  input bit reset_n,
171  input t_riscv_debug_mst debug_mst,
172  output t_riscv_debug_tgt debug_tgt,
173  output t_riscv_pipeline_debug_control debug_control,
174  input t_riscv_pipeline_debug_response debug_response,
175 
176  input bit[6] rv_select
177 )
178 {
179  timing to rising clock clk debug_mst, debug_response, rv_select;
180  timing from rising clock clk debug_control, debug_tgt;
181  timing comb input rv_select;
182  timing comb output debug_tgt;
183 }
184 
185 /*m riscv_i32_ifetch_debug */
186 extern module riscv_i32_ifetch_debug( input t_riscv_fetch_req pipeline_ifetch_req,
187  output t_riscv_fetch_resp pipeline_ifetch_resp,
188  input t_riscv_i32_trace pipeline_trace,
189  input t_riscv_pipeline_debug_control debug_control,
190  output t_riscv_pipeline_debug_response debug_response,
191  output t_riscv_fetch_req ifetch_req,
192  input t_riscv_fetch_resp ifetch_resp
193 )
194 {
195  timing comb input pipeline_ifetch_req, pipeline_trace, debug_control, ifetch_resp;
196  timing comb output pipeline_ifetch_resp, debug_response, ifetch_req;
197 }
198 
199 /*m riscv_i32_trace */
200 extern
201 module riscv_i32_trace( clock clk "Clock for the CPU",
202  input bit reset_n "Active low reset",
203  input t_riscv_i32_trace trace "Trace signals"
204 )
205 {
206  timing to rising clock clk trace;
207 }
208 
Definition: riscv.h:98
Definition: riscv.h:185
Definition: riscv_internal_types.h:622
Definition: riscv.h:149
Definition: riscv.h:66
module riscv_jtag_apb_dm(clock jtag_tck, input bit reset_n, input bit[5] ir, input t_jtag_action dr_action, input bit[50]dr_in, output bit[50]dr_tdi_mask, output bit[50]dr_out, clock apb_clock, output t_apb_request apb_request, input t_apb_response apb_response)
Definition: riscv_modules.h:131
module riscv_i32_minimal_apb(clock clk, input bit reset_n, input t_riscv_mem_access_req data_access_req, output t_riscv_mem_access_resp data_access_resp, output t_apb_request apb_request, input t_apb_response apb_response)
Definition: riscv_modules.h:115
module riscv_i32c_pipeline3(clock clk, input bit reset_n, input t_riscv_irqs irqs, output t_riscv_fetch_req ifetch_req, input t_riscv_fetch_resp ifetch_resp, output t_riscv_mem_access_req dmem_access_req, input t_riscv_mem_access_resp dmem_access_resp, output t_riscv_i32_coproc_controls coproc_controls, input t_riscv_i32_coproc_response coproc_response, input t_riscv_config riscv_config, output t_riscv_i32_trace trace)
Definition: riscv_modules.h:90
Definition: riscv.h:110
Definition: riscv_internal_types.h:609
module riscv_i32c_pipeline(clock clk, input bit reset_n, input t_riscv_irqs irqs, output t_riscv_fetch_req ifetch_req, input t_riscv_fetch_resp ifetch_resp, output t_riscv_mem_access_req dmem_access_req, input t_riscv_mem_access_resp dmem_access_resp, output t_riscv_i32_coproc_controls coproc_controls, input t_riscv_i32_coproc_response coproc_response, input t_riscv_config riscv_config, output t_riscv_i32_trace trace)
Definition: riscv_modules.h:63
Definition: apb.h:26
module riscv_i32_pipeline_debug(clock clk, input bit reset_n, input t_riscv_debug_mst debug_mst, output t_riscv_debug_tgt debug_tgt, output t_riscv_pipeline_debug_control debug_control, input t_riscv_pipeline_debug_response debug_response, input bit[6] rv_select)
Definition: riscv_modules.h:169
module riscv_i32_minimal(clock clk, input bit reset_n, input bit proc_reset_n, input t_riscv_irqs irqs, output t_riscv_mem_access_req data_access_req, input t_riscv_mem_access_resp data_access_resp, input t_sram_access_req sram_access_req, output t_sram_access_resp sram_access_resp, input t_riscv_config riscv_config, output t_riscv_i32_trace trace)
Definition: riscv_modules.h:36
Definition: riscv.h:160
module riscv_i32_trace(clock clk, input bit reset_n, input t_riscv_i32_trace trace)
Definition: riscv_modules.h:201
Definition: riscv.h:34
Definition: apb.h:35
Definition: riscv.h:175
Definition: riscv_internal_types.h:631
Definition: riscv.h:77
module riscv_i32_ifetch_debug(input t_riscv_fetch_req pipeline_ifetch_req, output t_riscv_fetch_resp pipeline_ifetch_resp, input t_riscv_i32_trace pipeline_trace, input t_riscv_pipeline_debug_control debug_control, output t_riscv_pipeline_debug_response debug_response, output t_riscv_fetch_req ifetch_req, input t_riscv_fetch_resp ifetch_resp)
Definition: riscv_modules.h:186
Definition: srams.h:34
Definition: riscv.h:121
t_jtag_action
Definition: jtag.h:9
module riscv_i32_debug(clock clk, input bit reset_n, input t_apb_request apb_request, output t_apb_response apb_response, output t_riscv_debug_mst debug_mst, input t_riscv_debug_tgt debug_tgt)
Definition: riscv_modules.h:154
Definition: srams.h:23