Applied clang-format to my own contributions
This commit is contained in:
parent
a4f687548e
commit
4499864024
246
common/log.cc
246
common/log.cc
@ -17,27 +17,27 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
#include "log.h"
|
||||
#include "design.h"
|
||||
#include "log.h"
|
||||
|
||||
std::vector<FILE*> log_files;
|
||||
std::vector<std::ostream*> log_streams;
|
||||
FILE *log_errfile = NULL;
|
||||
std::vector<FILE *> log_files;
|
||||
std::vector<std::ostream *> log_streams;
|
||||
FILE *log_errfile = NULL;
|
||||
|
||||
bool log_error_stderr = false;
|
||||
bool log_cmd_error_throw = false;
|
||||
bool log_quiet_warnings = false;
|
||||
int log_verbose_level;
|
||||
std::string log_last_error;
|
||||
bool log_error_stderr = false;
|
||||
bool log_cmd_error_throw = false;
|
||||
bool log_quiet_warnings = false;
|
||||
int log_verbose_level;
|
||||
std::string log_last_error;
|
||||
void (*log_error_atexit)() = NULL;
|
||||
|
||||
static bool next_print_log = false;
|
||||
@ -45,204 +45,192 @@ static int log_newline_count = 0;
|
||||
|
||||
std::string vstringf(const char *fmt, va_list ap)
|
||||
{
|
||||
std::string string;
|
||||
char *str = NULL;
|
||||
std::string string;
|
||||
char *str = NULL;
|
||||
|
||||
#ifdef _WIN32
|
||||
int sz = 64+strlen(fmt), rc;
|
||||
while (1) {
|
||||
va_list apc;
|
||||
va_copy(apc, ap);
|
||||
str = (char*)realloc(str, sz);
|
||||
rc = vsnprintf(str, sz, fmt, apc);
|
||||
va_end(apc);
|
||||
if (rc >= 0 && rc < sz)
|
||||
break;
|
||||
sz *= 2;
|
||||
}
|
||||
int sz = 64 + strlen(fmt), rc;
|
||||
while (1) {
|
||||
va_list apc;
|
||||
va_copy(apc, ap);
|
||||
str = (char *)realloc(str, sz);
|
||||
rc = vsnprintf(str, sz, fmt, apc);
|
||||
va_end(apc);
|
||||
if (rc >= 0 && rc < sz)
|
||||
break;
|
||||
sz *= 2;
|
||||
}
|
||||
#else
|
||||
if (vasprintf(&str, fmt, ap) < 0)
|
||||
str = NULL;
|
||||
if (vasprintf(&str, fmt, ap) < 0)
|
||||
str = NULL;
|
||||
#endif
|
||||
|
||||
if (str != NULL) {
|
||||
string = str;
|
||||
free(str);
|
||||
}
|
||||
if (str != NULL) {
|
||||
string = str;
|
||||
free(str);
|
||||
}
|
||||
|
||||
return string;
|
||||
return string;
|
||||
}
|
||||
|
||||
void logv(const char *format, va_list ap)
|
||||
{
|
||||
//
|
||||
// Trim newlines from the beginning
|
||||
while (format[0] == '\n' && format[1] != 0) {
|
||||
log("\n");
|
||||
format++;
|
||||
}
|
||||
//
|
||||
// Trim newlines from the beginning
|
||||
while (format[0] == '\n' && format[1] != 0) {
|
||||
log("\n");
|
||||
format++;
|
||||
}
|
||||
|
||||
std::string str = vstringf(format, ap);
|
||||
std::string str = vstringf(format, ap);
|
||||
|
||||
if (str.empty())
|
||||
return;
|
||||
if (str.empty())
|
||||
return;
|
||||
|
||||
size_t nnl_pos = str.find_last_not_of('\n');
|
||||
if (nnl_pos == std::string::npos)
|
||||
log_newline_count += str.size();
|
||||
else
|
||||
log_newline_count = str.size() - nnl_pos - 1;
|
||||
size_t nnl_pos = str.find_last_not_of('\n');
|
||||
if (nnl_pos == std::string::npos)
|
||||
log_newline_count += str.size();
|
||||
else
|
||||
log_newline_count = str.size() - nnl_pos - 1;
|
||||
|
||||
for (auto f : log_files)
|
||||
fputs(str.c_str(), f);
|
||||
for (auto f : log_files)
|
||||
fputs(str.c_str(), f);
|
||||
|
||||
for (auto f : log_streams)
|
||||
*f << str;
|
||||
for (auto f : log_streams)
|
||||
*f << str;
|
||||
}
|
||||
|
||||
void logv_info(const char *format, va_list ap)
|
||||
{
|
||||
std::string message = vstringf(format, ap);
|
||||
std::string message = vstringf(format, ap);
|
||||
|
||||
log("Info: %s", message.c_str());
|
||||
log_flush();
|
||||
log("Info: %s", message.c_str());
|
||||
log_flush();
|
||||
}
|
||||
|
||||
void logv_warning(const char *format, va_list ap)
|
||||
{
|
||||
std::string message = vstringf(format, ap);
|
||||
std::string message = vstringf(format, ap);
|
||||
|
||||
log("Warning: %s", message.c_str());
|
||||
log_flush();
|
||||
log("Warning: %s", message.c_str());
|
||||
log_flush();
|
||||
}
|
||||
|
||||
void logv_warning_noprefix(const char *format, va_list ap)
|
||||
{
|
||||
std::string message = vstringf(format, ap);
|
||||
std::string message = vstringf(format, ap);
|
||||
|
||||
log("%s", message.c_str());
|
||||
log("%s", message.c_str());
|
||||
}
|
||||
|
||||
void logv_error(const char *format, va_list ap)
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
auto backup_log_files = log_files;
|
||||
auto backup_log_files = log_files;
|
||||
#endif
|
||||
|
||||
if (log_errfile != NULL)
|
||||
log_files.push_back(log_errfile);
|
||||
if (log_errfile != NULL)
|
||||
log_files.push_back(log_errfile);
|
||||
|
||||
if (log_error_stderr)
|
||||
for (auto &f : log_files)
|
||||
if (f == stdout)
|
||||
f = stderr;
|
||||
if (log_error_stderr)
|
||||
for (auto &f : log_files)
|
||||
if (f == stdout)
|
||||
f = stderr;
|
||||
|
||||
log_last_error = vstringf(format, ap);
|
||||
log("ERROR: %s", log_last_error.c_str());
|
||||
log_flush();
|
||||
log_last_error = vstringf(format, ap);
|
||||
log("ERROR: %s", log_last_error.c_str());
|
||||
log_flush();
|
||||
|
||||
if (log_error_atexit)
|
||||
log_error_atexit();
|
||||
if (log_error_atexit)
|
||||
log_error_atexit();
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
log_files = backup_log_files;
|
||||
throw 0;
|
||||
log_files = backup_log_files;
|
||||
throw 0;
|
||||
#elif defined(_MSC_VER)
|
||||
_exit(EXIT_FAILURE);
|
||||
_exit(EXIT_FAILURE);
|
||||
#else
|
||||
_Exit(EXIT_FAILURE);
|
||||
_Exit(EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void log(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv(format, ap);
|
||||
va_end(ap);
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv(format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_info(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_info(format, ap);
|
||||
va_end(ap);
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_info(format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_warning(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_warning(format, ap);
|
||||
va_end(ap);
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_warning(format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_warning_noprefix(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_warning_noprefix(format, ap);
|
||||
va_end(ap);
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_warning_noprefix(format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_error(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_error(format, ap);
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
logv_error(format, ap);
|
||||
}
|
||||
|
||||
void log_cmd_error(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
||||
if (log_cmd_error_throw) {
|
||||
log_last_error = vstringf(format, ap);
|
||||
log("ERROR: %s", log_last_error.c_str());
|
||||
log_flush();
|
||||
throw log_cmd_error_exception();
|
||||
}
|
||||
if (log_cmd_error_throw) {
|
||||
log_last_error = vstringf(format, ap);
|
||||
log("ERROR: %s", log_last_error.c_str());
|
||||
log_flush();
|
||||
throw log_cmd_error_exception();
|
||||
}
|
||||
|
||||
logv_error(format, ap);
|
||||
logv_error(format, ap);
|
||||
}
|
||||
|
||||
void log_spacer()
|
||||
{
|
||||
if (log_newline_count < 2) log("\n");
|
||||
if (log_newline_count < 2) log("\n");
|
||||
if (log_newline_count < 2)
|
||||
log("\n");
|
||||
if (log_newline_count < 2)
|
||||
log("\n");
|
||||
}
|
||||
|
||||
void log_push()
|
||||
{
|
||||
}
|
||||
void log_push() {}
|
||||
|
||||
void log_pop()
|
||||
{
|
||||
log_flush();
|
||||
}
|
||||
void log_pop() { log_flush(); }
|
||||
|
||||
void log_reset_stack()
|
||||
{
|
||||
log_flush();
|
||||
}
|
||||
void log_reset_stack() { log_flush(); }
|
||||
|
||||
void log_flush()
|
||||
{
|
||||
for (auto f : log_files)
|
||||
fflush(f);
|
||||
for (auto f : log_files)
|
||||
fflush(f);
|
||||
|
||||
for (auto f : log_streams)
|
||||
f->flush();
|
||||
}
|
||||
|
||||
void log_cell(CellInfo *cell, std::string indent)
|
||||
{
|
||||
}
|
||||
|
||||
void log_net(NetInfo *net, std::string indent)
|
||||
{
|
||||
for (auto f : log_streams)
|
||||
f->flush();
|
||||
}
|
||||
|
||||
void log_cell(CellInfo *cell, std::string indent) {}
|
||||
|
||||
void log_net(NetInfo *net, std::string indent) {}
|
||||
|
59
common/log.h
59
common/log.h
@ -21,38 +21,40 @@
|
||||
#define LOG_H
|
||||
|
||||
#include <ostream>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <ostream>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "design.h"
|
||||
|
||||
// from libs/sha1/sha1.h
|
||||
|
||||
#define NXP_NORETURN
|
||||
#define NXP_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
|
||||
#define NXP_NORETURN
|
||||
#define NXP_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
|
||||
|
||||
struct log_cmd_error_exception { };
|
||||
struct log_cmd_error_exception
|
||||
{
|
||||
};
|
||||
|
||||
extern std::vector<FILE*> log_files;
|
||||
extern std::vector<std::ostream*> log_streams;
|
||||
extern FILE *log_errfile;
|
||||
extern std::vector<FILE *> log_files;
|
||||
extern std::vector<std::ostream *> log_streams;
|
||||
extern FILE *log_errfile;
|
||||
|
||||
extern bool log_quiet_warnings;
|
||||
extern int log_verbose_level;
|
||||
extern std::string log_last_error;
|
||||
extern void (*log_error_atexit)();
|
||||
extern bool log_quiet_warnings;
|
||||
extern int log_verbose_level;
|
||||
extern std::string log_last_error;
|
||||
extern void (*log_error_atexit)();
|
||||
|
||||
void logv(const char *format, va_list ap);
|
||||
void logv_warning(const char *format, va_list ap);
|
||||
void logv_warning_noprefix(const char *format, va_list ap);
|
||||
NXP_NORETURN void logv_error(const char *format, va_list ap)
|
||||
NXP_ATTRIBUTE(noreturn);
|
||||
NXP_ATTRIBUTE(noreturn);
|
||||
|
||||
extern std::ostream clog;
|
||||
extern std::ostream clog;
|
||||
void log(const char *format, ...);
|
||||
void log_header(const char *format, ...);
|
||||
void log_info(const char *format, ...);
|
||||
@ -73,24 +75,29 @@ void log_flush();
|
||||
const char *log_id(RTLIL::IdString id);
|
||||
|
||||
template<typename T> static inline const char *log_id(T *obj) {
|
||||
return log_id(obj->name);
|
||||
return log_id(obj->name);
|
||||
}
|
||||
*/
|
||||
|
||||
void log_cell(CellInfo *cell, std::string indent = "");
|
||||
void log_net(NetInfo *net, std::string indent = "");
|
||||
void log_cell(CellInfo *cell, std::string indent = "");
|
||||
void log_net(NetInfo *net, std::string indent = "");
|
||||
|
||||
#ifndef NDEBUG
|
||||
static inline void log_assert_worker(bool cond, const char *expr, const char *file, int line) {
|
||||
if (!cond) log_error("Assert `%s' failed in %s:%d.\n", expr, file, line);
|
||||
static inline void log_assert_worker(bool cond, const char *expr,
|
||||
const char *file, int line)
|
||||
{
|
||||
if (!cond)
|
||||
log_error("Assert `%s' failed in %s:%d.\n", expr, file, line);
|
||||
}
|
||||
# define log_assert(_assert_expr_) YOSYS_NAMESPACE_PREFIX log_assert_worker(_assert_expr_, #_assert_expr_, __FILE__, __LINE__)
|
||||
#define log_assert(_assert_expr_) \
|
||||
YOSYS_NAMESPACE_PREFIX log_assert_worker(_assert_expr_, #_assert_expr_, \
|
||||
__FILE__, __LINE__)
|
||||
#else
|
||||
# define log_assert(_assert_expr_)
|
||||
#define log_assert(_assert_expr_)
|
||||
#endif
|
||||
|
||||
#define log_abort() log_error("Abort in %s:%d.\n", __FILE__, __LINE__)
|
||||
#define log_ping() log("-- %s:%d %s --\n", __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
|
||||
#define log_abort() log_error("Abort in %s:%d.\n", __FILE__, __LINE__)
|
||||
#define log_ping() \
|
||||
log("-- %s:%d %s --\n", __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
|
||||
#endif
|
||||
|
@ -18,63 +18,64 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
#include "log.h"
|
||||
#include "design.h"
|
||||
#include "log.h"
|
||||
#include "place.h"
|
||||
|
||||
void place_design(Design *design) {
|
||||
std::set<IdString> types_used;
|
||||
std::set<IdString>::iterator not_found, element;
|
||||
std::set<BelType> used_bels;
|
||||
void place_design(Design *design)
|
||||
{
|
||||
std::set<IdString> types_used;
|
||||
std::set<IdString>::iterator not_found, element;
|
||||
std::set<BelType> used_bels;
|
||||
|
||||
for(auto cell_entry : design->cells) {
|
||||
CellInfo *cell = cell_entry.second;
|
||||
BelType bel_type;
|
||||
for (auto cell_entry : design->cells) {
|
||||
CellInfo *cell = cell_entry.second;
|
||||
BelType bel_type;
|
||||
|
||||
element = types_used.find(cell->type);
|
||||
if (element != types_used.end()) {
|
||||
continue;
|
||||
}
|
||||
element = types_used.find(cell->type);
|
||||
if (element != types_used.end()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bel_type = belTypeFromId(cell->type);
|
||||
if (bel_type == BelType()) {
|
||||
log_error("No Bel of type \'%s\' defined for "
|
||||
"this chip\n", cell->type.c_str());
|
||||
}
|
||||
types_used.insert(cell->type);
|
||||
std::cout << cell->type << std::endl;
|
||||
}
|
||||
bel_type = belTypeFromId(cell->type);
|
||||
if (bel_type == BelType()) {
|
||||
log_error("No Bel of type \'%s\' defined for "
|
||||
"this chip\n",
|
||||
cell->type.c_str());
|
||||
}
|
||||
types_used.insert(cell->type);
|
||||
std::cout << cell->type << std::endl;
|
||||
}
|
||||
|
||||
for(auto bel_type_name : types_used) {
|
||||
auto blist = design->chip.getBels();
|
||||
BelType bel_type = belTypeFromId(bel_type_name);
|
||||
auto bi = blist.begin();
|
||||
for (auto bel_type_name : types_used) {
|
||||
auto blist = design->chip.getBels();
|
||||
BelType bel_type = belTypeFromId(bel_type_name);
|
||||
auto bi = blist.begin();
|
||||
|
||||
for(auto cell_entry : design->cells) {
|
||||
CellInfo *cell = cell_entry.second;
|
||||
for (auto cell_entry : design->cells) {
|
||||
CellInfo *cell = cell_entry.second;
|
||||
|
||||
// Only place one type of Bel at a time
|
||||
if (cell->type.compare(bel_type_name)!=0)
|
||||
continue;
|
||||
// Only place one type of Bel at a time
|
||||
if (cell->type.compare(bel_type_name) != 0)
|
||||
continue;
|
||||
|
||||
while((bi != blist.end())
|
||||
&&(design->chip.getBelType(*bi) != bel_type))
|
||||
bi++;
|
||||
if (bi == blist.end())
|
||||
log_error("Too many \'%s\' used in design\n",
|
||||
cell->type.c_str());
|
||||
cell->bel = *bi++;
|
||||
}
|
||||
}
|
||||
while ((bi != blist.end()) &&
|
||||
(design->chip.getBelType(*bi) != bel_type))
|
||||
bi++;
|
||||
if (bi == blist.end())
|
||||
log_error("Too many \'%s\' used in design\n",
|
||||
cell->type.c_str());
|
||||
cell->bel = *bi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,11 @@
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
#ifndef PLACE_H
|
||||
#define PLACE_H
|
||||
#ifndef PLACE_H
|
||||
#define PLACE_H
|
||||
|
||||
#include "design.h"
|
||||
|
||||
extern void place_design(Design *design);
|
||||
extern void place_design(Design *design);
|
||||
|
||||
#endif // PLACE_H
|
||||
#endif // PLACE_H
|
||||
|
@ -1,68 +1,72 @@
|
||||
#include <string>
|
||||
#include <assert.h>
|
||||
#include <string>
|
||||
#include "design.h"
|
||||
#include "log.h"
|
||||
|
||||
bool check_all_nets_driven(Design *design) {
|
||||
const bool debug = false;
|
||||
bool check_all_nets_driven(Design *design)
|
||||
{
|
||||
const bool debug = false;
|
||||
|
||||
log_info("Rule checker, Verifying pre-placed design\n");
|
||||
log_info("Rule checker, Verifying pre-placed design\n");
|
||||
|
||||
for(auto cell_entry : design->cells) {
|
||||
CellInfo *cell = cell_entry.second;
|
||||
for (auto cell_entry : design->cells) {
|
||||
CellInfo *cell = cell_entry.second;
|
||||
|
||||
if (debug) log_info(" Examining cell \'%s\', of type \'%s\'\n",
|
||||
cell->name.c_str(),
|
||||
cell->type.c_str());
|
||||
for(auto port_entry : cell->ports) {
|
||||
PortInfo &port = port_entry.second;
|
||||
if (debug)
|
||||
log_info(" Examining cell \'%s\', of type \'%s\'\n",
|
||||
cell->name.c_str(), cell->type.c_str());
|
||||
for (auto port_entry : cell->ports) {
|
||||
PortInfo &port = port_entry.second;
|
||||
|
||||
if (debug) log_info(" Checking name of port \'%s\' "
|
||||
"against \'%s\'\n",
|
||||
port_entry.first.c_str(),
|
||||
port.name.c_str());
|
||||
assert(port.name.compare(port_entry.first)==0);
|
||||
assert(port.name.size() > 0);
|
||||
if (debug)
|
||||
log_info(" Checking name of port \'%s\' "
|
||||
"against \'%s\'\n",
|
||||
port_entry.first.c_str(), port.name.c_str());
|
||||
assert(port.name.compare(port_entry.first) == 0);
|
||||
assert(port.name.size() > 0);
|
||||
|
||||
if (port.net == NULL) {
|
||||
if (debug) log_warning(" Port \'%s\' in cell \'%s\' is unconnected\n",
|
||||
port.name.c_str(), cell->name.c_str());
|
||||
} else {
|
||||
assert(port.net);
|
||||
if (debug) log_info(" Checking for a net named \'%s\'\n",
|
||||
port.net->name.c_str());
|
||||
assert(design->nets.count(port.net->name)>0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (port.net == NULL) {
|
||||
if (debug)
|
||||
log_warning(
|
||||
" Port \'%s\' in cell \'%s\' is unconnected\n",
|
||||
port.name.c_str(), cell->name.c_str());
|
||||
} else {
|
||||
assert(port.net);
|
||||
if (debug)
|
||||
log_info(" Checking for a net named \'%s\'\n",
|
||||
port.net->name.c_str());
|
||||
assert(design->nets.count(port.net->name) > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(auto net_entry : design->nets) {
|
||||
NetInfo *net = net_entry.second;
|
||||
for (auto net_entry : design->nets) {
|
||||
NetInfo *net = net_entry.second;
|
||||
|
||||
assert(net->name.compare(net_entry.first) == 0);
|
||||
if ((net->driver.cell != NULL)
|
||||
&&(net->driver.cell->type.compare("GND") != 0)
|
||||
&&(net->driver.cell->type.compare("VCC") != 0)) {
|
||||
assert(net->name.compare(net_entry.first) == 0);
|
||||
if ((net->driver.cell != NULL) &&
|
||||
(net->driver.cell->type.compare("GND") != 0) &&
|
||||
(net->driver.cell->type.compare("VCC") != 0)) {
|
||||
|
||||
if (debug) log_info(" Checking for a driver cell named \'%s\'\n",
|
||||
net->driver.cell->name.c_str());
|
||||
assert(design->cells.count(net->driver.cell->name) >0);
|
||||
}
|
||||
if (debug)
|
||||
log_info(" Checking for a driver cell named \'%s\'\n",
|
||||
net->driver.cell->name.c_str());
|
||||
assert(design->cells.count(net->driver.cell->name) > 0);
|
||||
}
|
||||
|
||||
for(auto user : net->users) {
|
||||
if ((user.cell != NULL)
|
||||
&&(user.cell->type.compare("GND") != 0)
|
||||
&&(user.cell->type.compare("VCC") != 0)) {
|
||||
for (auto user : net->users) {
|
||||
if ((user.cell != NULL) && (user.cell->type.compare("GND") != 0) &&
|
||||
(user.cell->type.compare("VCC") != 0)) {
|
||||
|
||||
if (debug) log_info(" Checking for a user cell named \'%s\'\n",
|
||||
user.cell->name.c_str());
|
||||
assert(design->cells.count(user.cell->name) >0);
|
||||
}
|
||||
if (debug)
|
||||
log_info(" Checking for a user cell named \'%s\'\n",
|
||||
user.cell->name.c_str());
|
||||
assert(design->cells.count(user.cell->name) > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (debug) log_info(" Verified!\n");
|
||||
return true;
|
||||
if (debug)
|
||||
log_info(" Verified!\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,13 +17,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef JSON_PARSER
|
||||
#define JSON_PARSER
|
||||
#ifndef JSON_PARSER
|
||||
#define JSON_PARSER
|
||||
|
||||
#include <string>
|
||||
#include <istream>
|
||||
#include <string>
|
||||
#include "design.h"
|
||||
|
||||
extern void parse_json_file(std::istream *&, std::string &, Design *);
|
||||
extern void parse_json_file(std::istream *&, std::string &, Design *);
|
||||
|
||||
#endif
|
||||
|
17
ice40/chip.h
17
ice40/chip.h
@ -173,12 +173,17 @@ struct BelIterator
|
||||
{
|
||||
int cursor;
|
||||
|
||||
BelIterator operator++() { cursor++; return *this; }
|
||||
BelIterator operator++(int) {
|
||||
BelIterator prior(*this);
|
||||
cursor++;
|
||||
return prior;
|
||||
}
|
||||
BelIterator operator++()
|
||||
{
|
||||
cursor++;
|
||||
return *this;
|
||||
}
|
||||
BelIterator operator++(int)
|
||||
{
|
||||
BelIterator prior(*this);
|
||||
cursor++;
|
||||
return prior;
|
||||
}
|
||||
|
||||
bool operator!=(const BelIterator &other) const
|
||||
{
|
||||
|
@ -23,11 +23,11 @@
|
||||
#include "design.h"
|
||||
#include "jsonparse.h"
|
||||
#include "log.h"
|
||||
#include "log.h"
|
||||
#include "mainwindow.h"
|
||||
#include "place.h"
|
||||
#include "pybindings.h"
|
||||
#include "version.h"
|
||||
#include "log.h"
|
||||
#include "place.h"
|
||||
|
||||
void svg_dump_el(const GraphicElement &el)
|
||||
{
|
||||
@ -244,7 +244,7 @@ int main(int argc, char *argv[])
|
||||
std::istream *f = new std::ifstream(filename);
|
||||
|
||||
parse_json_file(f, filename, &design);
|
||||
place_design(&design);
|
||||
place_design(&design);
|
||||
}
|
||||
|
||||
if (vm.count("run")) {
|
||||
@ -254,7 +254,6 @@ int main(int argc, char *argv[])
|
||||
execute_python_file(filename.c_str());
|
||||
}
|
||||
|
||||
|
||||
if (vm.count("gui")) {
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
|
Loading…
Reference in New Issue
Block a user