1
1
#ifndef IVL_netlist_H
2
2
#define IVL_netlist_H
3
3
/*
4
- * Copyright (c) 1998-2015 Stephen Williams ([email protected] )
4
+ * Copyright (c) 1998-2016 Stephen Williams ([email protected] )
5
5
* Copyright CERN 2013 / Stephen Williams ([email protected] )
6
6
*
7
7
* This source code is free software; you can redistribute it
@@ -379,6 +379,8 @@ class Nexus {
379
379
380
380
NetNet* pick_any_net ();
381
381
382
+ NetNode* pick_any_node ();
383
+
382
384
/* This method counts the number of input and output links for
383
385
this nexus, and assigns the results to the output arguments. */
384
386
void count_io (unsigned &inp, unsigned &out) const ;
@@ -388,6 +390,10 @@ class Nexus {
388
390
is a variable, but also if this is a net with a force. */
389
391
bool assign_lval () const ;
390
392
393
+ /* This method returns true if there are any inputs
394
+ attached to this nexus but no drivers. */
395
+ bool has_floating_input () const ;
396
+
391
397
/* This method returns true if there are any drivers
392
398
(including variables) attached to this nexus. */
393
399
bool drivers_present () const ;
@@ -1146,6 +1152,12 @@ class NetScope : public Definitions, public Attrib {
1146
1152
children of this node as well. */
1147
1153
void run_functor (Design*des, functor_t *fun);
1148
1154
1155
+ /* These are used in synthesis. They provide shared pullup and
1156
+ pulldown nodes for this scope. */
1157
+ void add_tie_hi (Design*des);
1158
+ void add_tie_lo (Design*des);
1159
+ Link&tie_hi () const { return tie_hi_->pin (0 ); };
1160
+ Link&tie_lo () const { return tie_lo_->pin (0 ); };
1149
1161
1150
1162
/* This member is used during elaboration to pass defparam
1151
1163
assignments from the scope pass to the parameter evaluation
@@ -1267,6 +1279,9 @@ class NetScope : public Definitions, public Attrib {
1267
1279
/* Final procedures sets this to notify statements that
1268
1280
they are part of a final procedure. */
1269
1281
bool in_final_;
1282
+
1283
+ NetNode*tie_hi_;
1284
+ NetNode*tie_lo_;
1270
1285
};
1271
1286
1272
1287
/*
@@ -2605,12 +2620,11 @@ class NetProc : public virtual LineInfo {
2605
2620
2606
2621
// Synthesize as asynchronous logic, and return true. The
2607
2622
// nex_out is where this function attaches its output
2608
- // results. The accumulated_nex_out is used by sequential
2609
- // blocks to show outputs from the previous code.
2623
+ // results.
2624
+ typedef vector< bool > mask_t ;
2610
2625
virtual bool synth_async (Design*des, NetScope*scope,
2611
- NexusSet&nex_map,
2612
- NetBus&nex_out,
2613
- NetBus&accumulated_nex_out);
2626
+ NexusSet&nex_map, NetBus&nex_out,
2627
+ NetBus&enables, vector<mask_t >&bitmasks);
2614
2628
2615
2629
// Synthesize as synchronous logic, and return true. That
2616
2630
// means binding the outputs to the data port of a FF, and the
@@ -2630,6 +2644,7 @@ class NetProc : public virtual LineInfo {
2630
2644
NetBus&ff_aclr, NetBus&ff_aset,
2631
2645
vector<verinum>&ff_aset_value,
2632
2646
NexusSet&nex_map, NetBus&nex_out,
2647
+ vector<mask_t >&bitmasks,
2633
2648
const std::vector<NetEvProbe*>&events);
2634
2649
2635
2650
virtual void dump (ostream&, unsigned ind) const ;
@@ -2640,7 +2655,9 @@ class NetProc : public virtual LineInfo {
2640
2655
protected:
2641
2656
bool synth_async_block_substatement_ (Design*des, NetScope*scope,
2642
2657
NexusSet&nex_map,
2643
- NetBus&accumulated_nex_out,
2658
+ NetBus&nex_out,
2659
+ NetBus&enables,
2660
+ vector<mask_t >&bitmasks,
2644
2661
NetProc*substmt);
2645
2662
private:
2646
2663
friend class NetBlock ;
@@ -2819,7 +2836,7 @@ class NetAssignBase : public NetProc {
2819
2836
2820
2837
bool synth_async (Design*des, NetScope*scope,
2821
2838
NexusSet&nex_map, NetBus&nex_out,
2822
- NetBus&accumulated_nex_out );
2839
+ NetBus&enables, vector< mask_t >&bitmasks );
2823
2840
2824
2841
// This dumps all the lval structures.
2825
2842
void dump_lval (ostream&) const ;
@@ -2905,14 +2922,15 @@ class NetBlock : public NetProc {
2905
2922
// synthesize as asynchronous logic, and return true.
2906
2923
bool synth_async (Design*des, NetScope*scope,
2907
2924
NexusSet&nex_map, NetBus&nex_out,
2908
- NetBus&accumulated_nex_out );
2925
+ NetBus&enables, vector< mask_t >&bitmasks );
2909
2926
2910
2927
bool synth_sync (Design*des, NetScope*scope,
2911
2928
bool &ff_negedge,
2912
2929
NetNet*ff_clk, NetBus&ff_ce,
2913
2930
NetBus&ff_aclr,NetBus&ff_aset,
2914
2931
vector<verinum>&ff_aset_value,
2915
2932
NexusSet&nex_map, NetBus&nex_out,
2933
+ vector<mask_t >&bitmasks,
2916
2934
const std::vector<NetEvProbe*>&events);
2917
2935
2918
2936
// This version of emit_recurse scans all the statements of
@@ -2968,7 +2986,7 @@ class NetCase : public NetProc {
2968
2986
2969
2987
bool synth_async (Design*des, NetScope*scope,
2970
2988
NexusSet&nex_map, NetBus&nex_out,
2971
- NetBus&accumulated_nex_out );
2989
+ NetBus&enables, vector< mask_t >&bitmasks );
2972
2990
2973
2991
virtual bool emit_proc (struct target_t *) const ;
2974
2992
virtual void dump (ostream&, unsigned ind) const ;
@@ -2984,7 +3002,7 @@ class NetCase : public NetProc {
2984
3002
2985
3003
bool synth_async_casez_ (Design*des, NetScope*scope,
2986
3004
NexusSet&nex_map, NetBus&nex_out,
2987
- NetBus&accumulated_nex_out );
3005
+ NetBus&enables, vector< mask_t >&bitmasks );
2988
3006
2989
3007
TYPE type_;
2990
3008
@@ -3048,14 +3066,15 @@ class NetCondit : public NetProc {
3048
3066
bool is_asynchronous ();
3049
3067
bool synth_async (Design*des, NetScope*scope,
3050
3068
NexusSet&nex_map, NetBus&nex_out,
3051
- NetBus&accumulated_nex_out );
3069
+ NetBus&enables, vector< mask_t >&bitmasks );
3052
3070
3053
3071
bool synth_sync (Design*des, NetScope*scope,
3054
3072
bool &ff_negedge,
3055
3073
NetNet*ff_clk, NetBus&ff_ce,
3056
3074
NetBus&ff_aclr,NetBus&ff_aset,
3057
3075
vector<verinum>&ff_aset_value,
3058
3076
NexusSet&nex_map, NetBus&nex_out,
3077
+ vector<mask_t >&bitmasks,
3059
3078
const std::vector<NetEvProbe*>&events);
3060
3079
3061
3080
virtual bool emit_proc (struct target_t *) const ;
@@ -3327,14 +3346,15 @@ class NetEvWait : public NetProc {
3327
3346
3328
3347
virtual bool synth_async (Design*des, NetScope*scope,
3329
3348
NexusSet&nex_map, NetBus&nex_out,
3330
- NetBus&accumulated_nex_out );
3349
+ NetBus&enables, vector< mask_t >&bitmasks );
3331
3350
3332
3351
virtual bool synth_sync (Design*des, NetScope*scope,
3333
3352
bool &ff_negedge,
3334
3353
NetNet*ff_clk, NetBus&ff_ce,
3335
3354
NetBus&ff_aclr,NetBus&ff_aset,
3336
3355
vector<verinum>&ff_aset_value,
3337
3356
NexusSet&nex_map, NetBus&nex_out,
3357
+ vector<mask_t >&bitmasks,
3338
3358
const std::vector<NetEvProbe*>&events);
3339
3359
3340
3360
virtual void dump (ostream&, unsigned ind) const ;
@@ -3439,7 +3459,7 @@ class NetForLoop : public NetProc {
3439
3459
// synthesize as asynchronous logic, and return true.
3440
3460
bool synth_async (Design*des, NetScope*scope,
3441
3461
NexusSet&nex_map, NetBus&nex_out,
3442
- NetBus&accumulated_nex_out );
3462
+ NetBus&enables, vector< mask_t >&bitmasks );
3443
3463
3444
3464
private:
3445
3465
NetNet*index_;
@@ -3827,8 +3847,14 @@ class NetProcTop : public LineInfo, public Attrib {
3827
3847
bool emit (struct target_t *tgt) const ;
3828
3848
3829
3849
private:
3850
+ bool tie_off_floating_inputs_ (Design*des,
3851
+ NexusSet&nex_map, NetBus&nex_in,
3852
+ vector<NetProc::mask_t >&bitmasks,
3853
+ bool is_ff_input);
3854
+
3830
3855
const ivl_process_type_t type_;
3831
3856
NetProc*const statement_;
3857
+ Design*synthesized_design_;
3832
3858
3833
3859
NetScope*scope_;
3834
3860
friend class Design ;
0 commit comments