2021-05-04 13:11:43 +00:00
|
|
|
/*
|
|
|
|
Copyright 2021 Blue Liang, liangkangnan@163.com
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
2021-04-25 09:14:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
module debug_rom (
|
2021-05-04 13:11:43 +00:00
|
|
|
input wire clk_i,
|
|
|
|
input wire req_i,
|
|
|
|
input wire [31:0] addr_i,
|
|
|
|
output wire [31:0] rdata_o
|
|
|
|
);
|
2021-04-25 09:14:09 +00:00
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
localparam RomSize = 38;
|
2021-04-25 09:14:09 +00:00
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
wire [RomSize-1:0][31:0] mem;
|
2021-04-25 09:14:09 +00:00
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
assign mem = {
|
|
|
|
32'h00000000,
|
|
|
|
32'h7b200073,
|
|
|
|
32'h7b202473,
|
|
|
|
32'h7b302573,
|
|
|
|
32'h10852423,
|
|
|
|
32'hf1402473,
|
|
|
|
32'ha85ff06f,
|
|
|
|
32'h7b202473,
|
|
|
|
32'h7b302573,
|
|
|
|
32'h10052223,
|
|
|
|
32'h00100073,
|
|
|
|
32'h7b202473,
|
|
|
|
32'h7b302573,
|
|
|
|
32'h10052623,
|
|
|
|
32'h00c51513,
|
|
|
|
32'h00c55513,
|
|
|
|
32'h00000517,
|
|
|
|
32'hfd5ff06f,
|
|
|
|
32'hfa041ce3,
|
|
|
|
32'h00247413,
|
|
|
|
32'h40044403,
|
|
|
|
32'h00a40433,
|
|
|
|
32'hf1402473,
|
|
|
|
32'h02041c63,
|
|
|
|
32'h00147413,
|
|
|
|
32'h40044403,
|
|
|
|
32'h00a40433,
|
|
|
|
32'h10852023,
|
|
|
|
32'hf1402473,
|
|
|
|
32'h00c51513,
|
|
|
|
32'h00c55513,
|
|
|
|
32'h00000517,
|
|
|
|
32'h7b351073,
|
|
|
|
32'h7b241073,
|
|
|
|
32'h0ff0000f,
|
|
|
|
32'h04c0006f,
|
|
|
|
32'h07c0006f,
|
|
|
|
32'h00c0006f
|
|
|
|
};
|
2021-04-25 09:14:09 +00:00
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
reg [5:0] addr_q;
|
2021-04-25 09:14:09 +00:00
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
always @ (posedge clk_i) begin
|
|
|
|
if (req_i) begin
|
|
|
|
addr_q <= addr_i[7:2];
|
|
|
|
end
|
2021-04-25 09:14:09 +00:00
|
|
|
end
|
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
reg[31:0] rdata;
|
2021-04-25 09:14:09 +00:00
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
always @ (*) begin
|
|
|
|
rdata = 32'h0;
|
|
|
|
if (addr_q < 6'd38) begin
|
|
|
|
rdata = mem[addr_q];
|
|
|
|
end
|
2021-04-25 09:14:09 +00:00
|
|
|
end
|
|
|
|
|
2021-05-04 13:11:43 +00:00
|
|
|
assign rdata_o = rdata;
|
2021-04-25 09:14:09 +00:00
|
|
|
|
|
|
|
endmodule
|