mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-25 01:55:33 +00:00
namespace Yosys
This commit is contained in:
parent
bcd2625a82
commit
f9a307a50b
96 changed files with 878 additions and 585 deletions
|
@ -24,6 +24,8 @@
|
|||
#include <dlfcn.h>
|
||||
#include <ffi.h>
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
typedef void (*ffi_fptr) ();
|
||||
|
||||
static ffi_fptr resolve_fn (std::string symbol_name)
|
||||
|
@ -129,12 +131,18 @@ AST::AstNode *AST::dpi_call(const std::string &rtype, const std::string &fname,
|
|||
return newNode;
|
||||
}
|
||||
|
||||
YOSYS_NAMESPACE_END
|
||||
|
||||
#else /* YOSYS_ENABLE_PLUGINS */
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
AST::AstNode *AST::dpi_call(const std::string&, const std::string &fname, const std::vector<std::string>&, const std::vector<AstNode*>&)
|
||||
{
|
||||
log_error("Can't call DPI function `%s': this version of yosys is built without plugin support\n", fname.c_str());
|
||||
}
|
||||
|
||||
YOSYS_NAMESPACE_END
|
||||
|
||||
#endif /* YOSYS_ENABLE_PLUGINS */
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
#include "kernel/register.h"
|
||||
#include "kernel/log.h"
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
void rtlil_frontend_ilang_yyerror(char const *s)
|
||||
{
|
||||
log_error("Parser error in line %d: %s\n", rtlil_frontend_ilang_yyget_lineno(), s);
|
||||
YOSYS_NAMESPACE_PREFIX log_error("Parser error in line %d: %s\n", rtlil_frontend_ilang_yyget_lineno(), s);
|
||||
}
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
struct IlangFrontend : public Frontend {
|
||||
IlangFrontend() : Frontend("ilang", "read modules from ilang file") { }
|
||||
virtual void help()
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include "ilang_frontend.h"
|
||||
#include "parser.tab.h"
|
||||
|
||||
USING_YOSYS_NAMESPACE
|
||||
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
result = ILANG_FRONTEND::lexin->readsome(buf, max_size);
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "kernel/log.h"
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
using namespace PASS_DFFLIBMAP;
|
||||
|
||||
struct token_t {
|
||||
char type;
|
||||
|
|
|
@ -300,22 +300,6 @@ struct VerilogFrontend : public Frontend {
|
|||
}
|
||||
} VerilogFrontend;
|
||||
|
||||
// the yyerror function used by bison to report parser errors
|
||||
void frontend_verilog_yyerror(char const *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buffer[1024];
|
||||
char *p = buffer;
|
||||
p += snprintf(p, buffer + sizeof(buffer) - p, "Parser error in line %s:%d: ",
|
||||
AST::current_filename.c_str(), frontend_verilog_yyget_lineno());
|
||||
va_start(ap, fmt);
|
||||
p += vsnprintf(p, buffer + sizeof(buffer) - p, fmt, ap);
|
||||
va_end(ap);
|
||||
p += snprintf(p, buffer + sizeof(buffer) - p, "\n");
|
||||
log_error("%s", buffer);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
struct VerilogDefaults : public Pass {
|
||||
VerilogDefaults() : Pass("verilog_defaults", "set default options for read_verilog") { }
|
||||
virtual void help()
|
||||
|
@ -376,3 +360,19 @@ struct VerilogDefaults : public Pass {
|
|||
|
||||
YOSYS_NAMESPACE_END
|
||||
|
||||
// the yyerror function used by bison to report parser errors
|
||||
void frontend_verilog_yyerror(char const *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buffer[1024];
|
||||
char *p = buffer;
|
||||
p += snprintf(p, buffer + sizeof(buffer) - p, "Parser error in line %s:%d: ",
|
||||
YOSYS_NAMESPACE_PREFIX AST::current_filename.c_str(), frontend_verilog_yyget_lineno());
|
||||
va_start(ap, fmt);
|
||||
p += vsnprintf(p, buffer + sizeof(buffer) - p, fmt, ap);
|
||||
va_end(ap);
|
||||
p += snprintf(p, buffer + sizeof(buffer) - p, "\n");
|
||||
YOSYS_NAMESPACE_PREFIX log_error("%s", buffer);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue