soc_maker 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/History.txt +4 -0
- data/LICENSE +678 -0
- data/README.rdoc +228 -0
- data/Rakefile +46 -0
- data/bin/soc_maker_cli +80 -0
- data/bin/soc_maker_parser +85 -0
- data/core_lib/cores/adv_debug_sys/01_adv_debug_sys.yaml +245 -0
- data/core_lib/cores/or1200_rel2/01_or1200.yaml +208 -0
- data/core_lib/cores/or1200_rel2/02_or1200_files.yaml +421 -0
- data/core_lib/cores/or1200_rel2/03_or1200_sparam.yaml +188 -0
- data/core_lib/cores/or1200_rel2/or1200_defines.v.in +1799 -0
- data/core_lib/cores/ram_wb/ram_wb.yaml +102 -0
- data/core_lib/cores/ram_wb/ram_wb_b3.v.in +259 -0
- data/core_lib/cores/uart16550/01_uart16550.yaml +99 -0
- data/core_lib/cores/uart16550/02_uart16550_files.yaml +70 -0
- data/core_lib/cores/wb_connect/minsoc_tc_top.v +1802 -0
- data/core_lib/cores/wb_connect/wb_connect.yaml +733 -0
- data/core_lib/inc.yaml +13 -0
- data/core_lib/interfaces/clk_rst/clk.yaml +9 -0
- data/core_lib/interfaces/clk_rst/rst.yaml +9 -0
- data/core_lib/interfaces/clk_rst/single.yaml +7 -0
- data/core_lib/interfaces/debug/debug.yaml +32 -0
- data/core_lib/interfaces/jtag/jtag.yaml +13 -0
- data/core_lib/interfaces/jtag/jtag_tap.yaml +22 -0
- data/core_lib/interfaces/power/or_power.yaml +25 -0
- data/core_lib/interfaces/uart/uart.yaml +21 -0
- data/core_lib/interfaces/wishbone/wishbone_ma_b3.yaml +54 -0
- data/core_lib/interfaces/wishbone/wishbone_sl_b3.yaml +51 -0
- data/doc/class_arch.uml +5113 -0
- data/doc/fig/hierarchical.svg +273 -0
- data/examples/or1200_test/or1200_test.cmd +78 -0
- data/examples/or1200_test/or1200_test.rb +136 -0
- data/examples/or1200_test/rtl/or1200_test_top.vhd +274 -0
- data/examples/or1200_test/rtl/s3astarter.ucf +10 -0
- data/examples/or1200_test/rtl/xilinx_internal_jtag.v +438 -0
- data/examples/or1200_test/rtl/xilinx_internal_jtag_options.v +12 -0
- data/examples/or1200_test/sw/README.txt +35 -0
- data/examples/or1200_test/sw/bin2vmem.c +159 -0
- data/examples/or1200_test/sw/board.h +24 -0
- data/examples/or1200_test/sw/compile.sh +18 -0
- data/examples/or1200_test/sw/except.S +152 -0
- data/examples/or1200_test/sw/int.c +79 -0
- data/examples/or1200_test/sw/int.h +14 -0
- data/examples/or1200_test/sw/interconnect.h +17 -0
- data/examples/or1200_test/sw/interrupts.c +14 -0
- data/examples/or1200_test/sw/main.c +16 -0
- data/examples/or1200_test/sw/or1200.h +454 -0
- data/examples/or1200_test/sw/orp.ld +60 -0
- data/examples/or1200_test/sw/reset.S +112 -0
- data/examples/or1200_test/sw/support.c +123 -0
- data/examples/or1200_test/sw/support.h +33 -0
- data/examples/or1200_test/sw/tick.c +30 -0
- data/examples/or1200_test/sw/tick.h +2 -0
- data/examples/or1200_test/sw/uart.c +136 -0
- data/examples/or1200_test/sw/uart.h +126 -0
- data/lib/soc_maker.rb +324 -0
- data/lib/soc_maker/cli.rb +544 -0
- data/lib/soc_maker/conf.rb +310 -0
- data/lib/soc_maker/core_def.rb +579 -0
- data/lib/soc_maker/core_inst.rb +305 -0
- data/lib/soc_maker/err.rb +211 -0
- data/lib/soc_maker/hdl_coder.rb +500 -0
- data/lib/soc_maker/hdl_file.rb +166 -0
- data/lib/soc_maker/hdl_parser.rb +431 -0
- data/lib/soc_maker/ifc_def.rb +193 -0
- data/lib/soc_maker/ifc_port.rb +133 -0
- data/lib/soc_maker/ifc_spc.rb +180 -0
- data/lib/soc_maker/lib.rb +289 -0
- data/lib/soc_maker/lib_inc.rb +109 -0
- data/lib/soc_maker/parameter.rb +149 -0
- data/lib/soc_maker/soc_def.rb +847 -0
- data/lib/soc_maker/sparameter.rb +289 -0
- data/lib/soc_maker/version.rb +8 -0
- data/lib/soc_maker/ypp.rb +130 -0
- data/soc_maker.gemspec +28 -0
- data/spec/cli_cmds1.txt +39 -0
- data/spec/cli_spec.rb +49 -0
- data/spec/conf_spec.rb +44 -0
- data/spec/core_def_spec.rb +503 -0
- data/spec/core_inst_spec.rb +169 -0
- data/spec/hdl_file_spec.rb +154 -0
- data/spec/hdl_parser_spec.rb +201 -0
- data/spec/ifc_def_spec.rb +121 -0
- data/spec/ifc_port_spec.rb +92 -0
- data/spec/ifc_spc_spec.rb +196 -0
- data/spec/lib_inc_spec.rb +99 -0
- data/spec/lib_spec.rb +209 -0
- data/spec/parameter_spec.rb +86 -0
- data/spec/soc_def_spec.rb +611 -0
- data/spec/soc_maker_spec.rb +7 -0
- data/spec/sparameter_spec.rb +182 -0
- data/spec/spec_helper.rb +78 -0
- data/spec/test_soc.yaml +105 -0
- data/spec/test_soc2.yaml +60 -0
- data/spec/test_soc_lib/cores/core_A_rel1/00_core_a.yaml +75 -0
- data/spec/test_soc_lib/cores/core_A_rel1/01_core_a.yaml +57 -0
- data/spec/test_soc_lib/cores/core_A_rel1/core_a.vhd +29 -0
- data/spec/test_soc_lib/cores/core_A_rel1/core_a_pkg.vhd.src +3 -0
- data/spec/test_soc_lib/cores/core_A_rel1/core_a_pkg2.vhd.src +4 -0
- data/spec/test_soc_lib/cores/core_A_rel1/core_a_pkg3.v.src +6 -0
- data/spec/test_soc_lib/cores/core_B_rel1/core_b.vhd +25 -0
- data/spec/test_soc_lib/cores/core_B_rel1/core_b.yaml +36 -0
- data/spec/test_soc_lib/cores/core_C_v1/core_C.vhd +57 -0
- data/spec/test_soc_lib/cores/core_C_v1/core_c.yaml +42 -0
- data/spec/test_soc_lib/cores/soc_A/soc_A.yaml +12 -0
- data/spec/test_soc_lib/cores/soc_maker_include.yaml +6 -0
- data/spec/test_soc_lib/ifcs/core_AB_ifc/bidir_ifc.yaml +19 -0
- data/spec/test_soc_lib/ifcs/core_AB_ifc/core_AB_ifc.yaml +15 -0
- data/spec/test_soc_lib/ifcs/core_AB_ifc/top_ifc.yaml +9 -0
- data/spec/test_soc_lib/soc_maker_include.yaml +4 -0
- data/spec/yaml_examples.rb +367 -0
- data/spec/ypp_spec.rb +156 -0
- data/test/test_soc_maker.rb +0 -0
- metadata +255 -0
@@ -0,0 +1,102 @@
|
|
1
|
+
SOCM_CORE
|
2
|
+
name: Wishbone RAM
|
3
|
+
description: Onchip-RAM
|
4
|
+
id: ram_wb,b3
|
5
|
+
license: LGPL
|
6
|
+
licensefile:
|
7
|
+
author:
|
8
|
+
authormail:
|
9
|
+
vccmd:
|
10
|
+
toplevel: ram_wb_b3
|
11
|
+
vccmd: svn co http://opencores.org/ocsvn/openrisc/openrisc/trunk/orpsocv2/rtl/verilog/ram_wb@655 rtl
|
12
|
+
interfaces:
|
13
|
+
:wb_ifc: SOCM_IFC
|
14
|
+
name: Wishbone IFC
|
15
|
+
dir: 1
|
16
|
+
id: wishbone_sl,b3
|
17
|
+
ports:
|
18
|
+
:wb_adr_i: SOCM_PORT
|
19
|
+
len: 32
|
20
|
+
spc_ref: adr
|
21
|
+
:wb_bte_i: SOCM_PORT
|
22
|
+
len: 2
|
23
|
+
spc_ref: bte
|
24
|
+
:wb_cti_i: SOCM_PORT
|
25
|
+
len: 3
|
26
|
+
spc_ref: cti
|
27
|
+
:wb_cyc_i: SOCM_PORT
|
28
|
+
len: 1
|
29
|
+
spc_ref: cyc
|
30
|
+
:wb_dat_i: SOCM_PORT
|
31
|
+
len: 32
|
32
|
+
spc_ref: dat_o
|
33
|
+
:wb_sel_i: SOCM_PORT
|
34
|
+
len: 4
|
35
|
+
spc_ref: sel
|
36
|
+
:wb_stb_i: SOCM_PORT
|
37
|
+
len: 1
|
38
|
+
spc_ref: stb
|
39
|
+
:wb_we_i: SOCM_PORT
|
40
|
+
len: 1
|
41
|
+
spc_ref: we
|
42
|
+
:wb_ack_o: SOCM_PORT
|
43
|
+
len: 1
|
44
|
+
spc_ref: ack
|
45
|
+
:wb_err_o: SOCM_PORT
|
46
|
+
len: 1
|
47
|
+
spc_ref: err
|
48
|
+
:wb_rty_o: SOCM_PORT
|
49
|
+
len: 1
|
50
|
+
spc_ref: rty
|
51
|
+
:wb_dat_o: SOCM_PORT
|
52
|
+
len: 32
|
53
|
+
spc_ref: dat_i
|
54
|
+
:wb_clk_i: SOCM_PORT
|
55
|
+
len: 1
|
56
|
+
spc_ref: clk
|
57
|
+
:wb_rst_i: SOCM_PORT
|
58
|
+
len: 1
|
59
|
+
spc_ref: rst
|
60
|
+
|
61
|
+
inst_parameters:
|
62
|
+
:mem_size_bytes: SOCM_PARAM
|
63
|
+
type: integer
|
64
|
+
default: 20480
|
65
|
+
description: Memory size in bytes
|
66
|
+
:mem_adr_width: SOCM_PARAM
|
67
|
+
type: integer
|
68
|
+
default: 15
|
69
|
+
description: "Memory address with: ceil( log2( mem_size_bytes) )"
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
hdlfiles:
|
76
|
+
:ram_wb_b3: SOCM_HDL_FILE
|
77
|
+
use_syn: true
|
78
|
+
use_sim: true
|
79
|
+
type: verilog
|
80
|
+
path: rtl/ram_wb_b3.v
|
81
|
+
|
82
|
+
# static_parameters:
|
83
|
+
# :ram_wb_b3: SOCM_SPARAM
|
84
|
+
# dir: .
|
85
|
+
# path: ./ram_wb_b3.v.in
|
86
|
+
# file_dst: ram_wb_b3.v
|
87
|
+
# parameters:
|
88
|
+
#
|
89
|
+
# :MEM_SIZE: SOCM_SENTRY
|
90
|
+
# token: TOK_MEM_SIZE
|
91
|
+
# type: integer
|
92
|
+
# visible: true
|
93
|
+
# editable: true
|
94
|
+
# default: 20
|
95
|
+
#
|
96
|
+
# :MEM_ADR_WIDTH: SOCM_SENTRY
|
97
|
+
# token: TOK_MEM_ADR_WIDTH
|
98
|
+
# type: integer
|
99
|
+
# visible: true
|
100
|
+
# editable: true
|
101
|
+
# default: 15
|
102
|
+
|
@@ -0,0 +1,259 @@
|
|
1
|
+
//`include "synthesis-defines.v"
|
2
|
+
module ram_wb_b3(
|
3
|
+
wb_adr_i, wb_bte_i, wb_cti_i, wb_cyc_i, wb_dat_i, wb_sel_i,
|
4
|
+
wb_stb_i, wb_we_i,
|
5
|
+
|
6
|
+
wb_ack_o, wb_err_o, wb_rty_o, wb_dat_o,
|
7
|
+
|
8
|
+
wb_clk_i, wb_rst_i);
|
9
|
+
|
10
|
+
parameter dw = 32;
|
11
|
+
parameter aw = 32;
|
12
|
+
|
13
|
+
input [aw-1:0] wb_adr_i;
|
14
|
+
input [1:0] wb_bte_i;
|
15
|
+
input [2:0] wb_cti_i;
|
16
|
+
input wb_cyc_i;
|
17
|
+
input [dw-1:0] wb_dat_i;
|
18
|
+
input [3:0] wb_sel_i;
|
19
|
+
input wb_stb_i;
|
20
|
+
input wb_we_i;
|
21
|
+
|
22
|
+
output wb_ack_o;
|
23
|
+
output wb_err_o;
|
24
|
+
output wb_rty_o;
|
25
|
+
output [dw-1:0] wb_dat_o;
|
26
|
+
|
27
|
+
input wb_clk_i;
|
28
|
+
input wb_rst_i;
|
29
|
+
|
30
|
+
// Memory parameters
|
31
|
+
// parameter mem_size_bytes = 32'h0000_5000; // 20KBytes
|
32
|
+
// parameter mem_adr_width = 15; //(log2(mem_size_bytes));
|
33
|
+
parameter mem_size_kbytes = TOK_MEM_SIZE ; // 20KBytes
|
34
|
+
parameter mem_adr_width = TOK_MEM_ADR_WIDTH ; //(log2(mem_size_bytes));
|
35
|
+
|
36
|
+
parameter bytes_per_dw = (dw/8);
|
37
|
+
parameter adr_width_for_num_word_bytes = 2; //(log2(bytes_per_dw))
|
38
|
+
parameter mem_words = (mem_size_kbytes * 1024/bytes_per_dw);
|
39
|
+
|
40
|
+
// synthesis attribute ram_style of mem is block
|
41
|
+
reg [dw-1:0] mem [ 0 : mem_words-1 ] /* verilator public */ /* synthesis ram_style = no_rw_check */;
|
42
|
+
|
43
|
+
// Register to address internal memory array
|
44
|
+
reg [(mem_adr_width-adr_width_for_num_word_bytes)-1:0] adr;
|
45
|
+
|
46
|
+
wire [31:0] wr_data;
|
47
|
+
|
48
|
+
// Register to indicate if the cycle is a Wishbone B3-registered feedback
|
49
|
+
// type access
|
50
|
+
reg wb_b3_trans;
|
51
|
+
wire wb_b3_trans_start, wb_b3_trans_stop;
|
52
|
+
|
53
|
+
// Register to use for counting the addresses when doing burst accesses
|
54
|
+
reg [mem_adr_width-adr_width_for_num_word_bytes-1:0] burst_adr_counter;
|
55
|
+
reg [2:0] wb_cti_i_r;
|
56
|
+
reg [1:0] wb_bte_i_r;
|
57
|
+
wire using_burst_adr;
|
58
|
+
wire burst_access_wrong_wb_adr;
|
59
|
+
|
60
|
+
// Wire to indicate addressing error
|
61
|
+
wire addr_err;
|
62
|
+
|
63
|
+
|
64
|
+
// Logic to detect if there's a burst access going on
|
65
|
+
assign wb_b3_trans_start = ((wb_cti_i == 3'b001)|(wb_cti_i == 3'b010)) &
|
66
|
+
wb_stb_i & !wb_b3_trans;
|
67
|
+
|
68
|
+
assign wb_b3_trans_stop = ((wb_cti_i == 3'b111) &
|
69
|
+
wb_stb_i & wb_b3_trans & wb_ack_o) | wb_err_o;
|
70
|
+
|
71
|
+
always @(posedge wb_clk_i)
|
72
|
+
if (wb_rst_i)
|
73
|
+
wb_b3_trans <= 0;
|
74
|
+
else if (wb_b3_trans_start)
|
75
|
+
wb_b3_trans <= 1;
|
76
|
+
else if (wb_b3_trans_stop)
|
77
|
+
wb_b3_trans <= 0;
|
78
|
+
|
79
|
+
// Burst address generation logic
|
80
|
+
always @(/*AUTOSENSE*/wb_ack_o or wb_b3_trans or wb_b3_trans_start
|
81
|
+
or wb_bte_i_r or wb_cti_i_r or wb_adr_i or adr)
|
82
|
+
if (wb_b3_trans_start)
|
83
|
+
// Kick off burst_adr_counter, this assumes 4-byte words when getting
|
84
|
+
// address off incoming Wishbone bus address!
|
85
|
+
// So if dw is no longer 4 bytes, change this!
|
86
|
+
burst_adr_counter = wb_adr_i[mem_adr_width-1:2];
|
87
|
+
else if ((wb_cti_i_r == 3'b010) & wb_ack_o & wb_b3_trans)
|
88
|
+
// Incrementing burst
|
89
|
+
begin
|
90
|
+
if (wb_bte_i_r == 2'b00) // Linear burst
|
91
|
+
burst_adr_counter = adr + 1;
|
92
|
+
if (wb_bte_i_r == 2'b01) // 4-beat wrap burst
|
93
|
+
burst_adr_counter[1:0] = adr[1:0] + 1;
|
94
|
+
if (wb_bte_i_r == 2'b10) // 8-beat wrap burst
|
95
|
+
burst_adr_counter[2:0] = adr[2:0] + 1;
|
96
|
+
if (wb_bte_i_r == 2'b11) // 16-beat wrap burst
|
97
|
+
burst_adr_counter[3:0] = adr[3:0] + 1;
|
98
|
+
end // if ((wb_cti_i_r == 3'b010) & wb_ack_o_r)
|
99
|
+
|
100
|
+
always @(posedge wb_clk_i)
|
101
|
+
wb_bte_i_r <= wb_bte_i;
|
102
|
+
|
103
|
+
// Register it locally
|
104
|
+
always @(posedge wb_clk_i)
|
105
|
+
wb_cti_i_r <= wb_cti_i;
|
106
|
+
|
107
|
+
assign using_burst_adr = wb_b3_trans;
|
108
|
+
|
109
|
+
assign burst_access_wrong_wb_adr = (using_burst_adr &
|
110
|
+
(adr != wb_adr_i[mem_adr_width-1:2]));
|
111
|
+
|
112
|
+
// Address registering logic
|
113
|
+
always@(posedge wb_clk_i)
|
114
|
+
if(wb_rst_i)
|
115
|
+
adr <= 0;
|
116
|
+
else if (using_burst_adr)
|
117
|
+
adr <= burst_adr_counter;
|
118
|
+
else if (wb_cyc_i & wb_stb_i)
|
119
|
+
adr <= wb_adr_i[mem_adr_width-1:2];
|
120
|
+
|
121
|
+
/* Memory initialisation.
|
122
|
+
If not Verilator model, always do load, otherwise only load when called
|
123
|
+
from SystemC testbench.
|
124
|
+
*/
|
125
|
+
// synthesis translate_off
|
126
|
+
parameter memory_file = "sram.vmem";
|
127
|
+
|
128
|
+
`ifdef verilator
|
129
|
+
|
130
|
+
task do_readmemh;
|
131
|
+
// verilator public
|
132
|
+
$readmemh(memory_file, mem);
|
133
|
+
endtask // do_readmemh
|
134
|
+
|
135
|
+
`else
|
136
|
+
|
137
|
+
initial
|
138
|
+
begin
|
139
|
+
$readmemh(memory_file, mem);
|
140
|
+
end
|
141
|
+
|
142
|
+
`endif // !`ifdef verilator
|
143
|
+
|
144
|
+
//synthesis translate_on
|
145
|
+
|
146
|
+
assign wb_rty_o = 0;
|
147
|
+
|
148
|
+
// mux for data to ram, RMW on part sel != 4'hf
|
149
|
+
assign wr_data[31:24] = wb_sel_i[3] ? wb_dat_i[31:24] : wb_dat_o[31:24];
|
150
|
+
assign wr_data[23:16] = wb_sel_i[2] ? wb_dat_i[23:16] : wb_dat_o[23:16];
|
151
|
+
assign wr_data[15: 8] = wb_sel_i[1] ? wb_dat_i[15: 8] : wb_dat_o[15: 8];
|
152
|
+
assign wr_data[ 7: 0] = wb_sel_i[0] ? wb_dat_i[ 7: 0] : wb_dat_o[ 7: 0];
|
153
|
+
|
154
|
+
wire ram_we;
|
155
|
+
assign ram_we = wb_we_i & wb_ack_o;
|
156
|
+
|
157
|
+
assign wb_dat_o = mem[adr];
|
158
|
+
|
159
|
+
// Write logic
|
160
|
+
always @ (posedge wb_clk_i)
|
161
|
+
begin
|
162
|
+
if (ram_we)
|
163
|
+
mem[adr] <= wr_data;
|
164
|
+
end
|
165
|
+
|
166
|
+
// Ack Logic
|
167
|
+
reg wb_ack_o_r;
|
168
|
+
|
169
|
+
assign wb_ack_o = wb_ack_o_r & wb_stb_i &
|
170
|
+
!(burst_access_wrong_wb_adr | addr_err);
|
171
|
+
|
172
|
+
always @ (posedge wb_clk_i)
|
173
|
+
if (wb_rst_i)
|
174
|
+
wb_ack_o_r <= 1'b0;
|
175
|
+
else if (wb_cyc_i) // We have bus
|
176
|
+
begin
|
177
|
+
if (addr_err & wb_stb_i)
|
178
|
+
begin
|
179
|
+
wb_ack_o_r <= 1;
|
180
|
+
end
|
181
|
+
else if (wb_cti_i == 3'b000)
|
182
|
+
begin
|
183
|
+
// Classic cycle acks
|
184
|
+
if (wb_stb_i)
|
185
|
+
begin
|
186
|
+
if (!wb_ack_o_r)
|
187
|
+
wb_ack_o_r <= 1;
|
188
|
+
else
|
189
|
+
wb_ack_o_r <= 0;
|
190
|
+
end
|
191
|
+
end // if (wb_cti_i == 3'b000)
|
192
|
+
else if ((wb_cti_i == 3'b001) | (wb_cti_i == 3'b010))
|
193
|
+
begin
|
194
|
+
// Increment/constant address bursts
|
195
|
+
if (wb_stb_i)
|
196
|
+
wb_ack_o_r <= 1;
|
197
|
+
else
|
198
|
+
wb_ack_o_r <= 0;
|
199
|
+
end
|
200
|
+
else if (wb_cti_i == 3'b111)
|
201
|
+
begin
|
202
|
+
// End of cycle
|
203
|
+
if (!wb_ack_o_r)
|
204
|
+
wb_ack_o_r <= wb_stb_i;
|
205
|
+
else
|
206
|
+
wb_ack_o_r <= 0;
|
207
|
+
end
|
208
|
+
end // if (wb_cyc_i)
|
209
|
+
else
|
210
|
+
wb_ack_o_r <= 0;
|
211
|
+
|
212
|
+
|
213
|
+
//
|
214
|
+
// Error signal generation
|
215
|
+
//
|
216
|
+
|
217
|
+
// Error when out of bounds of memory - skip top nibble of address in case
|
218
|
+
// this is mapped somewhere other than 0x0.
|
219
|
+
assign addr_err = wb_cyc_i & wb_stb_i & (|wb_adr_i[aw-1-4:mem_adr_width]);
|
220
|
+
|
221
|
+
// OR in other errors here...
|
222
|
+
assign wb_err_o = wb_ack_o_r & wb_stb_i &
|
223
|
+
(burst_access_wrong_wb_adr | addr_err);
|
224
|
+
|
225
|
+
//
|
226
|
+
// Access functions
|
227
|
+
//
|
228
|
+
|
229
|
+
// Function to access RAM (for use by Verilator).
|
230
|
+
function [31:0] get_mem32;
|
231
|
+
// verilator public
|
232
|
+
input [aw-1:0] addr;
|
233
|
+
get_mem32 = mem[addr];
|
234
|
+
endfunction // get_mem32
|
235
|
+
|
236
|
+
// Function to access RAM (for use by Verilator).
|
237
|
+
function [7:0] get_mem8;
|
238
|
+
// verilator public
|
239
|
+
input [aw-1:0] addr;
|
240
|
+
reg [31:0] temp_word;
|
241
|
+
begin
|
242
|
+
temp_word = mem[{addr[aw-1:2],2'd0}];
|
243
|
+
// Big endian mapping.
|
244
|
+
get_mem8 = (addr[1:0]==2'b00) ? temp_word[31:24] :
|
245
|
+
(addr[1:0]==2'b01) ? temp_word[23:16] :
|
246
|
+
(addr[1:0]==2'b10) ? temp_word[15:8] : temp_word[7:0];
|
247
|
+
end
|
248
|
+
endfunction // get_mem8
|
249
|
+
|
250
|
+
// Function to write RAM (for use by Verilator).
|
251
|
+
function set_mem32;
|
252
|
+
// verilator public
|
253
|
+
input [aw-1:0] addr;
|
254
|
+
input [dw-1:0] data;
|
255
|
+
mem[addr] = data;
|
256
|
+
endfunction // set_mem32
|
257
|
+
|
258
|
+
endmodule // ram_wb_b3
|
259
|
+
|
@@ -0,0 +1,99 @@
|
|
1
|
+
SOCM_CORE
|
2
|
+
name: Uart 16550
|
3
|
+
description: "UART 16550 Core"
|
4
|
+
id: uart16550,rel4
|
5
|
+
license: LGPL
|
6
|
+
licensefile:
|
7
|
+
author:
|
8
|
+
authormail:
|
9
|
+
vccmd: svn co http://opencores.org/ocsvn/uart16550/uart16550/tags/rel_4/rtl rtl
|
10
|
+
toplevel: uart_top
|
11
|
+
|
12
|
+
|
13
|
+
interfaces:
|
14
|
+
:wb_ifc: SOCM_IFC
|
15
|
+
name: wishbone_sl
|
16
|
+
dir: 1
|
17
|
+
id: wishbone_sl,b3
|
18
|
+
ports:
|
19
|
+
:wb_clk_i: SOCM_PORT
|
20
|
+
len: 1
|
21
|
+
spc_ref: clk
|
22
|
+
:wb_rst_i: SOCM_PORT
|
23
|
+
len: 1
|
24
|
+
spc_ref: rst
|
25
|
+
:wb_adr_i: SOCM_PORT
|
26
|
+
len: uart_addr_width
|
27
|
+
spc_ref: adr
|
28
|
+
:wb_dat_i: SOCM_PORT
|
29
|
+
len: uart_data_width
|
30
|
+
spc_ref: dat_o
|
31
|
+
:wb_dat_o: SOCM_PORT
|
32
|
+
len: uart_data_width
|
33
|
+
spc_ref: dat_i
|
34
|
+
:wb_we_i: SOCM_PORT
|
35
|
+
len: 1
|
36
|
+
spc_ref: we
|
37
|
+
:wb_stb_i: SOCM_PORT
|
38
|
+
len: 1
|
39
|
+
spc_ref: stb
|
40
|
+
:wb_cyc_i: SOCM_PORT
|
41
|
+
len: 1
|
42
|
+
spc_ref: cyc
|
43
|
+
:wb_ack_o: SOCM_PORT
|
44
|
+
len: 1
|
45
|
+
spc_ref: ack
|
46
|
+
:wb_sel_i: SOCM_PORT
|
47
|
+
len: 4
|
48
|
+
spc_ref: sel
|
49
|
+
|
50
|
+
:uart_ifc: SOCM_IFC
|
51
|
+
name: uart
|
52
|
+
dir: 1
|
53
|
+
id: uart,1
|
54
|
+
ports:
|
55
|
+
:stx_pad_o: SOCM_PORT
|
56
|
+
len: 1
|
57
|
+
spc_ref: stx_pad
|
58
|
+
:srx_pad_i: SOCM_PORT
|
59
|
+
len: 1
|
60
|
+
spc_ref: srx_pad
|
61
|
+
:rts_pad_o: SOCM_PORT
|
62
|
+
len: 1
|
63
|
+
spc_ref: rts_pad
|
64
|
+
:cts_pad_i: SOCM_PORT
|
65
|
+
len: 1
|
66
|
+
spc_ref: cts_pad
|
67
|
+
:dtr_pad_o: SOCM_PORT
|
68
|
+
len: 1
|
69
|
+
spc_ref: dtr_pad
|
70
|
+
:dsr_pad_i: SOCM_PORT
|
71
|
+
len: 1
|
72
|
+
spc_ref: dsr_pad
|
73
|
+
:ri_pad_i: SOCM_PORT
|
74
|
+
len: 1
|
75
|
+
spc_ref: ri_pad
|
76
|
+
:dcd_pad_i: SOCM_PORT
|
77
|
+
len: 1
|
78
|
+
spc_ref: dcd_pad
|
79
|
+
|
80
|
+
:int_ifc: SOCM_IFC
|
81
|
+
name: single
|
82
|
+
dir: 0
|
83
|
+
id: single,1
|
84
|
+
ports:
|
85
|
+
:int_o: SOCM_PORT
|
86
|
+
len: 1
|
87
|
+
spc_ref: single
|
88
|
+
|
89
|
+
|
90
|
+
inst_parameters:
|
91
|
+
:uart_data_width: SOCM_PARAM
|
92
|
+
type: integer
|
93
|
+
default: 32
|
94
|
+
description: Wishbone Data Bus Width
|
95
|
+
:uart_addr_width: SOCM_PARAM
|
96
|
+
type: integer
|
97
|
+
default: 32
|
98
|
+
description: Wishbone Address Bus Width
|
99
|
+
|