From 28093d9dd288484daa9df17585c1c9f174498359 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 24 Nov 2013 05:03:43 +0100 Subject: Added "top" attribute to mark top module in hierarchy --- backends/spice/spice.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backends/spice/spice.cc') diff --git a/backends/spice/spice.cc b/backends/spice/spice.cc index 6c8a3ec9..e7926e90 100644 --- a/backends/spice/spice.cc +++ b/backends/spice/spice.cc @@ -172,6 +172,11 @@ struct SpiceBackend : public Backend { } extra_args(f, filename, args, argidx); + if (top_module_name.empty()) + for (auto & mod_it:design->modules) + if (mod_it.second->get_bool_attribute("\\top")) + top_module_name = mod_it.first; + fprintf(f, "* SPICE netlist generated by %s\n", yosys_version_str); fprintf(f, "\n"); -- cgit v1.2.3