Skip to content

Commit 0fb3f3a

Browse files
committed
tracy: init, zones per pass execute method, pointer-colored
1 parent 5579685 commit 0fb3f3a

File tree

180 files changed

+567
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+567
-4
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "abc"]
22
path = abc
33
url = https://github.com/YosysHQ/abc
4+
[submodule "tracy"]
5+
path = tracy
6+
url = [email protected]:wolfpld/tracy.git

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
9191
VPATH := $(YOSYS_SRC)
9292

9393
CXXSTD ?= c++11
94-
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
94+
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -Itracy/public -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
9595
LIBS := $(LIBS) -lstdc++ -lm
9696
PLUGIN_LINKFLAGS :=
9797
PLUGIN_LIBS :=
@@ -595,6 +595,8 @@ $(eval $(call add_include_file,frontends/ast/ast_binding.h))
595595
$(eval $(call add_include_file,frontends/blif/blifparse.h))
596596
$(eval $(call add_include_file,backends/rtlil/rtlil_backend.h))
597597

598+
OBJS += tracy/public/TracyClient.o
599+
CXXFLAGS += -DTRACY_ENABLE
598600
OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/yosys.o
599601
OBJS += kernel/binding.o
600602
OBJS += kernel/cellaigs.o kernel/celledges.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

flake.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
# TODO: don't override src when ./abc is empty
1616
# which happens when the command used is `nix build` and not `nix build ?submodules=1`
1717
abc-verifier = pkgs.abc-verifier.overrideAttrs(x: y: {src = ./abc;});
18-
yosys = pkgs.clangStdenv.mkDerivation {
18+
yosys = pkgs.llvmPackages.libcxxStdenv.mkDerivation {
1919
name = "yosys";
2020
src = ./. ;
21-
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git pkg-configUpstream ];
21+
buildInputs = with pkgs; [ bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git pkg-configUpstream tracy ];
2222
checkInputs = with pkgs; [ gtest ];
2323
propagatedBuildInputs = [ abc-verifier ];
2424
preConfigure = "make config-clang";
@@ -41,7 +41,7 @@
4141
packages.default = yosys;
4242
defaultPackage = yosys;
4343
devShell = pkgs.mkShell {
44-
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git gtest abc-verifier ];
44+
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git gtest abc-verifier tracy ];
4545
};
4646
}
4747
);

kernel/register.h

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "kernel/yosys_common.h"
2424
#include "kernel/yosys.h"
2525

26+
#include "tracy/public/tracy/Tracy.hpp"
27+
2628
YOSYS_NAMESPACE_BEGIN
2729

2830
struct Pass

passes/cmds/add.cc

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ struct AddPass : public Pass {
152152
}
153153
void execute(std::vector<std::string> args, RTLIL::Design *design) override
154154
{
155+
ZoneScoped;
156+
ZoneText(pass_name.c_str(), pass_name.length());
157+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
155158
std::string command;
156159
std::string arg_name;
157160
std::string enable_name = "";

passes/cmds/autoname.cc

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ struct AutonamePass : public Pass {
101101
}
102102
void execute(std::vector<std::string> args, RTLIL::Design *design) override
103103
{
104+
ZoneScoped;
105+
ZoneText(pass_name.c_str(), pass_name.length());
106+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
104107
size_t argidx;
105108
for (argidx = 1; argidx < args.size(); argidx++)
106109
{

passes/cmds/blackbox.cc

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ struct BlackboxPass : public Pass {
3636
}
3737
void execute(std::vector<std::string> args, RTLIL::Design *design) override
3838
{
39+
ZoneScoped;
40+
ZoneText(pass_name.c_str(), pass_name.length());
41+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
3942
size_t argidx;
4043
for (argidx = 1; argidx < args.size(); argidx++)
4144
{

passes/cmds/bugpoint.cc

+3
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ struct BugpointPass : public Pass {
399399

400400
void execute(std::vector<std::string> args, RTLIL::Design *design) override
401401
{
402+
ZoneScoped;
403+
ZoneText(pass_name.c_str(), pass_name.length());
404+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
402405
string yosys_cmd = "yosys", yosys_arg, grep, runner;
403406
bool fast = false, clean = false;
404407
bool modules = false, ports = false, cells = false, connections = false, processes = false, assigns = false, updates = false, wires = false, has_part = false;

passes/cmds/check.cc

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ struct CheckPass : public Pass {
6262
}
6363
void execute(std::vector<std::string> args, RTLIL::Design *design) override
6464
{
65+
ZoneScoped;
66+
ZoneText(pass_name.c_str(), pass_name.length());
67+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
6568
int counter = 0;
6669
bool noinit = false;
6770
bool initdrv = false;

passes/cmds/chformal.cc

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ struct ChformalPass : public Pass {
128128
}
129129
void execute(std::vector<std::string> args, RTLIL::Design *design) override
130130
{
131+
ZoneScoped;
132+
ZoneText(pass_name.c_str(), pass_name.length());
133+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
131134
bool assert2assume = false;
132135
bool assume2assert = false;
133136
bool live2fair = false;

passes/cmds/chtype.cc

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ struct ChtypePass : public Pass {
4242
}
4343
void execute(std::vector<std::string> args, RTLIL::Design *design) override
4444
{
45+
ZoneScoped;
46+
ZoneText(pass_name.c_str(), pass_name.length());
47+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
4548
IdString set_type;
4649
dict<IdString, IdString> map_types;
4750

passes/cmds/clean_zerowidth.cc

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ struct CleanZeroWidthPass : public Pass {
5252

5353
void execute(std::vector<std::string> args, RTLIL::Design *design) override
5454
{
55+
ZoneScoped;
56+
ZoneText(pass_name.c_str(), pass_name.length());
57+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
5558
size_t argidx;
5659
for (argidx = 1; argidx < args.size(); argidx++)
5760
{

passes/cmds/connect.cc

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ struct ConnectPass : public Pass {
8080
}
8181
void execute(std::vector<std::string> args, RTLIL::Design *design) override
8282
{
83+
ZoneScoped;
84+
ZoneText(pass_name.c_str(), pass_name.length());
85+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
8386
bool flag_nounset = false, flag_nomap = false, flag_assert = false;
8487
std::string set_lhs, set_rhs, unset_expr;
8588
std::string port_cell, port_port, port_expr;

passes/cmds/connwrappers.cc

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ struct ConnwrappersPass : public Pass {
167167
}
168168
void execute(std::vector<std::string> args, RTLIL::Design *design) override
169169
{
170+
ZoneScoped;
171+
ZoneText(pass_name.c_str(), pass_name.length());
172+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
170173
ConnwrappersWorker worker;
171174

172175
size_t argidx;

passes/cmds/copy.cc

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ struct CopyPass : public Pass {
3838
}
3939
void execute(std::vector<std::string> args, RTLIL::Design *design) override
4040
{
41+
ZoneScoped;
42+
ZoneText(pass_name.c_str(), pass_name.length());
43+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
4144
if (args.size() != 3)
4245
log_cmd_error("Invalid number of arguments!\n");
4346

passes/cmds/cover.cc

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ struct CoverPass : public Pass {
8585
}
8686
void execute(std::vector<std::string> args, RTLIL::Design *design) override
8787
{
88+
ZoneScoped;
89+
ZoneText(pass_name.c_str(), pass_name.length());
90+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
8891
std::vector<FILE*> out_files;
8992
std::vector<std::string> patterns;
9093
bool do_log = true;

passes/cmds/delete.cc

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ struct DeletePass : public Pass {
4242
}
4343
void execute(std::vector<std::string> args, RTLIL::Design *design) override
4444
{
45+
ZoneScoped;
46+
ZoneText(pass_name.c_str(), pass_name.length());
47+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
4548
bool flag_input = false;
4649
bool flag_output = false;
4750

passes/cmds/design.cc

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ struct DesignPass : public Pass {
107107
}
108108
void execute(std::vector<std::string> args, RTLIL::Design *design) override
109109
{
110+
ZoneScoped;
111+
ZoneText(pass_name.c_str(), pass_name.length());
112+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
110113
bool got_mode = false;
111114
bool reset_mode = false;
112115
bool reset_vlog_mode = false;

passes/cmds/dft_tag.cc

+3
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,9 @@ struct DftTagPass : public Pass {
972972

973973
void execute(std::vector<std::string> args, RTLIL::Design *design) override
974974
{
975+
ZoneScoped;
976+
ZoneText(pass_name.c_str(), pass_name.length());
977+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
975978
DftTagOptions options;
976979

977980
log_header(design, "Executing DFT_TAG pass.\n");

passes/cmds/edgetypes.cc

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ struct EdgetypePass : public Pass {
3737
}
3838
void execute(std::vector<std::string> args, RTLIL::Design *design) override
3939
{
40+
ZoneScoped;
41+
ZoneText(pass_name.c_str(), pass_name.length());
42+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
4043
size_t argidx;
4144
for (argidx = 1; argidx < args.size(); argidx++) {
4245
// if (args[argidx] == "-ltr") {

passes/cmds/exec.cc

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ struct ExecPass : public Pass {
7373
}
7474
void execute(std::vector<std::string> args, RTLIL::Design *design) override
7575
{
76+
ZoneScoped;
77+
ZoneText(pass_name.c_str(), pass_name.length());
78+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
7679
std::string cmd = "";
7780
char buf[1024] = {};
7881
std::string linebuf = "";

passes/cmds/future.cc

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ struct FuturePass : public Pass {
119119
}
120120
void execute(std::vector<std::string> args, RTLIL::Design *design) override
121121
{
122+
ZoneScoped;
123+
ZoneText(pass_name.c_str(), pass_name.length());
124+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
122125
FutureOptions options;
123126

124127
log_header(design, "Executing FUTURE pass.\n");

passes/cmds/glift.cc

+3
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,9 @@ struct GliftPass : public Pass {
517517

518518
void execute(std::vector<std::string> args, RTLIL::Design *design) override
519519
{
520+
ZoneScoped;
521+
ZoneText(pass_name.c_str(), pass_name.length());
522+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
520523
bool opt_create_precise_model = false, opt_create_imprecise_model = false, opt_create_instrumented_model = false;
521524
bool opt_taintconstants = false, opt_keepoutputs = false, opt_simplecostmodel = false, opt_nocostmodel = false;
522525
bool opt_instrumentmore = false;

passes/cmds/logcmd.cc

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ struct LogPass : public Pass {
6565
}
6666
void execute(std::vector<std::string> args, RTLIL::Design* design) override
6767
{
68+
ZoneScoped;
69+
ZoneText(pass_name.c_str(), pass_name.length());
70+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
6871
size_t argidx;
6972
bool to_stdout = false;
7073
bool to_stderr = false;

passes/cmds/logger.cc

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ struct LoggerPass : public Pass {
7373

7474
void execute(std::vector<std::string> args, RTLIL::Design * design) override
7575
{
76+
ZoneScoped;
77+
ZoneText(pass_name.c_str(), pass_name.length());
78+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
7679
size_t argidx;
7780
for (argidx = 1; argidx < args.size(); argidx++)
7881
{

passes/cmds/ltp.cc

+3
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ struct LtpPass : public Pass {
156156
}
157157
void execute(std::vector<std::string> args, RTLIL::Design *design) override
158158
{
159+
ZoneScoped;
160+
ZoneText(pass_name.c_str(), pass_name.length());
161+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
159162
bool noff = false;
160163

161164
log_header(design, "Executing LTP pass (find longest path).\n");

passes/cmds/plugin.cc

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ struct PluginPass : public Pass {
142142
}
143143
void execute(std::vector<std::string> args, RTLIL::Design *design) override
144144
{
145+
ZoneScoped;
146+
ZoneText(pass_name.c_str(), pass_name.length());
147+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
145148
std::string plugin_filename;
146149
std::vector<std::string> plugin_aliases;
147150
bool list_mode = false;

passes/cmds/portlist.cc

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ struct PortlistPass : public Pass {
4141
}
4242
void execute(std::vector<std::string> args, RTLIL::Design *design) override
4343
{
44+
ZoneScoped;
45+
ZoneText(pass_name.c_str(), pass_name.length());
46+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
4447
bool m_mode = false;
4548

4649
size_t argidx;

passes/cmds/printattrs.cc

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ struct PrintAttrsPass : public Pass {
5050

5151
void execute(std::vector<std::string> args, RTLIL::Design *design) override
5252
{
53+
ZoneScoped;
54+
ZoneText(pass_name.c_str(), pass_name.length());
55+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
5356
size_t argidx = 1;
5457
extra_args(args, argidx, design);
5558

passes/cmds/qwp.cc

+3
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,9 @@ struct QwpPass : public Pass {
810810
}
811811
void execute(std::vector<std::string> args, RTLIL::Design *design) override
812812
{
813+
ZoneScoped;
814+
ZoneText(pass_name.c_str(), pass_name.length());
815+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
813816
QwpConfig config;
814817
xorshift32_state = 123456789;
815818

passes/cmds/rename.cc

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ struct RenamePass : public Pass {
256256
}
257257
void execute(std::vector<std::string> args, RTLIL::Design *design) override
258258
{
259+
ZoneScoped;
260+
ZoneText(pass_name.c_str(), pass_name.length());
261+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
259262
std::string pattern_prefix = "_", pattern_suffix = "_";
260263
std::string cell_suffix = "";
261264
bool flag_src = false;

passes/cmds/scatter.cc

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ struct ScatterPass : public Pass {
4343
}
4444
void execute(std::vector<std::string> args, RTLIL::Design *design) override
4545
{
46+
ZoneScoped;
47+
ZoneText(pass_name.c_str(), pass_name.length());
48+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
4649
CellTypes ct(design);
4750
extra_args(args, 1, design);
4851

passes/cmds/scc.cc

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ struct SccPass : public Pass {
294294
}
295295
void execute(std::vector<std::string> args, RTLIL::Design *design) override
296296
{
297+
ZoneScoped;
298+
ZoneText(pass_name.c_str(), pass_name.length());
299+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
297300
dict<std::string, std::string> setAttr;
298301
bool allCellTypes = false;
299302
bool selectMode = false;

passes/cmds/scratchpad.cc

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ struct ScratchpadPass : public Pass {
6666

6767
void execute(std::vector<std::string> args, RTLIL::Design *design) override
6868
{
69+
ZoneScoped;
70+
ZoneText(pass_name.c_str(), pass_name.length());
71+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
6972
size_t argidx;
7073
for (argidx = 1; argidx < args.size(); argidx++)
7174
{

passes/cmds/select.cc

+9
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,9 @@ struct SelectPass : public Pass {
12541254
}
12551255
void execute(std::vector<std::string> args, RTLIL::Design *design) override
12561256
{
1257+
ZoneScoped;
1258+
ZoneText(pass_name.c_str(), pass_name.length());
1259+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
12571260
bool add_mode = false;
12581261
bool del_mode = false;
12591262
bool clear_mode = false;
@@ -1622,6 +1625,9 @@ struct CdPass : public Pass {
16221625
}
16231626
void execute(std::vector<std::string> args, RTLIL::Design *design) override
16241627
{
1628+
ZoneScoped;
1629+
ZoneText(pass_name.c_str(), pass_name.length());
1630+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
16251631
if (args.size() != 1 && args.size() != 2)
16261632
log_cmd_error("Invalid number of arguments.\n");
16271633

@@ -1713,6 +1719,9 @@ struct LsPass : public Pass {
17131719
}
17141720
void execute(std::vector<std::string> args, RTLIL::Design *design) override
17151721
{
1722+
ZoneScoped;
1723+
ZoneText(pass_name.c_str(), pass_name.length());
1724+
ZoneColor((uint32_t)(size_t)pass_name.c_str());
17161725
size_t argidx = 1;
17171726
extra_args(args, argidx, design);
17181727

0 commit comments

Comments
 (0)