3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-21 06:35:49 +00:00

CMake: integrate silimate additions and extensions

- update CMakeLists.txt to load two new files:
  - SilimateConfig.cmake: sets Silimate configuration options and defaults
  - SilimateVerific.cmake: compiles Verific library, optionally with Silimate modifications
- include silimate tests in test Makefile
This commit is contained in:
Mohamed Gaber 2026-06-10 20:27:52 +03:00
parent e58125b605
commit d986ee91ac
No known key found for this signature in database
15 changed files with 380 additions and 22 deletions

View file

@ -7,5 +7,6 @@ add_subdirectory(opt)
add_subdirectory(pmgen)
add_subdirectory(proc)
add_subdirectory(sat)
add_subdirectory(silimate)
add_subdirectory(techmap)
add_subdirectory(tests)

View file

@ -80,6 +80,26 @@ yosys_pass(opt_balance_tree
opt_balance_tree.cc
)
yosys_pass(opt_addcin
opt_addcin.cc
)
yosys_pass(opt_andor_pmux
opt_andor_pmux.cc
)
yosys_pass(opt_argmax
opt_argmax.cc
)
yosys_pass(opt_parallel_prefix
opt_parallel_prefix.cc
)
yosys_pass(opt_prienc
opt_prienc.cc
)
pmgen_command(peepopt
peepopt_shiftmul_right.pmg
peepopt_shiftmul_left.pmg
@ -88,6 +108,10 @@ pmgen_command(peepopt
peepopt_muldiv.pmg
peepopt_muldiv_c.pmg
peepopt_formal_clockgateff.pmg
peepopt_modshr_onehot.pmg
peepopt_addsub_c.pmg
peepopt_muxorder.pmg
peepopt_sub_neg.pmg
PREFIX
peepopt
)

View file

@ -0,0 +1,126 @@
yosys_pass(activity
activity.cc
)
yosys_pass(annotate_cell_fanout
annotate_cell_fanout.cc
)
yosys_pass(annotate_ff_width
annotate_ff_width.cc
)
yosys_pass(breakreduce
breakreduce.cc
)
yosys_pass(breaksop
breaksop.cc
)
yosys_pass(bus_rebuild
bus_rebuild.cc
)
yosys_pass(fanoutbuf
fanoutbuf.cc
)
yosys_pass(l2j_frontend
l2j_frontend.cc
)
yosys_pass(mux_push
mux_push.cc
)
yosys_pass(obs_clean
obs_clean.cc
)
yosys_pass(segv
segv.cc
)
yosys_pass(reg_rename
reg_rename.cc
)
yosys_pass(infer_ce
infer_ce.cc
)
yosys_pass(ffnormpol
ffnormpol.cc
)
yosys_pass(report_fanout
report_fanout.cc
)
yosys_pass(splitfanout
splitfanout.cc
)
yosys_pass(splitlarge
splitlarge.cc
)
yosys_pass(splitnetlist
splitnetlist.cc
)
yosys_pass(opt_timing_balance
opt_timing_balance.cc
)
yosys_pass(cone_partition
cone_partition.cc
)
yosys_pass(clkmerge
clkmerge.cc
)
yosys_pass(opt_boundary
opt_boundary.cc
)
yosys_pass(opt_vps
opt_vps.cc
)
yosys_pass(opt_compact_prefix
opt_compact_prefix.cc
)
yosys_pass(infer_icg
infer_icg.cc
)
pmgen_command(peepopt_expand
peepopt_expand.pmg
PREFIX
peepopt_expand
)
yosys_pass(peepopt_expand
opt_expand.cc
${PMGEN_peepopt_expand_OUTPUT}
)
pmgen_command(peepopt_shift
peepopt_combine_shifts.pmg
peepopt_expand_shifts.pmg
PREFIX
peepopt_shift
)
yosys_pass(peepopt_shift
opt_shift.cc
${PMGEN_peepopt_shift_OUTPUT}
)
pmgen_command(peepopt_muxmode
peepopt_muxmode.pmg
peepopt_muxinvprop.pmg
PREFIX
peepopt_muxmode
)
yosys_pass(peepopt_muxmode
muxmode.cc
${PMGEN_peepopt_muxmode_OUTPUT}
)
pmgen_command(peepopt_negopt
peepopt_manual2sub.pmg
peepopt_sub2neg.pmg
peepopt_negexpand.pmg
peepopt_negneg.pmg
peepopt_negmux.pmg
peepopt_negrebuild.pmg
peepopt_muxneg.pmg
peepopt_neg2sub.pmg
PREFIX
peepopt_negopt
)
yosys_pass(peepopt_negopt
negopt.cc
${PMGEN_peepopt_negopt_OUTPUT}
)

View file

@ -25,7 +25,7 @@ PRIVATE_NAMESPACE_BEGIN
bool did_something;
#include "passes/silimate/peepopt_muxmode.h"
#include "passes/silimate/peepopt_muxmode_pm.h"
struct MuxmodePass : public Pass {
MuxmodePass() : Pass("muxmode", "convert primitives to muxes") { }
@ -52,7 +52,7 @@ struct MuxmodePass : public Pass {
{
log("ITERATION %d OF MUXMODE\n", i);
did_something = false;
peepopt_pm pm(module);
peepopt_muxmode_pm pm(module);
pm.setup(module->selected_cells());
pm.run_muxmode();
pm.run_muxinvprop();

View file

@ -51,7 +51,7 @@ static SigSpec strip_ext_for_match(SigSpec sig)
return sig.extract(0, n);
}
#include "passes/silimate/peepopt_negopt.h"
#include "passes/silimate/peepopt_negopt_pm.h"
struct NegoptPass : public Pass {
NegoptPass() : Pass("negopt", "optimize negation patterns in arithmetic") { }
@ -130,7 +130,7 @@ struct NegoptPass : public Pass {
// pre-subpass creates the patterns they match
// separate pm instances so sub2neg sees the $sub cells manual2sub creates.
{
peepopt_pm pm(module);
peepopt_negopt_pm pm(module);
pm.setup(module->selected_cells());
log_pass_event("Starting", "manual2sub");
pm.run_manual2sub();
@ -138,7 +138,7 @@ struct NegoptPass : public Pass {
log_flush();
}
{
peepopt_pm pm(module);
peepopt_negopt_pm pm(module);
pm.setup(module->selected_cells());
log_pass_event("Starting", "sub2neg");
pm.run_sub2neg();
@ -150,7 +150,7 @@ struct NegoptPass : public Pass {
did_something = true;
for (int iter = 0; iter < max_iterations && did_something; iter++) {
did_something = false;
peepopt_pm pm(module);
peepopt_negopt_pm pm(module);
pm.setup(module->selected_cells());
log_pass_event("Starting", "negexpand", iter);
@ -178,7 +178,7 @@ struct NegoptPass : public Pass {
did_something = true;
for (int iter = 0; iter < max_iterations && did_something; iter++) {
did_something = false;
peepopt_pm pm(module);
peepopt_negopt_pm pm(module);
pm.setup(module->selected_cells());
log_pass_event("Starting", "negrebuild", iter);

View file

@ -25,7 +25,7 @@ PRIVATE_NAMESPACE_BEGIN
bool did_something;
#include "passes/silimate/peepopt_expand.h"
#include "passes/silimate/peepopt_expand_pm.h"
struct OptExpandPass : public Pass {
OptExpandPass() : Pass("opt_expand", "expand conjunction") { }
@ -65,7 +65,7 @@ struct OptExpandPass : public Pass {
{
log("ITERATION OF OPT_EXPAND\n");
did_something = false;
peepopt_pm pm(module);
peepopt_expand_pm pm(module);
pm.setup(module->selected_cells());
pm.run_expand();
}

View file

@ -25,7 +25,7 @@ PRIVATE_NAMESPACE_BEGIN
bool did_something;
#include "passes/silimate/peepopt_shift.h"
#include "passes/silimate/peepopt_shift_pm.h"
struct OptShiftPass : public Pass {
OptShiftPass() : Pass("opt_shift", "shift optimizations: combine and expand") { }
@ -95,7 +95,7 @@ struct OptShiftPass : public Pass {
for (int i = 0; did_something && i < max_iters; i++)
{
did_something = false;
peepopt_pm pm(module);
peepopt_shift_pm pm(module);
pm.setup(module->selected_cells());
if (run_combine)
pm.run_combine_shifts();