// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Testbench module for ${dut.name}.
// Intended to be used with a formal tool.

% if len(dut.pkgs) > 0:
module ${dut.name}_tb
% for pkg in dut.pkgs:
  import ${pkg};
% endfor
% if dut.params:
#(
% else:
(
% endif
% else:
% if dut.params:
module ${dut.name}_tb #(
% else:
module ${dut.name}_tb (
% endif
% endif
% if dut.params:
% for k, param in enumerate(dut.params):
<% comma = "" if (k == len(dut.params)-1) else "," %>  ${param.style} ${param.datatype} ${param.name} =${param.value}${comma}
% endfor
) (
% endif
% for k, port in enumerate(dut.ports):
<% comma = "" if (k == len(dut.ports)-1) else "," %>  ${port.direction} ${port.datatype} ${port.name}${comma}
% endfor
);

<% params = dut.get_param_style("parameter") %>
% if params:
  ${dut.name} #(
% for k, param in enumerate(params):
  <% comma = "" if (k == len(params)-1) else "," %>  .${param.name}(${param.name})${comma}
% endfor
  ) dut (
% else:
  ${dut.name} dut (
%endif
  % for k, port in enumerate(dut.ports):
<% comma = "" if (k == len(dut.ports)-1) else "," %>    .${port.name}${comma}
  % endfor
  );


endmodule : ${dut.name}_tb
