Skip to content

Commit

Permalink
Renamed synthsplit to exposenodes.
Browse files Browse the repository at this point in the history
This was needed to avoid automatically setting the synth flag in the
compiler.
  • Loading branch information
martinwhitaker committed Feb 27, 2016
1 parent a33255f commit f84f053
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ CTARGETFLAGS = @CTARGETFLAGS@
M = LineInfo.o StringHeap.o

TT = t-dll.o t-dll-api.o t-dll-expr.o t-dll-proc.o t-dll-analog.o
FF = cprop.o nodangle.o synth.o synth2.o synthsplit.o syn-rules.o
FF = cprop.o exposenodes.o nodangle.o synth.o synth2.o syn-rules.o

O = main.o async.o design_dump.o discipline.o dup_expr.o elaborate.o \
elab_expr.o elaborate_analog.o elab_lval.o elab_net.o \
Expand Down
26 changes: 16 additions & 10 deletions synthsplit.cc → exposenodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


/*
* The synthsplit functor is primarily provided for use by the vlog95
* The exposenodes functor is primarily provided for use by the vlog95
* target. To implement some LPM objects, it needs to take a bit or part
* of one of the LPM inputs. If that input is not connected to a real
* net in the design, we need to create a net at that point so that
Expand All @@ -42,7 +42,7 @@
* name it generates is unique).
*/

struct synthsplit_functor : public functor_t {
struct exposenodes_functor : public functor_t {

unsigned count;

Expand All @@ -56,6 +56,12 @@ static bool expose_nexus(Nexus*nex)
NetNet*sig = 0;
for (Link*cur = nex->first_nlink() ; cur ; cur = cur->next_nlink()) {

// Don't expose nodes that are attached to constants
if (dynamic_cast<NetConst*> (cur->get_obj()))
return false;
if (dynamic_cast<NetLiteral*> (cur->get_obj()))
return false;

NetNet*cur_sig = dynamic_cast<NetNet*> (cur->get_obj());
if (cur_sig == 0)
continue;
Expand All @@ -77,7 +83,7 @@ static bool expose_nexus(Nexus*nex)
* The vlog95 target implements a wide mux as a hierarchy of 2:1 muxes,
* picking off one bit of the select input at each level of the hierarchy.
*/
void synthsplit_functor::lpm_mux(Design*, NetMux*obj)
void exposenodes_functor::lpm_mux(Design*, NetMux*obj)
{
if (obj->sel_width() == 1)
return;
Expand All @@ -89,7 +95,7 @@ void synthsplit_functor::lpm_mux(Design*, NetMux*obj)
/*
* A VP part select is going to select a part from its input.
*/
void synthsplit_functor::lpm_part_select(Design*, NetPartSelect*obj)
void exposenodes_functor::lpm_part_select(Design*, NetPartSelect*obj)
{
if (obj->dir() != NetPartSelect::VP)
return;
Expand All @@ -101,22 +107,22 @@ void synthsplit_functor::lpm_part_select(Design*, NetPartSelect*obj)
/*
* A substitute is going to select one or two parts from the wider input signal.
*/
void synthsplit_functor::lpm_substitute(Design*, NetSubstitute*obj)
void exposenodes_functor::lpm_substitute(Design*, NetSubstitute*obj)
{
if (expose_nexus(obj->pin(1).nexus()))
count += 1;
}

void synthsplit(Design*des)
void exposenodes(Design*des)
{
synthsplit_functor synthsplit;
synthsplit.count = 0;
exposenodes_functor exposenodes;
exposenodes.count = 0;
if (verbose_flag) {
cout << " ... Look for intermediate nodes" << endl << flush;
}
des->functor(&synthsplit);
des->functor(&exposenodes);
if (verbose_flag) {
cout << " ... Exposed " << synthsplit.count
cout << " ... Exposed " << exposenodes.count
<< " intermediate signals." << endl << flush;
}
}
14 changes: 7 additions & 7 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ const bool CASE_SENSITIVE = true;
bool synthesis = false;

extern void cprop(Design*des);
extern void exposenodes(Design*des);
extern void synth(Design*des);
extern void synth2(Design*des);
extern void synthsplit(Design*des);
extern void syn_rules(Design*des);
extern void nodangle(Design*des);

Expand All @@ -237,12 +237,12 @@ static struct net_func_map {
const char*name;
void (*func)(Design*);
} func_table[] = {
{ "cprop", &cprop },
{ "nodangle", &nodangle },
{ "synth", &synth },
{ "synth2", &synth2 },
{ "synthsplit", &synthsplit },
{ "syn-rules", &syn_rules },
{ "cprop", &cprop },
{ "exposenodes", &exposenodes },
{ "nodangle", &nodangle },
{ "synth", &synth },
{ "synth2", &synth2 },
{ "syn-rules", &syn_rules },
{ 0, 0 }
};

Expand Down
2 changes: 1 addition & 1 deletion tgt-vlog95/vlog95-s.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
functor:synth2
functor:synth
functor:syn-rules
functor:synthsplit
functor:nodangle
functor:exposenodes
flag:DLL=vlog95.tgt
flag:DISABLE_CONCATZ_GENERATION=true

0 comments on commit f84f053

Please sign in to comment.