62 explicit Gate(
bool enableBitwiseProperties);
71 bool enableBitwiseProperties);
82 static constexpr std::string_view
Type =
"AndGate";
86 return {
"AND Gate",
"Outputs HIGH only when every input is HIGH.",
98 static constexpr std::string_view
Type =
"OrGate";
102 return {
"OR Gate",
"Outputs HIGH when at least one input is HIGH.",
117 static constexpr std::string_view
Type =
"NotGate";
132 static constexpr std::string_view
Type =
"NandGate";
136 return {
"NAND Gate",
"Outputs the inverse of an AND operation.",
148 static constexpr std::string_view
Type =
"NorGate";
152 return {
"NOR Gate",
"Outputs the inverse of an OR operation.",
164 static constexpr std::string_view
Type =
"XorGate";
168 return {
"XOR Gate",
"Outputs HIGH when exactly one input is HIGH.",
static constexpr std::string_view Type
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim) override
Executes the component's logic.
std::vector< Bus > inputs
Input buses connected to this component.
void initializeProperties(bool enableBitwiseProperties)
int setSize(int width)
Resizes every input bus and the output bus to the same width.
Gate(const std::vector< Wire_ptr > &inputs, Wire_ptr output)
Constructs a gate with scalar I/O and bitwise properties enabled.
Gate()
Constructs an empty gate instance for factory/serialization usage.
void configureIO(int size, bool bitwise)
std::size_t scalarInputCount
static constexpr std::string_view Type
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim) override
Executes the component's logic.
static constexpr std::string_view Type
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim) override
Executes the component's logic.
static constexpr std::string_view Type
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim) override
Executes the component's logic.
void initializeNotProperties()
static constexpr std::string_view Type
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim) override
Executes the component's logic.
static constexpr std::string_view Type
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim) override
Executes the component's logic.
Executes event-driven simulation of a Circuit.
Mutable module-building interface passed to component serializers.
std::shared_ptr< Wire > Wire_ptr