1 |
12 |
juko |
/*
|
2 |
|
|
* .--------------. .----------------. .------------.
|
3 |
|
|
* | .------------. | .--------------. | .----------. |
|
4 |
|
|
* | | ____ ____ | | | ____ ____ | | | ______ | |
|
5 |
|
|
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || |
|
6 |
|
|
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| |
|
7 |
|
|
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | |
|
8 |
|
|
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| |
|
9 |
|
|
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| |
|
10 |
|
|
* | | | | | | | | | | | |
|
11 |
|
|
* |_| | '------------' | '--------------' | '----------' |
|
12 |
|
|
* '--------------' '----------------' '------------'
|
13 |
|
|
*
|
14 |
|
|
* openHMC - An Open Source Hybrid Memory Cube Controller
|
15 |
|
|
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg
|
16 |
|
|
* www.ziti.uni-heidelberg.de
|
17 |
|
|
* B6, 26
|
18 |
|
|
* 68159 Mannheim
|
19 |
|
|
* Germany
|
20 |
|
|
*
|
21 |
|
|
* Contact: openhmc@ziti.uni-heidelberg.de
|
22 |
|
|
* http://ra.ziti.uni-heidelberg.de/openhmc
|
23 |
|
|
*
|
24 |
|
|
* This source file is free software: you can redistribute it and/or modify
|
25 |
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
26 |
|
|
* the Free Software Foundation, either version 3 of the License, or
|
27 |
|
|
* (at your option) any later version.
|
28 |
|
|
*
|
29 |
|
|
* This source file is distributed in the hope that it will be useful,
|
30 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
31 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
32 |
|
|
* GNU Lesser General Public License for more details.
|
33 |
|
|
*
|
34 |
|
|
* You should have received a copy of the GNU Lesser General Public License
|
35 |
|
|
* along with this source file. If not, see .
|
36 |
|
|
*
|
37 |
|
|
*
|
38 |
|
|
*/
|
39 |
|
|
|
40 |
|
|
//
|
41 |
|
|
//
|
42 |
|
|
// register file interface
|
43 |
|
|
//
|
44 |
|
|
//
|
45 |
|
|
|
46 |
|
|
`ifndef CAG_RGM_RFS_IF_SV
|
47 |
|
|
`define CAG_RGM_RFS_IF_SV
|
48 |
|
|
|
49 |
|
|
interface cag_rgm_rfs_if #(
|
50 |
|
|
parameter ADDR_WIDTH = 6,
|
51 |
|
|
parameter WRITE_DATA_WIDTH = 64,
|
52 |
|
|
parameter READ_DATA_WIDTH = 64
|
53 |
|
|
) ();
|
54 |
|
|
|
55 |
|
|
logic res_n;
|
56 |
|
|
logic clk;
|
57 |
|
|
|
58 |
|
|
logic [ADDR_WIDTH-1:0] address;
|
59 |
|
|
logic wen;
|
60 |
|
|
logic ren;
|
61 |
|
|
logic [WRITE_DATA_WIDTH-1:0] write_data;
|
62 |
|
|
logic [READ_DATA_WIDTH-1:0] read_data;
|
63 |
|
|
logic access_done;
|
64 |
|
|
logic invalid_address;
|
65 |
|
|
|
66 |
|
|
property valid_wen;
|
67 |
|
|
@(posedge clk) disable iff(!res_n)
|
68 |
|
|
wen |-> !$isunknown(address) && !$isunknown(write_data);
|
69 |
|
|
endproperty : valid_wen
|
70 |
|
|
assert property(valid_wen);
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
property valid_ren;
|
74 |
|
|
@(posedge clk) disable iff(!res_n)
|
75 |
|
|
ren |-> !$isunknown(address);
|
76 |
|
|
endproperty : valid_ren
|
77 |
|
|
assert property(valid_ren);
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
property valid_access_done;
|
81 |
|
|
@(posedge clk) disable iff(!res_n)
|
82 |
|
|
wen || ren |=> !(wen || ren) [*0:1150] ##1 access_done;
|
83 |
|
|
endproperty : valid_access_done
|
84 |
|
|
assert property(valid_access_done);
|
85 |
|
|
|
86 |
|
|
access_done_one_clk : assert property(@(posedge clk) disable iff(!res_n) $rose(access_done) |=> !access_done );
|
87 |
|
|
|
88 |
|
|
property invalid_address_on_done_only;
|
89 |
|
|
@(posedge clk) disable iff(!res_n)
|
90 |
|
|
invalid_address |-> access_done;
|
91 |
|
|
endproperty : invalid_address_on_done_only
|
92 |
|
|
assert property(invalid_address_on_done_only);
|
93 |
|
|
|
94 |
|
|
property no_simultaneous_read_and_write_on_0;
|
95 |
|
|
@(posedge clk) disable iff(!res_n)
|
96 |
|
|
ren |-> !wen;
|
97 |
|
|
endproperty : no_simultaneous_read_and_write_on_0
|
98 |
|
|
assert property(no_simultaneous_read_and_write_on_0);
|
99 |
|
|
|
100 |
|
|
property no_simultaneous_read_and_write_on_1;
|
101 |
|
|
@(posedge clk) disable iff(!res_n)
|
102 |
|
|
wen |-> !ren;
|
103 |
|
|
endproperty : no_simultaneous_read_and_write_on_1
|
104 |
|
|
assert property(no_simultaneous_read_and_write_on_1);
|
105 |
|
|
|
106 |
|
|
endinterface : cag_rgm_rfs_if
|
107 |
|
|
|
108 |
|
|
`endif // CAG_RGM_RFS_IF_SV
|