Skip to content

Commit

Permalink
Custom edif backend (#2030)
Browse files Browse the repository at this point in the history
This allows us to use latest yosys. The upstream edif pass introduced
changes which are incompatible with SystemVerilog.

This should unblock #2008
  • Loading branch information
kgugala authored Sep 29, 2023
2 parents ca773b9 + 6fec80f commit f12dffa
Show file tree
Hide file tree
Showing 5 changed files with 626 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontends/systemverilog/Build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ${ts}.sources := \
${${ts}.src_dir}uhdm_ast_frontend.cc \
${${ts}.src_dir}uhdm_common_frontend.cc \
${${ts}.src_dir}uhdm_surelog_ast_frontend.cc \
${$(call GetTargetStructName,yosys).mod_dir}edif.cc \
${$(call GetTargetStructName,yosys).mod_dir}const2ast.cc \
${$(call GetTargetStructName,yosys).mod_dir}simplify.cc

Expand Down
3 changes: 3 additions & 0 deletions frontends/systemverilog/uhdm_common_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "uhdm_common_frontend.h"
#include "edif.h"

namespace systemverilog_plugin
{
Expand All @@ -30,6 +31,8 @@ static void set_line_num(int) {}
/* Stub for AST::process */
static int get_line_num(void) { return 1; }

UhdmCommonFrontend::UhdmCommonFrontend(std::string name, std::string short_help) : Frontend(name, short_help) { register_synlig_edif_backend(); }

void UhdmCommonFrontend::print_read_options()
{
log(" -noassert\n");
Expand Down
2 changes: 1 addition & 1 deletion frontends/systemverilog/uhdm_common_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static inline ObjT *make_new_object_with_optional_extra_true_arg(ArgN &&...arg_n
struct UhdmCommonFrontend : public ::Yosys::Frontend {
UhdmAstShared shared;
std::vector<std::string> args;
UhdmCommonFrontend(std::string name, std::string short_help) : Frontend(name, short_help) {}
UhdmCommonFrontend(std::string name, std::string short_help);
virtual void print_read_options();
virtual void help() = 0;
virtual ::Yosys::AST::AstNode *parse(std::string filename) = 0;
Expand Down
Loading

0 comments on commit f12dffa

Please sign in to comment.