Horizon
rule_clearance_copper.hpp
1 #pragma once
2 #include "common/common.hpp"
3 #include "rules/rule.hpp"
4 #include "rules/rule_match.hpp"
5 
6 namespace horizon {
7 class RuleClearanceCopper : public Rule {
8 public:
9  static const auto id = RuleID::CLEARANCE_COPPER;
10  RuleID get_id() const override
11  {
12  return id;
13  }
14 
15  RuleClearanceCopper(const UUID &uu);
16  RuleClearanceCopper(const UUID &uu, const json &j, const RuleImportMap &import_map);
17  json serialize() const override;
18 
19  std::string get_brief(const class Block *block = nullptr, class IPool *pool = nullptr) const override;
20  bool is_match_all() const override;
21  bool can_export() const override;
22 
23  RuleMatch match_1;
24  RuleMatch match_2;
25  int layer = 10000;
26  uint64_t routing_offset = 0.05_mm;
27 
28  uint64_t get_clearance(PatchType a, PatchType b) const;
29  void set_clearance(PatchType a, PatchType b, uint64_t c);
30  uint64_t get_max_clearance() const;
31 
32 private:
33  std::array<uint64_t, static_cast<size_t>(PatchType::N_TYPES) * static_cast<size_t>(PatchType::N_TYPES)> clearances;
34 };
35 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: ipool.hpp:14
Definition: rule_clearance_copper.hpp:7
Definition: rule.hpp:34
Definition: rule_match.hpp:8
Definition: rule.hpp:54
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
a class to store JSON values
Definition: json.hpp:177
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108