Advertisement
Guest User

Untitled

a guest
Apr 11th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.29 KB | None | 0 0
  1. diff --git a/common/design_utils.h b/common/design_utils.h
  2. index 8a42d21..f3d91e6 100644
  3. --- a/common/design_utils.h
  4. +++ b/common/design_utils.h
  5. @@ -82,6 +82,13 @@ template <typename F1> CellInfo *net_driven_by(const Context *ctx, const NetInfo
  6.      }
  7.  }
  8.  
  9. +// If a net is NULL or doesn't go anywhere
  10. +static inline bool
  11. +net_is_unused( const NetInfo *net)
  12. +{
  13. +   return (net == nullptr) || (net->users.size() == 0);
  14. +}
  15. +
  16.  // Connect a net to a port
  17.  void connect_port(const Context *ctx, NetInfo *net, CellInfo *cell, IdString port_name);
  18.  
  19. diff --git a/ice40/pack.cc b/ice40/pack.cc
  20. index 4de88ab..0140d68 100644
  21. --- a/ice40/pack.cc
  22. +++ b/ice40/pack.cc
  23. @@ -804,8 +804,8 @@ static void place_plls(Context *ctx)
  24.          // Only consider bound IO that are used as inputs
  25.          if (!io_ci->attrs.count(ctx->id("BEL")))
  26.              continue;
  27. -        if ((!io_ci->ports.count(id_D_IN_0) || (io_ci->ports[id_D_IN_0].net == nullptr)) &&
  28. -            (!io_ci->ports.count(id_D_IN_1) || (io_ci->ports[id_D_IN_1].net == nullptr)))
  29. +        if ((!io_ci->ports.count(id_D_IN_0) || net_is_unused(io_ci->ports[id_D_IN_0].net)) &&
  30. +            (!io_ci->ports.count(id_D_IN_1) || net_is_unused(io_ci->ports[id_D_IN_1].net)))
  31.              continue;
  32.  
  33.          // Check all placed PLL (either forced by user, or forced by PACKAGEPIN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement