39 #include <unordered_map>
93 std::vector<std::string> pin_names;
97 std::string x_function;
98 std::string z_function;
112 std::vector<std::string> pin_names;
113 std::vector<pin_group>
pins;
116 std::unordered_map<u32, std::string> index_to_pin;
125 std::string state1, state2;
126 std::string clocked_on;
127 std::string next_state;
140 std::string state1, state2;
156 std::string data_category;
157 std::string data_identifier;
158 std::string data_direction;
168 std::set<GateTypeProperty> properties;
169 std::optional<ff_group>
ff;
170 std::optional<latch_group>
latch;
171 std::optional<lut_group>
lut;
172 std::vector<pin_group>
pins;
173 std::map<std::string, bus_group> buses;
174 std::set<std::string> pin_names;
177 std::unique_ptr<GateLibrary> m_gate_lib;
178 std::stringstream m_fs;
179 std::filesystem::path m_path;
181 TokenStream<std::string> m_token_stream;
182 std::map<std::string, type_group> m_bus_types;
183 std::set<std::string> m_cell_names;
186 Result<std::monostate> parse_tokens();
188 Result<cell_group> parse_cell(TokenStream<std::string>& library_stream);
189 Result<type_group> parse_type(TokenStream<std::string>& str);
191 Result<pin_group> parse_pg_pin(TokenStream<std::string>& str, cell_group& cell);
192 Result<bus_group> parse_bus(TokenStream<std::string>& str, cell_group& cell);
193 Result<ff_group> parse_ff(TokenStream<std::string>& str);
194 Result<latch_group> parse_latch(TokenStream<std::string>& str);
195 Result<std::monostate> construct_gate_type(cell_group&& cell);
197 void remove_comments(std::string& line,
bool& multi_line_comment);
198 std::vector<std::string> tokenize_function(
const std::string&
function);
199 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);
200 std::string prepare_pin_function(
const std::map<std::string, bus_group>& buses,
const std::string&
function);
201 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