39 #include <unordered_map>
83 std::vector<std::string> pin_names;
87 std::string x_function;
88 std::string z_function;
99 std::vector<std::string> pin_names;
100 std::vector<pin_group>
pins;
103 std::unordered_map<u32, std::string> index_to_pin;
109 std::string state1, state2;
110 std::string clocked_on;
111 std::string next_state;
121 std::string state1, state2;
134 std::string data_category;
135 std::string data_identifier;
136 std::string data_direction;
143 std::set<GateTypeProperty> properties;
144 std::optional<ff_group>
ff;
145 std::optional<latch_group>
latch;
146 std::optional<lut_group>
lut;
147 std::vector<pin_group>
pins;
148 std::map<std::string, bus_group> buses;
149 std::set<std::string> pin_names;
152 std::unique_ptr<GateLibrary> m_gate_lib;
153 std::stringstream m_fs;
154 std::filesystem::path m_path;
156 TokenStream<std::string> m_token_stream;
157 std::map<std::string, type_group> m_bus_types;
158 std::set<std::string> m_cell_names;
161 Result<std::monostate> parse_tokens();
163 Result<cell_group> parse_cell(TokenStream<std::string>& library_stream);
164 Result<type_group> parse_type(TokenStream<std::string>&
str);
166 Result<pin_group> parse_pg_pin(TokenStream<std::string>&
str, cell_group& cell);
167 Result<bus_group> parse_bus(TokenStream<std::string>&
str, cell_group& cell);
168 Result<ff_group> parse_ff(TokenStream<std::string>&
str);
169 Result<latch_group> parse_latch(TokenStream<std::string>&
str);
170 Result<std::monostate> construct_gate_type(cell_group&& cell);
172 void remove_comments(std::string& line,
bool& multi_line_comment);
173 std::vector<std::string> tokenize_function(
const std::string&
function);
174 std::map<std::string, std::string> expand_bus_function(
const std::map<std::string, bus_group>& buses,
const std::vector<std::string>& pin_names,
const std::string&
function);
175 std::string prepare_pin_function(
const std::map<std::string, bus_group>& buses,
const std::string&
function);
176 Result<std::unordered_map<std::string, BooleanFunction>> construct_bus_functions(
const cell_group& cell);
std::unique_ptr< GateLibrary > parse(std::filesystem::path file_path)
std::vector< PinInformation > pins