-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsky130_carry1.h
More file actions
96 lines (81 loc) · 2.81 KB
/
Copy pathsky130_carry1.h
File metadata and controls
96 lines (81 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef ATOMS_SKY130_CARRY1_H_
#define ATOMS_SKY130_CARRY1_H_
#include <string>
#include <vector>
#include "../circuit.h"
#include "../geometry/instance.h"
#include "../geometry/point.h"
#include "../layout.h"
#include "../memory_bank.h"
#include "../routing/routing_grid.h"
#include "../cell.h"
#include "proto/parameters/sky130_carry1.pb.h"
#include "atom.h"
#include "sky130_parameters.h"
namespace bfg {
class DesignDatabase;
namespace routing {
class RouteManager;
} // namespace routing
namespace atoms {
// Sky130Carry1 forms 1 bit of the carry chain:
//
//
// +-----+
// P --------+----| XOR |---- S
// +---|----| |
// C_I ----+ | +-----+
// | |
// +-------+ +---------|---|--------------- CONFIG_OUT
// CONFIG_IN -| FF | | | |
// | |---+ | |\
// CONFIG_CLK -|> | | +--| |-------------- C_O
// +-------+ | +------| |
// | | |/ 2:1 MUX
// |\ |
// G_0 -| |----+ (i_0)
// G_1 -| |
// |/ 2:1 MUX
//
// Inputs:
// C_I, carry in, typically from a prior Sky130Carry1 bit
// P, propagate, typically from a LUT
// G_0, generate, typically from another LUT
// G_1, generate, typically from a bypass input
// CONFIG_IN, scan-chain config in
// CONFIG_CLK, scan-chain clock
//
// Outputs:
// S, the sum output
// C_O, carry out
// CONFIG_OUT, scan-chain config out
//
class Sky130Carry1 : public Atom {
public:
struct Parameters : public Sky130Parameters {
bool reverse_order = false;
void ToProto(proto::parameters::Sky130Carry1 *pb) const;
void FromProto(const proto::parameters::Sky130Carry1 &pb);
};
Sky130Carry1(
const Parameters ¶meters, DesignDatabase *design_db)
: Atom(design_db),
parameters_(parameters) {
}
geometry::Instance *AddConfigMemory(RowGuide *row) const;
geometry::Instance *AddGenerateSelectMux(RowGuide *row) const;
geometry::Instance *AddSumXor(RowGuide *row) const;
geometry::Instance *AddCarrySelectMux(RowGuide *row) const;
Cell *Generate() override;
private:
void GenerateCircuit(const std::vector<geometry::Instance*> &taps,
geometry::Instance *config_memory,
geometry::Instance *generate_select,
geometry::Instance *carry_select,
geometry::Instance *sum_xor,
bfg::Circuit *circuit) const;
Parameters parameters_;
};
} // namespace atoms
} // namespace bfg
#endif // ATOMS_SKY130_CARRY1_H_