2013-08-22 04:34:55 -05:00
|
|
|
/*
|
|
|
|
* yosys -- Yosys Open SYnthesis Suite
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-11-03 14:41:39 -06:00
|
|
|
// [[CITE]] EDIF Version 2 0 0 Grammar
|
|
|
|
// http://web.archive.org/web/20050730021644/http://www.edif.org/documentation/BNF_GRAMMAR/index.html
|
|
|
|
|
2013-08-22 04:34:55 -05:00
|
|
|
#include "kernel/rtlil.h"
|
|
|
|
#include "kernel/register.h"
|
|
|
|
#include "kernel/sigtools.h"
|
|
|
|
#include "kernel/celltypes.h"
|
|
|
|
#include "kernel/log.h"
|
|
|
|
#include <string>
|
|
|
|
|
2014-02-21 06:40:43 -06:00
|
|
|
#define EDIF_DEF(_id) edif_names(RTLIL::unescape_id(_id), true).c_str()
|
|
|
|
#define EDIF_REF(_id) edif_names(RTLIL::unescape_id(_id), false).c_str()
|
2013-08-22 07:30:33 -05:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
struct EdifNames
|
|
|
|
{
|
|
|
|
int counter;
|
|
|
|
std::set<std::string> generated_names, used_names;
|
|
|
|
std::map<std::string, std::string> name_map;
|
|
|
|
|
|
|
|
EdifNames() : counter(1) { }
|
|
|
|
|
2014-02-21 06:40:43 -06:00
|
|
|
std::string operator()(std::string id, bool define)
|
2013-08-22 07:30:33 -05:00
|
|
|
{
|
2014-02-21 06:40:43 -06:00
|
|
|
if (define) {
|
|
|
|
std::string new_id = operator()(id, false);
|
|
|
|
return new_id != id ? stringf("(rename %s \"%s\")", new_id.c_str(), id.c_str()) : id;
|
|
|
|
}
|
|
|
|
|
2013-08-22 07:30:33 -05:00
|
|
|
if (name_map.count(id) > 0)
|
|
|
|
return name_map.at(id);
|
|
|
|
if (generated_names.count(id) > 0)
|
|
|
|
goto do_rename;
|
2013-09-17 06:07:12 -05:00
|
|
|
if (id == "GND" || id == "VCC")
|
|
|
|
goto do_rename;
|
2013-08-22 07:30:33 -05:00
|
|
|
|
|
|
|
for (size_t i = 0; i < id.size(); i++) {
|
|
|
|
if ('A' <= id[i] && id[i] <= 'Z')
|
|
|
|
continue;
|
|
|
|
if ('a' <= id[i] && id[i] <= 'z')
|
|
|
|
continue;
|
|
|
|
if ('0' <= id[i] && id[i] <= '9' && i > 0)
|
|
|
|
continue;
|
|
|
|
if (id[i] == '_' && i > 0 && i != id.size()-1)
|
|
|
|
continue;
|
|
|
|
goto do_rename;
|
|
|
|
}
|
|
|
|
|
|
|
|
used_names.insert(id);
|
|
|
|
return id;
|
|
|
|
|
|
|
|
do_rename:;
|
|
|
|
std::string gen_name;
|
|
|
|
while (1) {
|
|
|
|
gen_name = stringf("id%05d", counter++);
|
|
|
|
if (generated_names.count(gen_name) == 0 &&
|
|
|
|
used_names.count(gen_name) == 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
generated_names.insert(gen_name);
|
|
|
|
name_map[id] = gen_name;
|
2014-02-21 06:40:43 -06:00
|
|
|
return gen_name;
|
2013-08-22 07:30:33 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-08-22 04:34:55 -05:00
|
|
|
struct EdifBackend : public Backend {
|
|
|
|
EdifBackend() : Backend("edif", "write design to EDIF netlist file") { }
|
|
|
|
virtual void help()
|
|
|
|
{
|
|
|
|
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
|
|
|
log("\n");
|
|
|
|
log(" write_edif [options] [filename]\n");
|
|
|
|
log("\n");
|
|
|
|
log("Write the current design to an EDIF netlist file.\n");
|
|
|
|
log("\n");
|
|
|
|
log(" -top top_module\n");
|
|
|
|
log(" set the specified module as design top module\n");
|
|
|
|
log("\n");
|
2013-09-17 06:07:12 -05:00
|
|
|
log("Unfortunately there are different \"flavors\" of the EDIF file format. This\n");
|
|
|
|
log("command generates EDIF files for the Xilinx place&route tools. It might be\n");
|
|
|
|
log("necessary to make small modifications to this command when a different tool\n");
|
|
|
|
log("is targeted.\n");
|
|
|
|
log("\n");
|
2013-08-22 04:34:55 -05:00
|
|
|
}
|
|
|
|
virtual void execute(FILE *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design)
|
|
|
|
{
|
|
|
|
log_header("Executing EDIF backend.\n");
|
|
|
|
|
|
|
|
std::string top_module_name;
|
|
|
|
std::map<std::string, std::set<std::string>> lib_cell_ports;
|
|
|
|
CellTypes ct(design);
|
2013-08-22 07:30:33 -05:00
|
|
|
EdifNames edif_names;
|
2013-08-22 04:34:55 -05:00
|
|
|
|
|
|
|
size_t argidx;
|
|
|
|
for (argidx = 1; argidx < args.size(); argidx++)
|
|
|
|
{
|
|
|
|
if (args[argidx] == "-top" && argidx+1 < args.size()) {
|
|
|
|
top_module_name = args[++argidx];
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
extra_args(f, filename, args, argidx);
|
|
|
|
|
2013-11-23 22:03:43 -06:00
|
|
|
if (top_module_name.empty())
|
2014-07-27 03:18:00 -05:00
|
|
|
for (auto & mod_it:design->modules_)
|
2013-11-23 22:03:43 -06:00
|
|
|
if (mod_it.second->get_bool_attribute("\\top"))
|
|
|
|
top_module_name = mod_it.first;
|
|
|
|
|
2014-07-27 03:18:00 -05:00
|
|
|
for (auto module_it : design->modules_)
|
2013-08-22 04:34:55 -05:00
|
|
|
{
|
|
|
|
RTLIL::Module *module = module_it.second;
|
2013-11-22 08:01:12 -06:00
|
|
|
if (module->get_bool_attribute("\\blackbox"))
|
2013-08-22 04:34:55 -05:00
|
|
|
continue;
|
|
|
|
|
|
|
|
if (top_module_name.empty())
|
|
|
|
top_module_name = module->name;
|
|
|
|
|
|
|
|
if (module->processes.size() != 0)
|
|
|
|
log_error("Found unmapped processes in module %s: unmapped processes are not supported in EDIF backend!\n", RTLIL::id2cstr(module->name));
|
|
|
|
if (module->memories.size() != 0)
|
|
|
|
log_error("Found munmapped emories in module %s: unmapped memories are not supported in EDIF backend!\n", RTLIL::id2cstr(module->name));
|
|
|
|
|
2014-07-26 18:51:45 -05:00
|
|
|
for (auto cell_it : module->cells_)
|
2013-08-22 04:34:55 -05:00
|
|
|
{
|
|
|
|
RTLIL::Cell *cell = cell_it.second;
|
2014-07-27 03:18:00 -05:00
|
|
|
if (!design->modules_.count(cell->type) || design->modules_.at(cell->type)->get_bool_attribute("\\blackbox")) {
|
2013-08-22 04:34:55 -05:00
|
|
|
lib_cell_ports[cell->type];
|
2014-07-26 07:32:50 -05:00
|
|
|
for (auto p : cell->connections()) {
|
2014-07-22 13:15:14 -05:00
|
|
|
if (p.second.size() > 1)
|
2013-08-22 04:34:55 -05:00
|
|
|
log_error("Found multi-bit port %s on library cell %s.%s (%s): not supported in EDIF backend!\n",
|
|
|
|
RTLIL::id2cstr(p.first), RTLIL::id2cstr(module->name), RTLIL::id2cstr(cell->name), RTLIL::id2cstr(cell->type));
|
|
|
|
lib_cell_ports[cell->type].insert(p.first);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (top_module_name.empty())
|
|
|
|
log_error("No module found in design!\n");
|
|
|
|
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, "(edif %s\n", EDIF_DEF(top_module_name));
|
2013-08-22 04:34:55 -05:00
|
|
|
fprintf(f, " (edifVersion 2 0 0)\n");
|
|
|
|
fprintf(f, " (edifLevel 0)\n");
|
|
|
|
fprintf(f, " (keywordMap (keywordLevel 0))\n");
|
2013-11-03 14:41:39 -06:00
|
|
|
fprintf(f, " (comment \"Generated by %s\")\n", yosys_version_str);
|
2013-08-22 04:34:55 -05:00
|
|
|
|
|
|
|
fprintf(f, " (external LIB\n");
|
|
|
|
fprintf(f, " (edifLevel 0)\n");
|
|
|
|
fprintf(f, " (technology (numberDefinition))\n");
|
2013-09-17 06:07:12 -05:00
|
|
|
|
|
|
|
fprintf(f, " (cell GND\n");
|
|
|
|
fprintf(f, " (cellType GENERIC)\n");
|
|
|
|
fprintf(f, " (view VIEW_NETLIST\n");
|
|
|
|
fprintf(f, " (viewType NETLIST)\n");
|
|
|
|
fprintf(f, " (interface (port G (direction OUTPUT)))\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
|
|
|
|
fprintf(f, " (cell VCC\n");
|
|
|
|
fprintf(f, " (cellType GENERIC)\n");
|
|
|
|
fprintf(f, " (view VIEW_NETLIST\n");
|
|
|
|
fprintf(f, " (viewType NETLIST)\n");
|
|
|
|
fprintf(f, " (interface (port P (direction OUTPUT)))\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
|
2013-08-22 04:34:55 -05:00
|
|
|
for (auto &cell_it : lib_cell_ports) {
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (cell %s\n", EDIF_DEF(cell_it.first));
|
2013-08-22 04:34:55 -05:00
|
|
|
fprintf(f, " (cellType GENERIC)\n");
|
|
|
|
fprintf(f, " (view VIEW_NETLIST\n");
|
|
|
|
fprintf(f, " (viewType NETLIST)\n");
|
|
|
|
fprintf(f, " (interface\n");
|
|
|
|
for (auto &port_it : cell_it.second) {
|
|
|
|
const char *dir = "INOUT";
|
|
|
|
if (ct.cell_known(cell_it.first)) {
|
|
|
|
if (!ct.cell_output(cell_it.first, port_it))
|
|
|
|
dir = "INPUT";
|
|
|
|
else if (!ct.cell_input(cell_it.first, port_it))
|
|
|
|
dir = "OUTPUT";
|
|
|
|
}
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (port %s (direction %s))\n", EDIF_DEF(port_it), dir);
|
2013-08-22 04:34:55 -05:00
|
|
|
}
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
}
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
|
2013-11-03 15:01:32 -06:00
|
|
|
std::vector<RTLIL::Module*> sorted_modules;
|
|
|
|
|
|
|
|
// extract module dependencies
|
|
|
|
std::map<RTLIL::Module*, std::set<RTLIL::Module*>> module_deps;
|
2014-07-27 03:18:00 -05:00
|
|
|
for (auto &mod_it : design->modules_) {
|
2013-11-03 15:01:32 -06:00
|
|
|
module_deps[mod_it.second] = std::set<RTLIL::Module*>();
|
2014-07-26 18:51:45 -05:00
|
|
|
for (auto &cell_it : mod_it.second->cells_)
|
2014-07-27 03:18:00 -05:00
|
|
|
if (design->modules_.count(cell_it.second->type) > 0)
|
|
|
|
module_deps[mod_it.second].insert(design->modules_.at(cell_it.second->type));
|
2013-11-03 15:01:32 -06:00
|
|
|
}
|
|
|
|
|
2013-11-04 01:34:15 -06:00
|
|
|
// simple good-enough topological sort
|
|
|
|
// (O(n*m) on n elements and depth m)
|
2013-11-03 15:01:32 -06:00
|
|
|
while (module_deps.size() > 0) {
|
|
|
|
size_t sorted_modules_idx = sorted_modules.size();
|
|
|
|
for (auto &it : module_deps) {
|
|
|
|
for (auto &dep : it.second)
|
|
|
|
if (module_deps.count(dep) > 0)
|
2013-11-04 01:34:15 -06:00
|
|
|
goto not_ready_yet;
|
2013-11-03 15:01:32 -06:00
|
|
|
// log("Next in topological sort: %s\n", RTLIL::id2cstr(it.first->name));
|
|
|
|
sorted_modules.push_back(it.first);
|
2013-11-04 01:34:15 -06:00
|
|
|
not_ready_yet:;
|
2013-11-03 15:01:32 -06:00
|
|
|
}
|
|
|
|
if (sorted_modules_idx == sorted_modules.size())
|
|
|
|
log_error("Cyclic dependency between modules found! Cycle includes module %s.\n", RTLIL::id2cstr(module_deps.begin()->first->name));
|
|
|
|
while (sorted_modules_idx < sorted_modules.size())
|
|
|
|
module_deps.erase(sorted_modules.at(sorted_modules_idx++));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-22 04:34:55 -05:00
|
|
|
fprintf(f, " (library DESIGN\n");
|
|
|
|
fprintf(f, " (edifLevel 0)\n");
|
|
|
|
fprintf(f, " (technology (numberDefinition))\n");
|
2013-11-03 15:01:32 -06:00
|
|
|
for (auto module : sorted_modules)
|
2013-08-22 04:34:55 -05:00
|
|
|
{
|
2013-11-22 08:01:12 -06:00
|
|
|
if (module->get_bool_attribute("\\blackbox"))
|
2013-08-22 04:34:55 -05:00
|
|
|
continue;
|
|
|
|
|
|
|
|
SigMap sigmap(module);
|
|
|
|
std::map<RTLIL::SigSpec, std::set<std::string>> net_join_db;
|
|
|
|
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (cell %s\n", EDIF_DEF(module->name));
|
2013-08-22 04:34:55 -05:00
|
|
|
fprintf(f, " (cellType GENERIC)\n");
|
|
|
|
fprintf(f, " (view VIEW_NETLIST\n");
|
|
|
|
fprintf(f, " (viewType NETLIST)\n");
|
|
|
|
fprintf(f, " (interface\n");
|
2014-07-26 18:49:51 -05:00
|
|
|
for (auto &wire_it : module->wires_) {
|
2013-08-22 04:34:55 -05:00
|
|
|
RTLIL::Wire *wire = wire_it.second;
|
|
|
|
if (wire->port_id == 0)
|
|
|
|
continue;
|
|
|
|
const char *dir = "INOUT";
|
|
|
|
if (!wire->port_output)
|
|
|
|
dir = "INPUT";
|
|
|
|
else if (!wire->port_input)
|
|
|
|
dir = "OUTPUT";
|
2013-08-27 07:22:11 -05:00
|
|
|
if (wire->width == 1) {
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (port %s (direction %s))\n", EDIF_DEF(wire->name), dir);
|
2013-08-27 07:22:11 -05:00
|
|
|
RTLIL::SigSpec sig = sigmap(RTLIL::SigSpec(wire));
|
2014-02-21 06:40:43 -06:00
|
|
|
net_join_db[sig].insert(stringf("(portRef %s)", EDIF_REF(wire->name)));
|
2013-08-27 07:22:11 -05:00
|
|
|
} else {
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (port (array %s %d) (direction %s))\n", EDIF_DEF(wire->name), wire->width, dir);
|
2013-08-27 07:22:11 -05:00
|
|
|
for (int i = 0; i < wire->width; i++) {
|
2014-07-23 02:48:26 -05:00
|
|
|
RTLIL::SigSpec sig = sigmap(RTLIL::SigSpec(wire, i));
|
2014-02-21 06:40:43 -06:00
|
|
|
net_join_db[sig].insert(stringf("(portRef (member %s %d))", EDIF_REF(wire->name), i));
|
2013-08-27 07:22:11 -05:00
|
|
|
}
|
2013-08-22 04:34:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " (contents\n");
|
2013-09-17 06:07:12 -05:00
|
|
|
fprintf(f, " (instance GND (viewRef VIEW_NETLIST (cellRef GND (libraryRef LIB))))\n");
|
|
|
|
fprintf(f, " (instance VCC (viewRef VIEW_NETLIST (cellRef VCC (libraryRef LIB))))\n");
|
2014-07-26 18:51:45 -05:00
|
|
|
for (auto &cell_it : module->cells_) {
|
2013-08-22 04:34:55 -05:00
|
|
|
RTLIL::Cell *cell = cell_it.second;
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (instance %s\n", EDIF_DEF(cell->name));
|
|
|
|
fprintf(f, " (viewRef VIEW_NETLIST (cellRef %s%s))", EDIF_REF(cell->type),
|
2013-08-22 04:34:55 -05:00
|
|
|
lib_cell_ports.count(cell->type) > 0 ? " (libraryRef LIB)" : "");
|
2013-08-27 07:22:11 -05:00
|
|
|
for (auto &p : cell->parameters)
|
2013-12-04 07:14:05 -06:00
|
|
|
if ((p.second.flags & RTLIL::CONST_FLAG_STRING) != 0)
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, "\n (property %s (string \"%s\"))", EDIF_DEF(p.first), p.second.decode_string().c_str());
|
2013-08-28 01:48:49 -05:00
|
|
|
else if (p.second.bits.size() <= 32 && RTLIL::SigSpec(p.second).is_fully_def())
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, "\n (property %s (integer %u))", EDIF_DEF(p.first), p.second.as_int());
|
2013-08-28 01:48:49 -05:00
|
|
|
else {
|
|
|
|
std::string hex_string = "";
|
|
|
|
for (size_t i = 0; i < p.second.bits.size(); i += 4) {
|
|
|
|
int digit_value = 0;
|
2013-10-27 02:21:05 -05:00
|
|
|
if (i+0 < p.second.bits.size() && p.second.bits.at(i+0) == RTLIL::State::S1) digit_value |= 1;
|
|
|
|
if (i+1 < p.second.bits.size() && p.second.bits.at(i+1) == RTLIL::State::S1) digit_value |= 2;
|
|
|
|
if (i+2 < p.second.bits.size() && p.second.bits.at(i+2) == RTLIL::State::S1) digit_value |= 4;
|
|
|
|
if (i+3 < p.second.bits.size() && p.second.bits.at(i+3) == RTLIL::State::S1) digit_value |= 8;
|
2013-08-28 01:48:49 -05:00
|
|
|
char digit_str[2] = { "0123456789abcdef"[digit_value], 0 };
|
|
|
|
hex_string = std::string(digit_str) + hex_string;
|
|
|
|
}
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, "\n (property %s (string \"%s\"))", EDIF_DEF(p.first), hex_string.c_str());
|
2013-08-28 01:48:49 -05:00
|
|
|
}
|
2013-08-27 07:22:11 -05:00
|
|
|
fprintf(f, ")\n");
|
2014-07-26 07:32:50 -05:00
|
|
|
for (auto &p : cell->connections()) {
|
2013-08-22 04:34:55 -05:00
|
|
|
RTLIL::SigSpec sig = sigmap(p.second);
|
2014-07-23 09:09:27 -05:00
|
|
|
for (int i = 0; i < SIZE(sig); i++)
|
2014-07-22 13:15:14 -05:00
|
|
|
if (sig.size() == 1)
|
2014-07-23 09:09:27 -05:00
|
|
|
net_join_db[sig[i]].insert(stringf("(portRef %s (instanceRef %s))", EDIF_REF(p.first), EDIF_REF(cell->name)));
|
2014-02-21 06:10:36 -06:00
|
|
|
else
|
2014-07-23 09:09:27 -05:00
|
|
|
net_join_db[sig[i]].insert(stringf("(portRef (member %s %d) (instanceRef %s))", EDIF_REF(p.first), i, EDIF_REF(cell->name)));
|
2013-08-22 04:34:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
for (auto &it : net_join_db) {
|
2014-07-24 15:47:57 -05:00
|
|
|
RTLIL::SigBit sig = it.first;
|
|
|
|
if (sig.wire == NULL && sig != RTLIL::State::S0 && sig != RTLIL::State::S1)
|
|
|
|
continue;
|
2013-09-17 06:07:12 -05:00
|
|
|
std::string netname = log_signal(sig);
|
2013-08-22 04:34:55 -05:00
|
|
|
for (size_t i = 0; i < netname.size(); i++)
|
|
|
|
if (netname[i] == ' ' || netname[i] == '\\')
|
|
|
|
netname.erase(netname.begin() + i--);
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (net %s (joined\n", EDIF_DEF(netname));
|
2013-08-22 04:34:55 -05:00
|
|
|
for (auto &ref : it.second)
|
|
|
|
fprintf(f, " %s\n", ref.c_str());
|
2014-07-24 15:47:57 -05:00
|
|
|
if (sig.wire == NULL) {
|
|
|
|
if (sig == RTLIL::State::S0)
|
2013-09-17 06:07:12 -05:00
|
|
|
fprintf(f, " (portRef G (instanceRef GND))\n");
|
2014-07-24 15:47:57 -05:00
|
|
|
if (sig == RTLIL::State::S1)
|
2013-09-17 06:07:12 -05:00
|
|
|
fprintf(f, " (portRef P (instanceRef VCC))\n");
|
|
|
|
}
|
2013-08-22 04:34:55 -05:00
|
|
|
fprintf(f, " ))\n");
|
|
|
|
}
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
}
|
|
|
|
fprintf(f, " )\n");
|
|
|
|
|
2014-02-21 06:40:43 -06:00
|
|
|
fprintf(f, " (design %s\n", EDIF_DEF(top_module_name));
|
|
|
|
fprintf(f, " (cellRef %s (libraryRef DESIGN))\n", EDIF_REF(top_module_name));
|
2013-08-22 04:34:55 -05:00
|
|
|
fprintf(f, " )\n");
|
|
|
|
|
|
|
|
fprintf(f, ")\n");
|
|
|
|
}
|
|
|
|
} EdifBackend;
|
|
|
|
|