Skip to content

Commit

Permalink
io: refactor string and file work into new unit
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Dec 11, 2024
1 parent 87736a2 commit a2696d4
Show file tree
Hide file tree
Showing 17 changed files with 592 additions and 520 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
VPATH := $(YOSYS_SRC)

CXXSTD ?= c++17
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -Werror=implicit-function-declaration -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
LIBS := $(LIBS) -lstdc++ -lm
PLUGIN_LINKFLAGS :=
PLUGIN_LIBS :=
Expand Down Expand Up @@ -611,6 +611,7 @@ ifeq ($(ENABLE_ZLIB),1)
$(eval $(call add_include_file,kernel/fstdata.h))
endif
$(eval $(call add_include_file,kernel/hashlib.h))
$(eval $(call add_include_file,kernel/io.h))
$(eval $(call add_include_file,kernel/json.h))
$(eval $(call add_include_file,kernel/log.h))
$(eval $(call add_include_file,kernel/macc.h))
Expand Down Expand Up @@ -641,7 +642,7 @@ $(eval $(call add_include_file,frontends/ast/ast_binding.h))
$(eval $(call add_include_file,frontends/blif/blifparse.h))
$(eval $(call add_include_file,backends/rtlil/rtlil_backend.h))

OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/yosys.o
OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/yosys.o kernel/io.o
OBJS += kernel/binding.o kernel/tclapi.o
OBJS += kernel/cellaigs.o kernel/celledges.o kernel/cost.o kernel/satgen.o kernel/scopeinfo.o kernel/qcsat.o kernel/mem.o kernel/ffmerge.o kernel/ff.o kernel/yw.o kernel/json.o kernel/fmt.o kernel/sexpr.o
OBJS += kernel/drivertools.o kernel/functional.o
Expand Down
1 change: 1 addition & 0 deletions backends/btor/btor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "kernel/mem.h"
#include "kernel/json.h"
#include "kernel/yw.h"
#include "kernel/utils.h"
#include <string>

USING_YOSYS_NAMESPACE
Expand Down
1 change: 1 addition & 0 deletions backends/smt2/smt2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "kernel/log.h"
#include "kernel/mem.h"
#include "libs/json11/json11.hpp"
#include "kernel/utils.h"
#include <string>

USING_YOSYS_NAMESPACE
Expand Down
14 changes: 7 additions & 7 deletions frontends/ast/simplify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2777,13 +2777,13 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
mux_input = new AstNode(AST_BIT_NOT, mux_input);
}
AstNode *node = new AstNode(AST_TERNARY, children_list.at(2));
if (str == "bufif0") {
node->children.push_back(AstNode::mkconst_bits(z_const, false));
node->children.push_back(mux_input);
} else {
node->children.push_back(mux_input);
node->children.push_back(AstNode::mkconst_bits(z_const, false));
}
// if (str == "bufif0") {
// node->children.push_back(AstNode::mkconst_bits(z_const, false));
// node->children.push_back(mux_input);
// } else {
// node->children.push_back(mux_input);
// node->children.push_back(AstNode::mkconst_bits(z_const, false));
// }

str.clear();
type = AST_ASSIGN;
Expand Down
1 change: 1 addition & 0 deletions frontends/verific/verific.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "kernel/sigtools.h"
#include "kernel/celltypes.h"
#include "kernel/log.h"
#include "kernel/utils.h"
#include "libs/sha1/sha1.h"
#include <stdlib.h>
#include <stdio.h>
Expand Down
Loading

0 comments on commit a2696d4

Please sign in to comment.