forked from YosysHQ/nerv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrapper.sv
60 lines (52 loc) · 1.69 KB
/
wrapper.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* NERV -- Naive Educational RISC-V Processor
*
* Copyright (C) 2020 Claire Xenia Wolf <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
module rvfi_wrapper (
input clock,
input reset,
`RVFI_OUTPUTS
);
(* keep *) `rvformal_rand_reg stall;
(* keep *) `rvformal_rand_reg [31:0] imem_data;
(* keep *) `rvformal_rand_reg [31:0] dmem_rdata;
(* keep *) wire [31:0] imem_addr;
(* keep *) wire dmem_valid;
(* keep *) wire [31:0] dmem_addr;
(* keep *) wire [ 3:0] dmem_wstrb;
(* keep *) wire [31:0] dmem_wdata;
nerv uut (
.clock (clock ),
.reset (reset ),
.stall (stall ),
.imem_addr (imem_addr ),
.imem_data (imem_data ),
.dmem_valid (dmem_valid),
.dmem_addr (dmem_addr ),
.dmem_wstrb (dmem_wstrb),
.dmem_wdata (dmem_wdata),
.dmem_rdata (dmem_rdata),
`RVFI_CONN
);
`ifdef NERV_FAIRNESS
reg [2:0] stalled = 0;
always @(posedge clock) begin
stalled <= {stalled, stall};
assume (~stalled);
end
`endif
endmodule