blob: af7c6210e987239dfd40b9bf9a384378638ee34c [file] [log] [blame]
Michael Schaffnerb5a88f22019-11-26 19:43:37 -08001// Copyright lowRISC contributors.
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4//
5// Testbench module for ${dut.name}.
6// Intended to be used with a formal tool.
7
8% if len(dut.pkgs) > 0:
9module ${dut.name}_fpv
10% for pkg in dut.pkgs:
11 import ${pkg};
12% endfor
13% if dut.params:
14#(
15% else:
16(
17% endif
18% else:
19% if dut.params:
20module ${dut.name}_fpv #(
21% else:
22module ${dut.name}_fpv (
23% endif
24% endif
25% if dut.params:
26% for k, param in enumerate(dut.params):
27<% comma = "" if (k == len(dut.params)-1) else "," %> ${param.style} ${param.datatype} ${param.name} =${param.value}${comma}
28% endfor
29) (
30% endif
31% for k, port in enumerate(dut.ports):
32<% comma = "" if (k == len(dut.ports)-1) else "," %> ${port.direction} ${port.datatype} ${port.name}${comma}
33% endfor
34);
35
Michael Schaffnerccef8272019-12-06 08:54:55 -080036<% params = dut.get_param_style("parameter") %>
37% if params:
Michael Schaffnerb5a88f22019-11-26 19:43:37 -080038 ${dut.name} #(
Michael Schaffnerccef8272019-12-06 08:54:55 -080039% for k, param in enumerate(params):
40 <% comma = "" if (k == len(params)-1) else "," %> .${param.name}(${param.name})${comma}
Michael Schaffnerb5a88f22019-11-26 19:43:37 -080041% endfor
Cindy Chena3976db2020-07-26 19:13:09 -070042 ) dut (
Michael Schaffnerb5a88f22019-11-26 19:43:37 -080043% else:
Cindy Chena3976db2020-07-26 19:13:09 -070044 ${dut.name} dut (
Michael Schaffnerb5a88f22019-11-26 19:43:37 -080045%endif
46 % for k, port in enumerate(dut.ports):
47<% comma = "" if (k == len(dut.ports)-1) else "," %> .${port.name}${comma}
48 % endfor
49 );
50
51
52endmodule : ${dut.name}_fpv