Skip to content

Instantly share code, notes, and snippets.

@duck2
Created July 22, 2019 00:38
Show Gist options
  • Save duck2/4bd31bc9ada090592d1e0793b9a973e8 to your computer and use it in GitHub Desktop.
Save duck2/4bd31bc9ada090592d1e0793b9a973e8 to your computer and use it in GitHub Desktop.
#include <bitset>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include <error.h>
#include <stddef.h>
#include <stdint.h>
#include "pugixml.hpp"
/* All uxsdcxx functions and structs live in this namespace. */
namespace arch {
typedef const uint32_t __attribute__((aligned(1))) triehash_uu32;
typedef const uint64_t __attribute__((aligned(1))) triehash_uu64;
static_assert(alignof(triehash_uu32) == 1, "Unaligned 32-bit access not found.");
static_assert(alignof(triehash_uu64) == 1, "Unaligned 64-bit access not found.");
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define onechar(c, s, l) (((uint64_t)(c)) << (s))
#else
#define onechar(c, s, l) (((uint64_t)(c)) << (l-8-s))
#endif
struct t_meta;
struct t_port;
struct t_fill;
struct t_perimeter;
struct t_corners;
struct t_col;
struct t_row;
struct t_region;
struct t_chan_dist;
struct t_pb_type_clock;
struct t_delay_matrix;
struct t_T_timing_minmax;
struct t_T_timing;
struct t_T_clock_timing;
struct t_pack_pattern;
struct t_power_dynamic_power;
struct t_power_static_power;
struct t_power_port;
struct t_power_local_interconnect;
struct t_power_buffers;
struct t_power_ff_size;
struct t_power_LUT_transistor_size;
struct t_power_mux_transistor_size;
struct t_loc;
struct t_sb_loc;
struct t_map;
struct t_segment_block;
struct t_segment_mux;
struct t_segment_wire_switch;
struct t_direct;
struct t_switchblock_location;
struct t_wireconn_connection;
struct t_clock;
struct t_sizing;
struct t_connection_block;
struct t_area;
struct t_switch_block;
struct t_default_fc;
struct t_Tdel;
struct t_fc_override;
struct t_func;
struct t_metadata;
struct t_port_list;
struct t_chan_width_distr;
struct t_switch;
struct t_power;
struct t_global_power;
struct t_pinlocations;
struct t_switchblock_locations;
struct t_fc;
struct t_tile_mode;
struct t_segment;
struct t_directlist;
struct t_switchblock_func;
struct t_wireconn;
struct t_clocks;
struct t_model_type;
struct t_single;
struct t_device;
struct t_switchlist;
struct t_pb_type_input;
struct t_pb_type_output;
struct t_interconnect_type;
struct t_equivalent_tiles;
struct t_segmentlist;
struct t_switchblock;
struct t_models;
struct t_layout_info;
struct t_auto_layout;
struct t_fixed_layout;
struct t_interconnect;
struct t_tile;
struct t_switchblocklist;
struct t_layout;
struct t_mode;
struct t_tiles;
struct t_pb_type;
struct t_complexblocklist;
struct t_architecture;
struct union_buf_size;
struct union_segment_length;
enum class enum_chan_distribution {UXSD_INVALID = 0, GAUSSIAN, UNIFORM, PULSE, DELTA};
enum class enum_switch_block_type {UXSD_INVALID = 0, WILTON, SUBSET, UNIVERSAL, CUSTOM};
enum class enum_fc_type_enum {UXSD_INVALID = 0, FRAC, ABS};
enum class enum_buf_size {UXSD_INVALID = 0, AUTO};
enum class enum_switch_type {UXSD_INVALID = 0, MUX, TRISTATE, PASS_GATE, SHORT, BUFFER};
enum class enum_pb_input_equivalent {UXSD_INVALID = 0, NONE, FULL, INSTANCE};
enum class enum_pb_output_equivalent {UXSD_INVALID = 0, NONE, FULL};
enum class enum_pb_clock_equivalent {UXSD_INVALID = 0, NONE, FULL, INSTANCE};
enum class enum_delay_matrix_type {UXSD_INVALID = 0, MIN, MAX};
enum class enum_power_estimation_method {UXSD_INVALID = 0, SPECIFY_SIZE, AUTO_SIZE, PIN_TOGGLE, C_INTERNAL, ABSOLUTE, IGNORE, SUM_OF_CHILDREN};
enum class enum_loc_side {UXSD_INVALID = 0, LEFT, RIGHT, BOTTOM, TOP};
enum class enum_pinlocations_pattern {UXSD_INVALID = 0, SPREAD, SPREAD_INPUTS_PERIMETER_OUTPUTS, PERIMETER, CUSTOM};
enum class enum_sb_loc_type {UXSD_INVALID = 0, FULL, STRAIGHT, TURNS, NONE};
enum class enum_switchblock_locations_pattern {UXSD_INVALID = 0, EXTERNAL_FULL_INTERNAL_STRAIGHT, ALL, EXTERNAL, INTERNAL, NONE, CUSTOM};
enum class enum_pb_type_class {UXSD_INVALID = 0, LUT, FLIPFLOP, MEMORY};
enum class enum_segment_length {UXSD_INVALID = 0, LONGLINE};
enum class enum_segment_type {UXSD_INVALID = 0, BIDIR, UNIDIR};
enum class enum_switchblock_location_type {UXSD_INVALID = 0, EVERYWHERE, PERIMETER, CORNER, FRINGE, CORE};
enum class enum_func_type {UXSD_INVALID = 0, LT, LR, LB, TR, TB, TL, RB, RL, RT, BL, BT, BR};
enum class enum_switchblock_type {UXSD_INVALID = 0, BIDIR, UNIDIR};
enum class type_tag {DOUBLE, ENUM_SEGMENT_LENGTH, ENUM_BUF_SIZE, UNSIGNED_INT};
struct union_buf_size {
type_tag tag;
union {
enum_buf_size as_enum_buf_size;
double as_double;
};
};
struct union_segment_length {
type_tag tag;
union {
enum_segment_length as_enum_segment_length;
unsigned int as_unsigned_int;
};
};
struct t_meta {
const char * name;
int x_offset;
int xoffset;
int y_offset;
int yoffset;
const char * value;
};
struct t_port {
const char * clock;
const char * combinational_sink_ports;
bool is_clock;
const char * name;
};
struct t_fill {
int priority;
const char * type;
};
struct t_perimeter {
int priority;
const char * type;
};
struct t_corners {
int priority;
const char * type;
};
struct t_col {
const char * incry;
int priority;
const char * repeatx;
const char * startx;
const char * starty;
const char * type;
};
struct t_row {
const char * incrx;
int priority;
const char * repeaty;
const char * startx;
const char * starty;
const char * type;
};
struct t_region {
const char * endx;
const char * endy;
const char * incrx;
const char * incry;
int priority;
const char * repeatx;
const char * repeaty;
const char * startx;
const char * starty;
const char * type;
};
struct t_chan_dist {
double dc;
enum_chan_distribution distr;
double peak;
double width;
double xpeak;
};
struct t_pb_type_clock {
enum_pb_clock_equivalent equivalent;
const char * name;
int num_pins;
const char * port_class;
};
struct t_delay_matrix {
const char * in_port;
const char * out_port;
enum_delay_matrix_type type;
const char * value;
};
struct t_T_timing_minmax {
const char * in_port;
double max;
double min;
const char * out_port;
};
struct t_T_timing {
const char * clock;
const char * port;
double value;
};
struct t_T_clock_timing {
const char * clock;
double max;
double min;
const char * port;
};
struct t_pack_pattern {
const char * in_port;
const char * name;
const char * out_port;
};
struct t_power_dynamic_power {
double C_internal;
double power_per_instance;
};
struct t_power_static_power {
double power_per_instance;
};
struct t_power_port {
double energy_per_toggle;
const char * name;
const char * scaled_by_static_prob;
const char * scaled_by_static_prob_n;
};
struct t_power_local_interconnect {
double C_wire;
double factor;
};
struct t_power_buffers {
double logical_effort_factor;
};
struct t_power_ff_size {
double FF_size;
};
struct t_power_LUT_transistor_size {
double LUT_transistor_size;
};
struct t_power_mux_transistor_size {
double mux_transistor_size;
};
struct t_loc {
enum_loc_side side;
int xoffset;
int yoffset;
const char * value;
};
struct t_sb_loc {
const char * switch_override;
enum_sb_loc_type type;
int xoffset;
int yoffset;
};
struct t_map {
const char * from;
const char * num_pins;
const char * to;
};
struct t_segment_block {
const char * type;
const char * value;
};
struct t_segment_mux {
const char * name;
};
struct t_segment_wire_switch {
const char * name;
};
struct t_direct {
const char * from_pin;
const char * name;
const char * switch_name;
const char * to_pin;
int x_offset;
int y_offset;
int z_offset;
};
struct t_switchblock_location {
enum_switchblock_location_type type;
};
struct t_wireconn_connection {
const char * switchpoint;
const char * type;
};
struct t_clock {
double C_wire;
double C_wire_per_m;
union_buf_size buffer_size;
};
struct t_sizing {
double R_minW_nmos;
double R_minW_pmos;
};
struct t_connection_block {
const char * input_switch_name;
};
struct t_area {
double grid_logic_tile_area;
};
struct t_switch_block {
int fs;
enum_switch_block_type type;
};
struct t_default_fc {
enum_fc_type_enum in_type;
double in_val;
enum_fc_type_enum out_type;
double out_val;
};
struct t_Tdel {
double delay;
int num_inputs;
};
struct t_fc_override {
enum_fc_type_enum fc_type;
double fc_val;
const char * port_name;
const char * segment_name;
};
struct t_func {
const char * formula;
enum_func_type type;
};
struct t_metadata {
int num_meta;
t_meta * meta_list;
};
struct t_port_list {
int num_port;
t_port * port_list;
};
struct t_chan_width_distr {
int num_x;
t_chan_dist * x_list;
int num_y;
t_chan_dist * y_list;
};
struct t_switch {
double Cin;
double Cinternal;
double Cout;
double R;
double Tdel;
union_buf_size buf_size;
double mux_trans_size;
const char * name;
double power_buf_size;
enum_switch_type type;
int num_Tdel;
t_Tdel * Tdel_list;
};
struct t_power {
enum_power_estimation_method method;
int num_dynamic_power;
t_power_dynamic_power * dynamic_power_list;
int num_static_power;
t_power_static_power * static_power_list;
int num_port;
t_power_port * port_list;
};
struct t_global_power {
enum_power_estimation_method method;
int num_local_interconnect;
t_power_local_interconnect * local_interconnect_list;
int num_buffers;
t_power_buffers * buffers_list;
int num_mux_transistor_size;
t_power_mux_transistor_size * mux_transistor_size_list;
int num_FF_size;
t_power_ff_size * FF_size_list;
int num_LUT_transistor_size;
t_power_LUT_transistor_size * LUT_transistor_size_list;
};
struct t_pinlocations {
enum_pinlocations_pattern pattern;
int num_loc;
t_loc * loc_list;
};
struct t_switchblock_locations {
const char * internal_switch;
enum_switchblock_locations_pattern pattern;
int num_sb_loc;
t_sb_loc * sb_loc_list;
};
struct t_fc {
enum_fc_type_enum in_type;
double in_val;
enum_fc_type_enum out_type;
double out_val;
int num_fc_override;
t_fc_override * fc_override_list;
};
struct t_tile_mode {
const char * name;
int num_map;
t_map * map_list;
};
struct t_segment {
double Cmetal;
double Rmetal;
double freq;
union_segment_length length;
const char * name;
enum_segment_type type;
int num_sb;
t_segment_block * sb_list;
int num_cb;
t_segment_block * cb_list;
int num_mux;
t_segment_mux * mux_list;
int num_wire_switch;
t_segment_wire_switch * wire_switch_list;
int num_opin_switch;
t_segment_wire_switch * opin_switch_list;
};
struct t_directlist {
int num_direct;
t_direct * direct_list;
};
struct t_switchblock_func {
int num_func;
t_func * func_list;
};
struct t_wireconn {
const char * from_switchpoint;
const char * from_type;
const char * num_conns_type;
const char * to_switchpoint;
const char * to_type;
int num_from;
t_wireconn_connection * from_list;
int num_to;
t_wireconn_connection * to_list;
};
struct t_clocks {
int num_clock;
t_clock * clock_list;
};
struct t_model_type {
const char * name;
int num_input_ports;
t_port_list * input_ports_list;
int num_output_ports;
t_port_list * output_ports_list;
};
struct t_single {
int priority;
const char * type;
const char * x;
const char * y;
int num_metadata;
t_metadata * metadata_list;
};
struct t_device {
t_sizing sizing;
t_connection_block connection_block;
t_area area;
t_switch_block switch_block;
t_chan_width_distr chan_width_distr;
t_default_fc default_fc;
};
struct t_switchlist {
int num_switch;
t_switch * switch_list;
};
struct t_pb_type_input {
enum_pb_input_equivalent equivalent;
bool is_non_clock_global;
const char * name;
int num_pins;
const char * port_class;
t_metadata metadata;
};
struct t_pb_type_output {
enum_pb_output_equivalent equivalent;
const char * name;
int num_pins;
const char * port_class;
t_metadata metadata;
};
struct t_interconnect_type {
const char * input;
const char * name;
const char * output;
int num_pack_pattern;
t_pack_pattern * pack_pattern_list;
int num_delay_constant;
t_T_timing_minmax * delay_constant_list;
int num_delay_matrix;
t_delay_matrix * delay_matrix_list;
int num_metadata;
t_metadata * metadata_list;
};
struct t_equivalent_tiles {
int num_mode;
t_tile_mode * mode_list;
};
struct t_segmentlist {
int num_segment;
t_segment * segment_list;
};
struct t_switchblock {
const char * name;
enum_switchblock_type type;
int num_switchblock_location;
t_switchblock_location * switchblock_location_list;
int num_switchfuncs;
t_switchblock_func * switchfuncs_list;
int num_wireconn;
t_wireconn * wireconn_list;
};
struct t_models {
int num_model;
t_model_type * model_list;
};
struct t_layout_info {
int num_fill;
t_fill * fill_list;
int num_perimeter;
t_perimeter * perimeter_list;
int num_corners;
t_corners * corners_list;
int num_single;
t_single * single_list;
int num_col;
t_col * col_list;
int num_row;
t_row * row_list;
int num_region;
t_region * region_list;
};
struct t_auto_layout {
double aspect_ratio;
int num_fill;
t_fill * fill_list;
int num_perimeter;
t_perimeter * perimeter_list;
int num_corners;
t_corners * corners_list;
int num_single;
t_single * single_list;
int num_col;
t_col * col_list;
int num_row;
t_row * row_list;
int num_region;
t_region * region_list;
};
struct t_fixed_layout {
int height;
const char * name;
int width;
int num_fill;
t_fill * fill_list;
int num_perimeter;
t_perimeter * perimeter_list;
int num_corners;
t_corners * corners_list;
int num_single;
t_single * single_list;
int num_col;
t_col * col_list;
int num_row;
t_row * row_list;
int num_region;
t_region * region_list;
};
struct t_interconnect {
int num_complete;
t_interconnect_type * complete_list;
int num_direct;
t_interconnect_type * direct_list;
int num_mux;
t_interconnect_type * mux_list;
};
struct t_tile {
const char * name;
int num_equivalent_tiles;
t_equivalent_tiles * equivalent_tiles_list;
int num_pinlocations;
t_pinlocations * pinlocations_list;
int num_fc;
t_fc * fc_list;
int num_switchblock_locations;
t_switchblock_locations * switchblock_locations_list;
};
struct t_switchblocklist {
int num_switchblock;
t_switchblock * switchblock_list;
};
struct t_layout {
t_auto_layout auto_layout;
int num_fixed_layout;
t_fixed_layout * fixed_layout_list;
int num_device_layout;
t_fixed_layout * device_layout_list;
};
struct t_mode {
const char * name;
int num_pb_type;
t_pb_type * pb_type_list;
int num_interconnect;
t_interconnect * interconnect_list;
int num_pinlocations;
t_pinlocations * pinlocations_list;
int num_switchblock_locations;
t_switchblock_locations * switchblock_locations_list;
int num_metadata;
t_metadata * metadata_list;
};
struct t_tiles {
int num_tile;
t_tile * tile_list;
};
struct t_pb_type {
double area;
const char * blif_model;
int capacity;
enum_pb_type_class class_;
int height;
const char * name;
int num_pb;
int width;
int num_pb_type;
t_pb_type * pb_type_list;
int num_input;
t_pb_type_input * input_list;
int num_output;
t_pb_type_output * output_list;
int num_clock;
t_pb_type_clock * clock_list;
int num_metadata;
t_metadata * metadata_list;
int num_mode;
t_mode * mode_list;
int num_interconnect;
t_interconnect * interconnect_list;
int num_pinlocations;
t_pinlocations * pinlocations_list;
int num_switchblock_locations;
t_switchblock_locations * switchblock_locations_list;
int num_fc;
t_fc * fc_list;
int num_delay_constant;
t_T_timing_minmax * delay_constant_list;
int num_delay_matrix;
t_delay_matrix * delay_matrix_list;
int num_T_setup;
t_T_timing * T_setup_list;
int num_T_hold;
t_T_timing * T_hold_list;
int num_T_clock_to_Q;
t_T_clock_timing * T_clock_to_Q_list;
int num_power;
t_power * power_list;
};
struct t_complexblocklist {
int num_pb_type;
t_pb_type * pb_type_list;
};
struct t_architecture {
int num_models;
t_models * models_list;
int num_layout;
t_layout * layout_list;
int num_device;
t_device * device_list;
int num_switchlist;
t_switchlist * switchlist_list;
int num_switchblocklist;
t_switchblocklist * switchblocklist_list;
int num_segmentlist;
t_segmentlist * segmentlist_list;
int num_power;
t_global_power * power_list;
int num_clocks;
t_clocks * clocks_list;
int num_directlist;
t_directlist * directlist_list;
int num_tiles;
t_tiles * tiles_list;
int num_complexblocklist;
t_complexblocklist * complexblocklist_list;
};
int g_num_T_clock_timing = 0;
t_T_clock_timing *T_clock_timing_arena;
int g_num_T_timing = 0;
t_T_timing *T_timing_arena;
int g_num_T_timing_minmax = 0;
t_T_timing_minmax *T_timing_minmax_arena;
int g_num_Tdel = 0;
t_Tdel *Tdel_arena;
int g_num_chan_dist = 0;
t_chan_dist *chan_dist_arena;
int g_num_clock = 0;
t_clock *clock_arena;
int g_num_clocks = 0;
t_clocks *clocks_arena;
int g_num_col = 0;
t_col *col_arena;
int g_num_complexblocklist = 0;
t_complexblocklist *complexblocklist_arena;
int g_num_corners = 0;
t_corners *corners_arena;
int g_num_delay_matrix = 0;
t_delay_matrix *delay_matrix_arena;
int g_num_device = 0;
t_device *device_arena;
int g_num_direct = 0;
t_direct *direct_arena;
int g_num_directlist = 0;
t_directlist *directlist_arena;
int g_num_equivalent_tiles = 0;
t_equivalent_tiles *equivalent_tiles_arena;
int g_num_fc = 0;
t_fc *fc_arena;
int g_num_fc_override = 0;
t_fc_override *fc_override_arena;
int g_num_fill = 0;
t_fill *fill_arena;
int g_num_fixed_layout = 0;
t_fixed_layout *fixed_layout_arena;
int g_num_func = 0;
t_func *func_arena;
int g_num_global_power = 0;
t_global_power *global_power_arena;
int g_num_interconnect = 0;
t_interconnect *interconnect_arena;
int g_num_interconnect_type = 0;
t_interconnect_type *interconnect_type_arena;
int g_num_layout = 0;
t_layout *layout_arena;
int g_num_loc = 0;
t_loc *loc_arena;
int g_num_map = 0;
t_map *map_arena;
int g_num_meta = 0;
t_meta *meta_arena;
int g_num_metadata = 0;
t_metadata *metadata_arena;
int g_num_mode = 0;
t_mode *mode_arena;
int g_num_model_type = 0;
t_model_type *model_type_arena;
int g_num_models = 0;
t_models *models_arena;
int g_num_pack_pattern = 0;
t_pack_pattern *pack_pattern_arena;
int g_num_pb_type = 0;
t_pb_type *pb_type_arena;
int g_num_pb_type_clock = 0;
t_pb_type_clock *pb_type_clock_arena;
int g_num_pb_type_input = 0;
t_pb_type_input *pb_type_input_arena;
int g_num_pb_type_output = 0;
t_pb_type_output *pb_type_output_arena;
int g_num_perimeter = 0;
t_perimeter *perimeter_arena;
int g_num_pinlocations = 0;
t_pinlocations *pinlocations_arena;
int g_num_port = 0;
t_port *port_arena;
int g_num_port_list = 0;
t_port_list *port_list_arena;
int g_num_power = 0;
t_power *power_arena;
int g_num_power_LUT_transistor_size = 0;
t_power_LUT_transistor_size *power_LUT_transistor_size_arena;
int g_num_power_buffers = 0;
t_power_buffers *power_buffers_arena;
int g_num_power_dynamic_power = 0;
t_power_dynamic_power *power_dynamic_power_arena;
int g_num_power_ff_size = 0;
t_power_ff_size *power_ff_size_arena;
int g_num_power_local_interconnect = 0;
t_power_local_interconnect *power_local_interconnect_arena;
int g_num_power_mux_transistor_size = 0;
t_power_mux_transistor_size *power_mux_transistor_size_arena;
int g_num_power_port = 0;
t_power_port *power_port_arena;
int g_num_power_static_power = 0;
t_power_static_power *power_static_power_arena;
int g_num_region = 0;
t_region *region_arena;
int g_num_row = 0;
t_row *row_arena;
int g_num_sb_loc = 0;
t_sb_loc *sb_loc_arena;
int g_num_segment = 0;
t_segment *segment_arena;
int g_num_segment_block = 0;
t_segment_block *segment_block_arena;
int g_num_segment_mux = 0;
t_segment_mux *segment_mux_arena;
int g_num_segment_wire_switch = 0;
t_segment_wire_switch *segment_wire_switch_arena;
int g_num_segmentlist = 0;
t_segmentlist *segmentlist_arena;
int g_num_single = 0;
t_single *single_arena;
int g_num_switch = 0;
t_switch *switch_arena;
int g_num_switchblock = 0;
t_switchblock *switchblock_arena;
int g_num_switchblock_func = 0;
t_switchblock_func *switchblock_func_arena;
int g_num_switchblock_location = 0;
t_switchblock_location *switchblock_location_arena;
int g_num_switchblock_locations = 0;
t_switchblock_locations *switchblock_locations_arena;
int g_num_switchblocklist = 0;
t_switchblocklist *switchblocklist_arena;
int g_num_switchlist = 0;
t_switchlist *switchlist_arena;
int g_num_tile = 0;
t_tile *tile_arena;
int g_num_tile_mode = 0;
t_tile_mode *tile_mode_arena;
int g_num_tiles = 0;
t_tiles *tiles_arena;
int g_num_wireconn = 0;
t_wireconn *wireconn_arena;
int g_num_wireconn_connection = 0;
t_wireconn_connection *wireconn_connection_arena;
void count_meta(const pugi::xml_node &root);
void count_port(const pugi::xml_node &root);
void count_fill(const pugi::xml_node &root);
void count_perimeter(const pugi::xml_node &root);
void count_corners(const pugi::xml_node &root);
void count_col(const pugi::xml_node &root);
void count_row(const pugi::xml_node &root);
void count_region(const pugi::xml_node &root);
void count_chan_dist(const pugi::xml_node &root);
void count_pb_type_clock(const pugi::xml_node &root);
void count_delay_matrix(const pugi::xml_node &root);
void count_T_timing_minmax(const pugi::xml_node &root);
void count_T_timing(const pugi::xml_node &root);
void count_T_clock_timing(const pugi::xml_node &root);
void count_pack_pattern(const pugi::xml_node &root);
void count_power_dynamic_power(const pugi::xml_node &root);
void count_power_static_power(const pugi::xml_node &root);
void count_power_port(const pugi::xml_node &root);
void count_power_local_interconnect(const pugi::xml_node &root);
void count_power_buffers(const pugi::xml_node &root);
void count_power_ff_size(const pugi::xml_node &root);
void count_power_LUT_transistor_size(const pugi::xml_node &root);
void count_power_mux_transistor_size(const pugi::xml_node &root);
void count_loc(const pugi::xml_node &root);
void count_sb_loc(const pugi::xml_node &root);
void count_map(const pugi::xml_node &root);
void count_segment_block(const pugi::xml_node &root);
void count_segment_mux(const pugi::xml_node &root);
void count_segment_wire_switch(const pugi::xml_node &root);
void count_direct(const pugi::xml_node &root);
void count_switchblock_location(const pugi::xml_node &root);
void count_wireconn_connection(const pugi::xml_node &root);
void count_clock(const pugi::xml_node &root);
void count_sizing(const pugi::xml_node &root);
void count_connection_block(const pugi::xml_node &root);
void count_area(const pugi::xml_node &root);
void count_switch_block(const pugi::xml_node &root);
void count_default_fc(const pugi::xml_node &root);
void count_Tdel(const pugi::xml_node &root);
void count_fc_override(const pugi::xml_node &root);
void count_func(const pugi::xml_node &root);
void count_metadata(const pugi::xml_node &root);
void count_port_list(const pugi::xml_node &root);
void count_chan_width_distr(const pugi::xml_node &root);
void count_switch(const pugi::xml_node &root);
void count_power(const pugi::xml_node &root);
void count_global_power(const pugi::xml_node &root);
void count_pinlocations(const pugi::xml_node &root);
void count_switchblock_locations(const pugi::xml_node &root);
void count_fc(const pugi::xml_node &root);
void count_tile_mode(const pugi::xml_node &root);
void count_segment(const pugi::xml_node &root);
void count_directlist(const pugi::xml_node &root);
void count_switchblock_func(const pugi::xml_node &root);
void count_wireconn(const pugi::xml_node &root);
void count_clocks(const pugi::xml_node &root);
void count_model_type(const pugi::xml_node &root);
void count_single(const pugi::xml_node &root);
void count_device(const pugi::xml_node &root);
void count_switchlist(const pugi::xml_node &root);
void count_pb_type_input(const pugi::xml_node &root);
void count_pb_type_output(const pugi::xml_node &root);
void count_interconnect_type(const pugi::xml_node &root);
void count_equivalent_tiles(const pugi::xml_node &root);
void count_segmentlist(const pugi::xml_node &root);
void count_switchblock(const pugi::xml_node &root);
void count_models(const pugi::xml_node &root);
void count_layout_info(const pugi::xml_node &root);
void count_auto_layout(const pugi::xml_node &root);
void count_fixed_layout(const pugi::xml_node &root);
void count_interconnect(const pugi::xml_node &root);
void count_tile(const pugi::xml_node &root);
void count_switchblocklist(const pugi::xml_node &root);
void count_layout(const pugi::xml_node &root);
void count_mode(const pugi::xml_node &root);
void count_tiles(const pugi::xml_node &root);
void count_pb_type(const pugi::xml_node &root);
void count_complexblocklist(const pugi::xml_node &root);
void count_architecture(const pugi::xml_node &root);
void load_meta(const pugi::xml_node &root, t_meta *out);
void load_port(const pugi::xml_node &root, t_port *out);
void load_fill(const pugi::xml_node &root, t_fill *out);
void load_perimeter(const pugi::xml_node &root, t_perimeter *out);
void load_corners(const pugi::xml_node &root, t_corners *out);
void load_col(const pugi::xml_node &root, t_col *out);
void load_row(const pugi::xml_node &root, t_row *out);
void load_region(const pugi::xml_node &root, t_region *out);
void load_chan_dist(const pugi::xml_node &root, t_chan_dist *out);
void load_pb_type_clock(const pugi::xml_node &root, t_pb_type_clock *out);
void load_delay_matrix(const pugi::xml_node &root, t_delay_matrix *out);
void load_T_timing_minmax(const pugi::xml_node &root, t_T_timing_minmax *out);
void load_T_timing(const pugi::xml_node &root, t_T_timing *out);
void load_T_clock_timing(const pugi::xml_node &root, t_T_clock_timing *out);
void load_pack_pattern(const pugi::xml_node &root, t_pack_pattern *out);
void load_power_dynamic_power(const pugi::xml_node &root, t_power_dynamic_power *out);
void load_power_static_power(const pugi::xml_node &root, t_power_static_power *out);
void load_power_port(const pugi::xml_node &root, t_power_port *out);
void load_power_local_interconnect(const pugi::xml_node &root, t_power_local_interconnect *out);
void load_power_buffers(const pugi::xml_node &root, t_power_buffers *out);
void load_power_ff_size(const pugi::xml_node &root, t_power_ff_size *out);
void load_power_LUT_transistor_size(const pugi::xml_node &root, t_power_LUT_transistor_size *out);
void load_power_mux_transistor_size(const pugi::xml_node &root, t_power_mux_transistor_size *out);
void load_loc(const pugi::xml_node &root, t_loc *out);
void load_sb_loc(const pugi::xml_node &root, t_sb_loc *out);
void load_map(const pugi::xml_node &root, t_map *out);
void load_segment_block(const pugi::xml_node &root, t_segment_block *out);
void load_segment_mux(const pugi::xml_node &root, t_segment_mux *out);
void load_segment_wire_switch(const pugi::xml_node &root, t_segment_wire_switch *out);
void load_direct(const pugi::xml_node &root, t_direct *out);
void load_switchblock_location(const pugi::xml_node &root, t_switchblock_location *out);
void load_wireconn_connection(const pugi::xml_node &root, t_wireconn_connection *out);
void load_clock(const pugi::xml_node &root, t_clock *out);
void load_sizing(const pugi::xml_node &root, t_sizing *out);
void load_connection_block(const pugi::xml_node &root, t_connection_block *out);
void load_area(const pugi::xml_node &root, t_area *out);
void load_switch_block(const pugi::xml_node &root, t_switch_block *out);
void load_default_fc(const pugi::xml_node &root, t_default_fc *out);
void load_Tdel(const pugi::xml_node &root, t_Tdel *out);
void load_fc_override(const pugi::xml_node &root, t_fc_override *out);
void load_func(const pugi::xml_node &root, t_func *out);
void load_metadata(const pugi::xml_node &root, t_metadata *out);
void load_port_list(const pugi::xml_node &root, t_port_list *out);
void load_chan_width_distr(const pugi::xml_node &root, t_chan_width_distr *out);
void load_switch(const pugi::xml_node &root, t_switch *out);
void load_power(const pugi::xml_node &root, t_power *out);
void load_global_power(const pugi::xml_node &root, t_global_power *out);
void load_pinlocations(const pugi::xml_node &root, t_pinlocations *out);
void load_switchblock_locations(const pugi::xml_node &root, t_switchblock_locations *out);
void load_fc(const pugi::xml_node &root, t_fc *out);
void load_tile_mode(const pugi::xml_node &root, t_tile_mode *out);
void load_segment(const pugi::xml_node &root, t_segment *out);
void load_directlist(const pugi::xml_node &root, t_directlist *out);
void load_switchblock_func(const pugi::xml_node &root, t_switchblock_func *out);
void load_wireconn(const pugi::xml_node &root, t_wireconn *out);
void load_clocks(const pugi::xml_node &root, t_clocks *out);
void load_model_type(const pugi::xml_node &root, t_model_type *out);
void load_single(const pugi::xml_node &root, t_single *out);
void load_device(const pugi::xml_node &root, t_device *out);
void load_switchlist(const pugi::xml_node &root, t_switchlist *out);
void load_pb_type_input(const pugi::xml_node &root, t_pb_type_input *out);
void load_pb_type_output(const pugi::xml_node &root, t_pb_type_output *out);
void load_interconnect_type(const pugi::xml_node &root, t_interconnect_type *out);
void load_equivalent_tiles(const pugi::xml_node &root, t_equivalent_tiles *out);
void load_segmentlist(const pugi::xml_node &root, t_segmentlist *out);
void load_switchblock(const pugi::xml_node &root, t_switchblock *out);
void load_models(const pugi::xml_node &root, t_models *out);
void load_layout_info(const pugi::xml_node &root, t_layout_info *out);
void load_auto_layout(const pugi::xml_node &root, t_auto_layout *out);
void load_fixed_layout(const pugi::xml_node &root, t_fixed_layout *out);
void load_interconnect(const pugi::xml_node &root, t_interconnect *out);
void load_tile(const pugi::xml_node &root, t_tile *out);
void load_switchblocklist(const pugi::xml_node &root, t_switchblocklist *out);
void load_layout(const pugi::xml_node &root, t_layout *out);
void load_mode(const pugi::xml_node &root, t_mode *out);
void load_tiles(const pugi::xml_node &root, t_tiles *out);
void load_pb_type(const pugi::xml_node &root, t_pb_type *out);
void load_complexblocklist(const pugi::xml_node &root, t_complexblocklist *out);
void load_architecture(const pugi::xml_node &root, t_architecture *out);
void dfa_error(const char *wrong, int *states, const char **lookup, int len);
template<std::size_t N>
void all_error(std::bitset<N> gstate, const char **lookup);
template<std::size_t N>
void attr_error(std::bitset<N> astate, const char **lookup);
void alloc_arenas(void);
void get_root_elements(const char *filename);
/**
* Enums for attribute and node names.
**/
enum class atok_t_meta {NAME, X_OFFSET, XOFFSET, Y_OFFSET, YOFFSET};
const char *atok_lookup_t_meta[] = {"name", "x_offset", "xoffset", "y_offset", "yoffset"};
enum class atok_t_port {CLOCK, COMBINATIONAL_SINK_PORTS, IS_CLOCK, NAME};
const char *atok_lookup_t_port[] = {"clock", "combinational_sink_ports", "is_clock", "name"};
enum class atok_t_fill {PRIORITY, TYPE};
const char *atok_lookup_t_fill[] = {"priority", "type"};
enum class atok_t_perimeter {PRIORITY, TYPE};
const char *atok_lookup_t_perimeter[] = {"priority", "type"};
enum class atok_t_corners {PRIORITY, TYPE};
const char *atok_lookup_t_corners[] = {"priority", "type"};
enum class atok_t_col {INCRY, PRIORITY, REPEATX, STARTX, STARTY, TYPE};
const char *atok_lookup_t_col[] = {"incry", "priority", "repeatx", "startx", "starty", "type"};
enum class atok_t_row {INCRX, PRIORITY, REPEATY, STARTX, STARTY, TYPE};
const char *atok_lookup_t_row[] = {"incrx", "priority", "repeaty", "startx", "starty", "type"};
enum class atok_t_region {ENDX, ENDY, INCRX, INCRY, PRIORITY, REPEATX, REPEATY, STARTX, STARTY, TYPE};
const char *atok_lookup_t_region[] = {"endx", "endy", "incrx", "incry", "priority", "repeatx", "repeaty", "startx", "starty", "type"};
enum class atok_t_chan_dist {DC, DISTR, PEAK, WIDTH, XPEAK};
const char *atok_lookup_t_chan_dist[] = {"dc", "distr", "peak", "width", "xpeak"};
enum class atok_t_pb_type_clock {EQUIVALENT, NAME, NUM_PINS, PORT_CLASS};
const char *atok_lookup_t_pb_type_clock[] = {"equivalent", "name", "num_pins", "port_class"};
enum class atok_t_delay_matrix {IN_PORT, OUT_PORT, TYPE};
const char *atok_lookup_t_delay_matrix[] = {"in_port", "out_port", "type"};
enum class atok_t_T_timing_minmax {IN_PORT, MAX, MIN, OUT_PORT};
const char *atok_lookup_t_T_timing_minmax[] = {"in_port", "max", "min", "out_port"};
enum class atok_t_T_timing {CLOCK, PORT, VALUE};
const char *atok_lookup_t_T_timing[] = {"clock", "port", "value"};
enum class atok_t_T_clock_timing {CLOCK, MAX, MIN, PORT};
const char *atok_lookup_t_T_clock_timing[] = {"clock", "max", "min", "port"};
enum class atok_t_pack_pattern {IN_PORT, NAME, OUT_PORT};
const char *atok_lookup_t_pack_pattern[] = {"in_port", "name", "out_port"};
enum class atok_t_power_dynamic_power {C_INTERNAL, POWER_PER_INSTANCE};
const char *atok_lookup_t_power_dynamic_power[] = {"C_internal", "power_per_instance"};
enum class atok_t_power_static_power {POWER_PER_INSTANCE};
const char *atok_lookup_t_power_static_power[] = {"power_per_instance"};
enum class atok_t_power_port {ENERGY_PER_TOGGLE, NAME, SCALED_BY_STATIC_PROB, SCALED_BY_STATIC_PROB_N};
const char *atok_lookup_t_power_port[] = {"energy_per_toggle", "name", "scaled_by_static_prob", "scaled_by_static_prob_n"};
enum class atok_t_power_local_interconnect {C_WIRE, FACTOR};
const char *atok_lookup_t_power_local_interconnect[] = {"C_wire", "factor"};
enum class atok_t_power_buffers {LOGICAL_EFFORT_FACTOR};
const char *atok_lookup_t_power_buffers[] = {"logical_effort_factor"};
enum class atok_t_power_ff_size {FF_SIZE};
const char *atok_lookup_t_power_ff_size[] = {"FF_size"};
enum class atok_t_power_LUT_transistor_size {LUT_TRANSISTOR_SIZE};
const char *atok_lookup_t_power_LUT_transistor_size[] = {"LUT_transistor_size"};
enum class atok_t_power_mux_transistor_size {MUX_TRANSISTOR_SIZE};
const char *atok_lookup_t_power_mux_transistor_size[] = {"mux_transistor_size"};
enum class atok_t_loc {SIDE, XOFFSET, YOFFSET};
const char *atok_lookup_t_loc[] = {"side", "xoffset", "yoffset"};
enum class atok_t_sb_loc {SWITCH_OVERRIDE, TYPE, XOFFSET, YOFFSET};
const char *atok_lookup_t_sb_loc[] = {"switch_override", "type", "xoffset", "yoffset"};
enum class atok_t_map {FROM, NUM_PINS, TO};
const char *atok_lookup_t_map[] = {"from", "num_pins", "to"};
enum class atok_t_segment_block {TYPE};
const char *atok_lookup_t_segment_block[] = {"type"};
enum class atok_t_segment_mux {NAME};
const char *atok_lookup_t_segment_mux[] = {"name"};
enum class atok_t_segment_wire_switch {NAME};
const char *atok_lookup_t_segment_wire_switch[] = {"name"};
enum class atok_t_direct {FROM_PIN, NAME, SWITCH_NAME, TO_PIN, X_OFFSET, Y_OFFSET, Z_OFFSET};
const char *atok_lookup_t_direct[] = {"from_pin", "name", "switch_name", "to_pin", "x_offset", "y_offset", "z_offset"};
enum class atok_t_switchblock_location {TYPE};
const char *atok_lookup_t_switchblock_location[] = {"type"};
enum class atok_t_wireconn_connection {SWITCHPOINT, TYPE};
const char *atok_lookup_t_wireconn_connection[] = {"switchpoint", "type"};
enum class atok_t_clock {C_WIRE, C_WIRE_PER_M, BUFFER_SIZE};
const char *atok_lookup_t_clock[] = {"C_wire", "C_wire_per_m", "buffer_size"};
enum class atok_t_sizing {R_MINW_NMOS, R_MINW_PMOS};
const char *atok_lookup_t_sizing[] = {"R_minW_nmos", "R_minW_pmos"};
enum class atok_t_connection_block {INPUT_SWITCH_NAME};
const char *atok_lookup_t_connection_block[] = {"input_switch_name"};
enum class atok_t_area {GRID_LOGIC_TILE_AREA};
const char *atok_lookup_t_area[] = {"grid_logic_tile_area"};
enum class atok_t_switch_block {FS, TYPE};
const char *atok_lookup_t_switch_block[] = {"fs", "type"};
enum class atok_t_default_fc {IN_TYPE, IN_VAL, OUT_TYPE, OUT_VAL};
const char *atok_lookup_t_default_fc[] = {"in_type", "in_val", "out_type", "out_val"};
enum class atok_t_Tdel {DELAY, NUM_INPUTS};
const char *atok_lookup_t_Tdel[] = {"delay", "num_inputs"};
enum class atok_t_fc_override {FC_TYPE, FC_VAL, PORT_NAME, SEGMENT_NAME};
const char *atok_lookup_t_fc_override[] = {"fc_type", "fc_val", "port_name", "segment_name"};
enum class atok_t_func {FORMULA, TYPE};
const char *atok_lookup_t_func[] = {"formula", "type"};
enum class gtok_t_metadata {META};
const char *gtok_lookup_t_metadata[] = {"meta"};
enum class gtok_t_port_list {PORT};
const char *gtok_lookup_t_port_list[] = {"port"};
enum class gtok_t_chan_width_distr {X, Y};
const char *gtok_lookup_t_chan_width_distr[] = {"x", "y"};
enum class gtok_t_switch {TDEL};
const char *gtok_lookup_t_switch[] = {"Tdel"};
enum class atok_t_switch {CIN, CINTERNAL, COUT, R, TDEL, BUF_SIZE, MUX_TRANS_SIZE, NAME, POWER_BUF_SIZE, TYPE};
const char *atok_lookup_t_switch[] = {"Cin", "Cinternal", "Cout", "R", "Tdel", "buf_size", "mux_trans_size", "name", "power_buf_size", "type"};
enum class gtok_t_power {DYNAMIC_POWER, STATIC_POWER, PORT};
const char *gtok_lookup_t_power[] = {"dynamic_power", "static_power", "port"};
enum class atok_t_power {METHOD};
const char *atok_lookup_t_power[] = {"method"};
enum class gtok_t_global_power {LOCAL_INTERCONNECT, BUFFERS, MUX_TRANSISTOR_SIZE, FF_SIZE, LUT_TRANSISTOR_SIZE};
const char *gtok_lookup_t_global_power[] = {"local_interconnect", "buffers", "mux_transistor_size", "FF_size", "LUT_transistor_size"};
enum class atok_t_global_power {METHOD};
const char *atok_lookup_t_global_power[] = {"method"};
enum class gtok_t_pinlocations {LOC};
const char *gtok_lookup_t_pinlocations[] = {"loc"};
enum class atok_t_pinlocations {PATTERN};
const char *atok_lookup_t_pinlocations[] = {"pattern"};
enum class gtok_t_switchblock_locations {SB_LOC};
const char *gtok_lookup_t_switchblock_locations[] = {"sb_loc"};
enum class atok_t_switchblock_locations {INTERNAL_SWITCH, PATTERN};
const char *atok_lookup_t_switchblock_locations[] = {"internal_switch", "pattern"};
enum class gtok_t_fc {FC_OVERRIDE};
const char *gtok_lookup_t_fc[] = {"fc_override"};
enum class atok_t_fc {IN_TYPE, IN_VAL, OUT_TYPE, OUT_VAL};
const char *atok_lookup_t_fc[] = {"in_type", "in_val", "out_type", "out_val"};
enum class gtok_t_tile_mode {MAP};
const char *gtok_lookup_t_tile_mode[] = {"map"};
enum class atok_t_tile_mode {NAME};
const char *atok_lookup_t_tile_mode[] = {"name"};
enum class gtok_t_segment {SB, CB, MUX, WIRE_SWITCH, OPIN_SWITCH};
const char *gtok_lookup_t_segment[] = {"sb", "cb", "mux", "wire_switch", "opin_switch"};
enum class atok_t_segment {CMETAL, RMETAL, FREQ, LENGTH, NAME, TYPE};
const char *atok_lookup_t_segment[] = {"Cmetal", "Rmetal", "freq", "length", "name", "type"};
enum class gtok_t_directlist {DIRECT};
const char *gtok_lookup_t_directlist[] = {"direct"};
enum class gtok_t_switchblock_func {FUNC};
const char *gtok_lookup_t_switchblock_func[] = {"func"};
enum class gtok_t_wireconn {FROM, TO};
const char *gtok_lookup_t_wireconn[] = {"from", "to"};
enum class atok_t_wireconn {FROM_SWITCHPOINT, FROM_TYPE, NUM_CONNS_TYPE, TO_SWITCHPOINT, TO_TYPE};
const char *atok_lookup_t_wireconn[] = {"from_switchpoint", "from_type", "num_conns_type", "to_switchpoint", "to_type"};
enum class gtok_t_clocks {CLOCK};
const char *gtok_lookup_t_clocks[] = {"clock"};
enum class gtok_t_model_type {INPUT_PORTS, OUTPUT_PORTS};
const char *gtok_lookup_t_model_type[] = {"input_ports", "output_ports"};
enum class atok_t_model_type {NAME};
const char *atok_lookup_t_model_type[] = {"name"};
enum class gtok_t_single {METADATA};
const char *gtok_lookup_t_single[] = {"metadata"};
enum class atok_t_single {PRIORITY, TYPE, X, Y};
const char *atok_lookup_t_single[] = {"priority", "type", "x", "y"};
enum class gtok_t_device {SIZING, CONNECTION_BLOCK, AREA, SWITCH_BLOCK, CHAN_WIDTH_DISTR, DEFAULT_FC};
const char *gtok_lookup_t_device[] = {"sizing", "connection_block", "area", "switch_block", "chan_width_distr", "default_fc"};
enum class gtok_t_switchlist {SWITCH};
const char *gtok_lookup_t_switchlist[] = {"switch"};
enum class gtok_t_pb_type_input {METADATA};
const char *gtok_lookup_t_pb_type_input[] = {"metadata"};
enum class atok_t_pb_type_input {EQUIVALENT, IS_NON_CLOCK_GLOBAL, NAME, NUM_PINS, PORT_CLASS};
const char *atok_lookup_t_pb_type_input[] = {"equivalent", "is_non_clock_global", "name", "num_pins", "port_class"};
enum class gtok_t_pb_type_output {METADATA};
const char *gtok_lookup_t_pb_type_output[] = {"metadata"};
enum class atok_t_pb_type_output {EQUIVALENT, NAME, NUM_PINS, PORT_CLASS};
const char *atok_lookup_t_pb_type_output[] = {"equivalent", "name", "num_pins", "port_class"};
enum class gtok_t_interconnect_type {PACK_PATTERN, DELAY_CONSTANT, DELAY_MATRIX, METADATA};
const char *gtok_lookup_t_interconnect_type[] = {"pack_pattern", "delay_constant", "delay_matrix", "metadata"};
enum class atok_t_interconnect_type {INPUT, NAME, OUTPUT};
const char *atok_lookup_t_interconnect_type[] = {"input", "name", "output"};
enum class gtok_t_equivalent_tiles {MODE};
const char *gtok_lookup_t_equivalent_tiles[] = {"mode"};
enum class gtok_t_segmentlist {SEGMENT};
const char *gtok_lookup_t_segmentlist[] = {"segment"};
enum class gtok_t_switchblock {SWITCHBLOCK_LOCATION, SWITCHFUNCS, WIRECONN};
const char *gtok_lookup_t_switchblock[] = {"switchblock_location", "switchfuncs", "wireconn"};
enum class atok_t_switchblock {NAME, TYPE};
const char *atok_lookup_t_switchblock[] = {"name", "type"};
enum class gtok_t_models {MODEL};
const char *gtok_lookup_t_models[] = {"model"};
enum class gtok_t_layout_info {FILL, PERIMETER, CORNERS, SINGLE, COL, ROW, REGION};
const char *gtok_lookup_t_layout_info[] = {"fill", "perimeter", "corners", "single", "col", "row", "region"};
enum class gtok_t_auto_layout {FILL, PERIMETER, CORNERS, SINGLE, COL, ROW, REGION};
const char *gtok_lookup_t_auto_layout[] = {"fill", "perimeter", "corners", "single", "col", "row", "region"};
enum class atok_t_auto_layout {ASPECT_RATIO};
const char *atok_lookup_t_auto_layout[] = {"aspect_ratio"};
enum class gtok_t_fixed_layout {FILL, PERIMETER, CORNERS, SINGLE, COL, ROW, REGION};
const char *gtok_lookup_t_fixed_layout[] = {"fill", "perimeter", "corners", "single", "col", "row", "region"};
enum class atok_t_fixed_layout {HEIGHT, NAME, WIDTH};
const char *atok_lookup_t_fixed_layout[] = {"height", "name", "width"};
enum class gtok_t_interconnect {COMPLETE, DIRECT, MUX};
const char *gtok_lookup_t_interconnect[] = {"complete", "direct", "mux"};
enum class gtok_t_tile {EQUIVALENT_TILES, PINLOCATIONS, FC, SWITCHBLOCK_LOCATIONS};
const char *gtok_lookup_t_tile[] = {"equivalent_tiles", "pinlocations", "fc", "switchblock_locations"};
enum class atok_t_tile {NAME};
const char *atok_lookup_t_tile[] = {"name"};
enum class gtok_t_switchblocklist {SWITCHBLOCK};
const char *gtok_lookup_t_switchblocklist[] = {"switchblock"};
enum class gtok_t_layout {AUTO_LAYOUT, FIXED_LAYOUT, DEVICE_LAYOUT};
const char *gtok_lookup_t_layout[] = {"auto_layout", "fixed_layout", "device_layout"};
enum class gtok_t_mode {PB_TYPE, INTERCONNECT, PINLOCATIONS, SWITCHBLOCK_LOCATIONS, METADATA};
const char *gtok_lookup_t_mode[] = {"pb_type", "interconnect", "pinlocations", "switchblock_locations", "metadata"};
enum class atok_t_mode {NAME};
const char *atok_lookup_t_mode[] = {"name"};
enum class gtok_t_tiles {TILE};
const char *gtok_lookup_t_tiles[] = {"tile"};
enum class gtok_t_pb_type {PB_TYPE, INPUT, OUTPUT, CLOCK, METADATA, MODE, INTERCONNECT, PINLOCATIONS, SWITCHBLOCK_LOCATIONS, FC, DELAY_CONSTANT, DELAY_MATRIX, T_SETUP, T_HOLD, T_CLOCK_TO_Q, POWER};
const char *gtok_lookup_t_pb_type[] = {"pb_type", "input", "output", "clock", "metadata", "mode", "interconnect", "pinlocations", "switchblock_locations", "fc", "delay_constant", "delay_matrix", "T_setup", "T_hold", "T_clock_to_Q", "power"};
enum class atok_t_pb_type {AREA, BLIF_MODEL, CAPACITY, CLASS, HEIGHT, NAME, NUM_PB, WIDTH};
const char *atok_lookup_t_pb_type[] = {"area", "blif_model", "capacity", "class", "height", "name", "num_pb", "width"};
enum class gtok_t_complexblocklist {PB_TYPE};
const char *gtok_lookup_t_complexblocklist[] = {"pb_type"};
enum class gtok_t_architecture {MODELS, LAYOUT, DEVICE, SWITCHLIST, SWITCHBLOCKLIST, SEGMENTLIST, POWER, CLOCKS, DIRECTLIST, TILES, COMPLEXBLOCKLIST};
const char *gtok_lookup_t_architecture[] = {"models", "layout", "device", "switchlist", "switchblocklist", "segmentlist", "power", "clocks", "directlist", "tiles", "complexblocklist"};
/**
* Lexing functions. These convert the const char *s of PugiXML to enums.
* You may find numerous "break"s there. Without them, a warning explosion ensues.
**/
inline enum_chan_distribution lex_chan_distribution(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('d', 0, 32) | onechar('e', 8, 32) | onechar('l', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
return enum_chan_distribution::DELTA;
break;
default: break;
}
break;
case onechar('p', 0, 32) | onechar('u', 8, 32) | onechar('l', 16, 32) | onechar('s', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
return enum_chan_distribution::PULSE;
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('u', 0, 32) | onechar('n', 8, 32) | onechar('i', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('m', 0, 8):
return enum_chan_distribution::UNIFORM;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('g', 0, 64) | onechar('a', 8, 64) | onechar('u', 16, 64) | onechar('s', 24, 64) | onechar('s', 32, 64) | onechar('i', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
return enum_chan_distribution::GAUSSIAN;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_chan_distribution.");
return enum_chan_distribution::UXSD_INVALID;
}
inline enum_switch_block_type lex_switch_block_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('u', 8, 32) | onechar('s', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('m', 0, 8):
return enum_switch_block_type::CUSTOM;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('s', 0, 32) | onechar('u', 8, 32) | onechar('b', 16, 32) | onechar('s', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return enum_switch_block_type::SUBSET;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('w', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('n', 0, 8):
return enum_switch_block_type::WILTON;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('u', 0, 64) | onechar('n', 8, 64) | onechar('i', 16, 64) | onechar('v', 24, 64) | onechar('e', 32, 64) | onechar('r', 40, 64) | onechar('s', 48, 64) | onechar('a', 56, 64):
switch(in[8]){
case onechar('l', 0, 8):
return enum_switch_block_type::UNIVERSAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_switch_block_type.");
return enum_switch_block_type::UXSD_INVALID;
}
inline enum_fc_type_enum lex_fc_type_enum(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('a', 0, 8):
switch(in[1]){
case onechar('b', 0, 8):
switch(in[2]){
case onechar('s', 0, 8):
return enum_fc_type_enum::ABS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('r', 8, 32) | onechar('a', 16, 32) | onechar('c', 24, 32):
return enum_fc_type_enum::FRAC;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_fc_type_enum.");
return enum_fc_type_enum::UXSD_INVALID;
}
inline enum_buf_size lex_buf_size(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('a', 0, 32) | onechar('u', 8, 32) | onechar('t', 16, 32) | onechar('o', 24, 32):
return enum_buf_size::AUTO;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_buf_size.");
return enum_buf_size::UXSD_INVALID;
}
inline enum_switch_type lex_switch_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('u', 0, 8):
switch(in[2]){
case onechar('x', 0, 8):
return enum_switch_type::MUX;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('h', 8, 32) | onechar('o', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
return enum_switch_type::SHORT;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('b', 0, 32) | onechar('u', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
return enum_switch_type::BUFFER;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('t', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('s', 24, 64) | onechar('t', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
return enum_switch_type::TRISTATE;
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('a', 8, 64) | onechar('s', 16, 64) | onechar('s', 24, 64) | onechar('_', 32, 64) | onechar('g', 40, 64) | onechar('a', 48, 64) | onechar('t', 56, 64):
switch(in[8]){
case onechar('e', 0, 8):
return enum_switch_type::PASS_GATE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_switch_type.");
return enum_switch_type::UXSD_INVALID;
}
inline enum_pb_input_equivalent lex_pb_input_equivalent(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('u', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return enum_pb_input_equivalent::FULL;
break;
case onechar('n', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('e', 24, 32):
return enum_pb_input_equivalent::NONE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('a', 32, 64) | onechar('n', 40, 64) | onechar('c', 48, 64) | onechar('e', 56, 64):
return enum_pb_input_equivalent::INSTANCE;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_pb_input_equivalent.");
return enum_pb_input_equivalent::UXSD_INVALID;
}
inline enum_pb_output_equivalent lex_pb_output_equivalent(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('u', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return enum_pb_output_equivalent::FULL;
break;
case onechar('n', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('e', 24, 32):
return enum_pb_output_equivalent::NONE;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_pb_output_equivalent.");
return enum_pb_output_equivalent::UXSD_INVALID;
}
inline enum_pb_clock_equivalent lex_pb_clock_equivalent(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('u', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return enum_pb_clock_equivalent::FULL;
break;
case onechar('n', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('e', 24, 32):
return enum_pb_clock_equivalent::NONE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('a', 32, 64) | onechar('n', 40, 64) | onechar('c', 48, 64) | onechar('e', 56, 64):
return enum_pb_clock_equivalent::INSTANCE;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_pb_clock_equivalent.");
return enum_pb_clock_equivalent::UXSD_INVALID;
}
inline enum_delay_matrix_type lex_delay_matrix_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('a', 0, 8):
switch(in[2]){
case onechar('x', 0, 8):
return enum_delay_matrix_type::MAX;
break;
default: break;
}
break;
case onechar('i', 0, 8):
switch(in[2]){
case onechar('n', 0, 8):
return enum_delay_matrix_type::MIN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_delay_matrix_type.");
return enum_delay_matrix_type::UXSD_INVALID;
}
inline enum_power_estimation_method lex_power_estimation_method(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('g', 8, 32) | onechar('n', 16, 32) | onechar('o', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return enum_power_estimation_method::IGNORE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('a', 0, 64) | onechar('b', 8, 64) | onechar('s', 16, 64) | onechar('o', 24, 64) | onechar('l', 32, 64) | onechar('u', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
return enum_power_estimation_method::ABSOLUTE;
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('a', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('o', 24, 64) | onechar('-', 32, 64) | onechar('s', 40, 64) | onechar('i', 48, 64) | onechar('z', 56, 64):
switch(in[8]){
case onechar('e', 0, 8):
return enum_power_estimation_method::AUTO_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('C', 0, 64) | onechar('-', 8, 64) | onechar('i', 16, 64) | onechar('n', 24, 64) | onechar('t', 32, 64) | onechar('e', 40, 64) | onechar('r', 48, 64) | onechar('n', 56, 64):
switch(in[8]){
case onechar('a', 0, 8):
switch(in[9]){
case onechar('l', 0, 8):
return enum_power_estimation_method::C_INTERNAL;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('i', 8, 64) | onechar('n', 16, 64) | onechar('-', 24, 64) | onechar('t', 32, 64) | onechar('o', 40, 64) | onechar('g', 48, 64) | onechar('g', 56, 64):
switch(in[8]){
case onechar('l', 0, 8):
switch(in[9]){
case onechar('e', 0, 8):
return enum_power_estimation_method::PIN_TOGGLE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('p', 8, 64) | onechar('e', 16, 64) | onechar('c', 24, 64) | onechar('i', 32, 64) | onechar('f', 40, 64) | onechar('y', 48, 64) | onechar('-', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('s', 0, 32) | onechar('i', 8, 32) | onechar('z', 16, 32) | onechar('e', 24, 32):
return enum_power_estimation_method::SPECIFY_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
case 15:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('-', 24, 64) | onechar('o', 32, 64) | onechar('f', 40, 64) | onechar('-', 48, 64) | onechar('c', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('h', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('d', 24, 32):
switch(in[12]){
case onechar('r', 0, 8):
switch(in[13]){
case onechar('e', 0, 8):
switch(in[14]){
case onechar('n', 0, 8):
return enum_power_estimation_method::SUM_OF_CHILDREN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_power_estimation_method.");
return enum_power_estimation_method::UXSD_INVALID;
}
inline enum_loc_side lex_loc_side(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('t', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('p', 0, 8):
return enum_loc_side::TOP;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('l', 0, 32) | onechar('e', 8, 32) | onechar('f', 16, 32) | onechar('t', 24, 32):
return enum_loc_side::LEFT;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('i', 8, 32) | onechar('g', 16, 32) | onechar('h', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
return enum_loc_side::RIGHT;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('b', 0, 32) | onechar('o', 8, 32) | onechar('t', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('m', 0, 8):
return enum_loc_side::BOTTOM;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_loc_side.");
return enum_loc_side::UXSD_INVALID;
}
inline enum_pinlocations_pattern lex_pinlocations_pattern(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('u', 8, 32) | onechar('s', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('m', 0, 8):
return enum_pinlocations_pattern::CUSTOM;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('s', 0, 32) | onechar('p', 8, 32) | onechar('r', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('d', 0, 8):
return enum_pinlocations_pattern::SPREAD;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('e', 8, 64) | onechar('r', 16, 64) | onechar('i', 24, 64) | onechar('m', 32, 64) | onechar('e', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('r', 0, 8):
return enum_pinlocations_pattern::PERIMETER;
break;
default: break;
}
break;
default: break;
}
break;
case 31:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('p', 8, 64) | onechar('r', 16, 64) | onechar('e', 24, 64) | onechar('a', 32, 64) | onechar('d', 40, 64) | onechar('_', 48, 64) | onechar('i', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('n', 0, 64) | onechar('p', 8, 64) | onechar('u', 16, 64) | onechar('t', 24, 64) | onechar('s', 32, 64) | onechar('_', 40, 64) | onechar('p', 48, 64) | onechar('e', 56, 64):
switch(*((triehash_uu64*)&in[16])){
case onechar('r', 0, 64) | onechar('i', 8, 64) | onechar('m', 16, 64) | onechar('e', 24, 64) | onechar('t', 32, 64) | onechar('e', 40, 64) | onechar('r', 48, 64) | onechar('_', 56, 64):
switch(*((triehash_uu32*)&in[24])){
case onechar('o', 0, 32) | onechar('u', 8, 32) | onechar('t', 16, 32) | onechar('p', 24, 32):
switch(in[28]){
case onechar('u', 0, 8):
switch(in[29]){
case onechar('t', 0, 8):
switch(in[30]){
case onechar('s', 0, 8):
return enum_pinlocations_pattern::SPREAD_INPUTS_PERIMETER_OUTPUTS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_pinlocations_pattern.");
return enum_pinlocations_pattern::UXSD_INVALID;
}
inline enum_sb_loc_type lex_sb_loc_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('u', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return enum_sb_loc_type::FULL;
break;
case onechar('n', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('e', 24, 32):
return enum_sb_loc_type::NONE;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('u', 8, 32) | onechar('r', 16, 32) | onechar('n', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
return enum_sb_loc_type::TURNS;
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('t', 8, 64) | onechar('r', 16, 64) | onechar('a', 24, 64) | onechar('i', 32, 64) | onechar('g', 40, 64) | onechar('h', 48, 64) | onechar('t', 56, 64):
return enum_sb_loc_type::STRAIGHT;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_sb_loc_type.");
return enum_sb_loc_type::UXSD_INVALID;
}
inline enum_switchblock_locations_pattern lex_switchblock_locations_pattern(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('a', 0, 8):
switch(in[1]){
case onechar('l', 0, 8):
switch(in[2]){
case onechar('l', 0, 8):
return enum_switchblock_locations_pattern::ALL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('e', 24, 32):
return enum_switchblock_locations_pattern::NONE;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('u', 8, 32) | onechar('s', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('m', 0, 8):
return enum_switchblock_locations_pattern::CUSTOM;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('x', 8, 64) | onechar('t', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('l', 56, 64):
return enum_switchblock_locations_pattern::EXTERNAL;
break;
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('t', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('l', 56, 64):
return enum_switchblock_locations_pattern::INTERNAL;
break;
default: break;
}
break;
case 31:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('x', 8, 64) | onechar('t', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('_', 0, 64) | onechar('f', 8, 64) | onechar('u', 16, 64) | onechar('l', 24, 64) | onechar('l', 32, 64) | onechar('_', 40, 64) | onechar('i', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu64*)&in[16])){
case onechar('t', 0, 64) | onechar('e', 8, 64) | onechar('r', 16, 64) | onechar('n', 24, 64) | onechar('a', 32, 64) | onechar('l', 40, 64) | onechar('_', 48, 64) | onechar('s', 56, 64):
switch(*((triehash_uu32*)&in[24])){
case onechar('t', 0, 32) | onechar('r', 8, 32) | onechar('a', 16, 32) | onechar('i', 24, 32):
switch(in[28]){
case onechar('g', 0, 8):
switch(in[29]){
case onechar('h', 0, 8):
switch(in[30]){
case onechar('t', 0, 8):
return enum_switchblock_locations_pattern::EXTERNAL_FULL_INTERNAL_STRAIGHT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_switchblock_locations_pattern.");
return enum_switchblock_locations_pattern::UXSD_INVALID;
}
inline enum_pb_type_class lex_pb_type_class(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('l', 0, 8):
switch(in[1]){
case onechar('u', 0, 8):
switch(in[2]){
case onechar('t', 0, 8):
return enum_pb_type_class::LUT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('e', 8, 32) | onechar('m', 16, 32) | onechar('o', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
switch(in[5]){
case onechar('y', 0, 8):
return enum_pb_type_class::MEMORY;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('f', 0, 64) | onechar('l', 8, 64) | onechar('i', 16, 64) | onechar('p', 24, 64) | onechar('f', 32, 64) | onechar('l', 40, 64) | onechar('o', 48, 64) | onechar('p', 56, 64):
return enum_pb_type_class::FLIPFLOP;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_pb_type_class.");
return enum_pb_type_class::UXSD_INVALID;
}
inline enum_segment_length lex_segment_length(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('l', 0, 64) | onechar('o', 8, 64) | onechar('n', 16, 64) | onechar('g', 24, 64) | onechar('l', 32, 64) | onechar('i', 40, 64) | onechar('n', 48, 64) | onechar('e', 56, 64):
return enum_segment_length::LONGLINE;
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_segment_length.");
return enum_segment_length::UXSD_INVALID;
}
inline enum_segment_type lex_segment_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('b', 0, 32) | onechar('i', 8, 32) | onechar('d', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
return enum_segment_type::BIDIR;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('u', 0, 32) | onechar('n', 8, 32) | onechar('i', 16, 32) | onechar('d', 24, 32):
switch(in[4]){
case onechar('i', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
return enum_segment_type::UNIDIR;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_segment_type.");
return enum_segment_type::UXSD_INVALID;
}
inline enum_switchblock_location_type lex_switchblock_location_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('C', 0, 32) | onechar('O', 8, 32) | onechar('R', 16, 32) | onechar('E', 24, 32):
return enum_switchblock_location_type::CORE;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('C', 0, 32) | onechar('O', 8, 32) | onechar('R', 16, 32) | onechar('N', 24, 32):
switch(in[4]){
case onechar('E', 0, 8):
switch(in[5]){
case onechar('R', 0, 8):
return enum_switchblock_location_type::CORNER;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('F', 0, 32) | onechar('R', 8, 32) | onechar('I', 16, 32) | onechar('N', 24, 32):
switch(in[4]){
case onechar('G', 0, 8):
switch(in[5]){
case onechar('E', 0, 8):
return enum_switchblock_location_type::FRINGE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('P', 0, 64) | onechar('E', 8, 64) | onechar('R', 16, 64) | onechar('I', 24, 64) | onechar('M', 32, 64) | onechar('E', 40, 64) | onechar('T', 48, 64) | onechar('E', 56, 64):
switch(in[8]){
case onechar('R', 0, 8):
return enum_switchblock_location_type::PERIMETER;
break;
default: break;
}
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('E', 0, 64) | onechar('V', 8, 64) | onechar('E', 16, 64) | onechar('R', 24, 64) | onechar('Y', 32, 64) | onechar('W', 40, 64) | onechar('H', 48, 64) | onechar('E', 56, 64):
switch(in[8]){
case onechar('R', 0, 8):
switch(in[9]){
case onechar('E', 0, 8):
return enum_switchblock_location_type::EVERYWHERE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_switchblock_location_type.");
return enum_switchblock_location_type::UXSD_INVALID;
}
inline enum_func_type lex_func_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('b', 0, 8):
switch(in[1]){
case onechar('l', 0, 8):
return enum_func_type::BL;
break;
case onechar('r', 0, 8):
return enum_func_type::BR;
break;
case onechar('t', 0, 8):
return enum_func_type::BT;
break;
default: break;
}
break;
case onechar('l', 0, 8):
switch(in[1]){
case onechar('b', 0, 8):
return enum_func_type::LB;
break;
case onechar('r', 0, 8):
return enum_func_type::LR;
break;
case onechar('t', 0, 8):
return enum_func_type::LT;
break;
default: break;
}
break;
case onechar('r', 0, 8):
switch(in[1]){
case onechar('b', 0, 8):
return enum_func_type::RB;
break;
case onechar('l', 0, 8):
return enum_func_type::RL;
break;
case onechar('t', 0, 8):
return enum_func_type::RT;
break;
default: break;
}
break;
case onechar('t', 0, 8):
switch(in[1]){
case onechar('b', 0, 8):
return enum_func_type::TB;
break;
case onechar('l', 0, 8):
return enum_func_type::TL;
break;
case onechar('r', 0, 8):
return enum_func_type::TR;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_func_type.");
return enum_func_type::UXSD_INVALID;
}
inline enum_switchblock_type lex_switchblock_type(const char *in, bool throw_on_invalid){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('b', 0, 32) | onechar('i', 8, 32) | onechar('d', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
return enum_switchblock_type::BIDIR;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('u', 0, 32) | onechar('n', 8, 32) | onechar('i', 16, 32) | onechar('d', 24, 32):
switch(in[4]){
case onechar('i', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
return enum_switchblock_type::UNIDIR;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
if(throw_on_invalid)
throw std::runtime_error("Found unrecognized enum value " + std::string(in) + "of enum_switchblock_type.");
return enum_switchblock_type::UXSD_INVALID;
}
inline atok_t_meta alex_t_meta(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_meta::NAME;
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('x', 0, 32) | onechar('o', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_meta::XOFFSET;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('y', 0, 32) | onechar('o', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_meta::YOFFSET;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('x', 0, 64) | onechar('_', 8, 64) | onechar('o', 16, 64) | onechar('f', 24, 64) | onechar('f', 32, 64) | onechar('s', 40, 64) | onechar('e', 48, 64) | onechar('t', 56, 64):
return atok_t_meta::X_OFFSET;
break;
case onechar('y', 0, 64) | onechar('_', 8, 64) | onechar('o', 16, 64) | onechar('f', 24, 64) | onechar('f', 32, 64) | onechar('s', 40, 64) | onechar('e', 48, 64) | onechar('t', 56, 64):
return atok_t_meta::Y_OFFSET;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <meta>.");
}
inline atok_t_port alex_t_port(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_port::NAME;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('o', 16, 32) | onechar('c', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
return atok_t_port::CLOCK;
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('s', 8, 64) | onechar('_', 16, 64) | onechar('c', 24, 64) | onechar('l', 32, 64) | onechar('o', 40, 64) | onechar('c', 48, 64) | onechar('k', 56, 64):
return atok_t_port::IS_CLOCK;
break;
default: break;
}
break;
case 24:
switch(*((triehash_uu64*)&in[0])){
case onechar('c', 0, 64) | onechar('o', 8, 64) | onechar('m', 16, 64) | onechar('b', 24, 64) | onechar('i', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('t', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('i', 0, 64) | onechar('o', 8, 64) | onechar('n', 16, 64) | onechar('a', 24, 64) | onechar('l', 32, 64) | onechar('_', 40, 64) | onechar('s', 48, 64) | onechar('i', 56, 64):
switch(*((triehash_uu64*)&in[16])){
case onechar('n', 0, 64) | onechar('k', 8, 64) | onechar('_', 16, 64) | onechar('p', 24, 64) | onechar('o', 32, 64) | onechar('r', 40, 64) | onechar('t', 48, 64) | onechar('s', 56, 64):
return atok_t_port::COMBINATIONAL_SINK_PORTS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <port>.");
}
inline atok_t_fill alex_t_fill(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_fill::TYPE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_fill::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <fill>.");
}
inline atok_t_perimeter alex_t_perimeter(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_perimeter::TYPE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_perimeter::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <perimeter>.");
}
inline atok_t_corners alex_t_corners(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_corners::TYPE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_corners::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <corners>.");
}
inline atok_t_col alex_t_col(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_col::TYPE;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('c', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
return atok_t_col::INCRY;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('t', 8, 32) | onechar('a', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
switch(in[5]){
case onechar('x', 0, 8):
return atok_t_col::STARTX;
break;
case onechar('y', 0, 8):
return atok_t_col::STARTY;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('e', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
switch(in[6]){
case onechar('x', 0, 8):
return atok_t_col::REPEATX;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_col::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <col>.");
}
inline atok_t_row alex_t_row(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_row::TYPE;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('c', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('x', 0, 8):
return atok_t_row::INCRX;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('t', 8, 32) | onechar('a', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
switch(in[5]){
case onechar('x', 0, 8):
return atok_t_row::STARTX;
break;
case onechar('y', 0, 8):
return atok_t_row::STARTY;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('e', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
switch(in[6]){
case onechar('y', 0, 8):
return atok_t_row::REPEATY;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_row::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <row>.");
}
inline atok_t_region alex_t_region(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('e', 0, 32) | onechar('n', 8, 32) | onechar('d', 16, 32) | onechar('x', 24, 32):
return atok_t_region::ENDX;
break;
case onechar('e', 0, 32) | onechar('n', 8, 32) | onechar('d', 16, 32) | onechar('y', 24, 32):
return atok_t_region::ENDY;
break;
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_region::TYPE;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('c', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('x', 0, 8):
return atok_t_region::INCRX;
break;
case onechar('y', 0, 8):
return atok_t_region::INCRY;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('t', 8, 32) | onechar('a', 16, 32) | onechar('r', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
switch(in[5]){
case onechar('x', 0, 8):
return atok_t_region::STARTX;
break;
case onechar('y', 0, 8):
return atok_t_region::STARTY;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('e', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
switch(in[6]){
case onechar('x', 0, 8):
return atok_t_region::REPEATX;
break;
case onechar('y', 0, 8):
return atok_t_region::REPEATY;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_region::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <region>.");
}
inline atok_t_chan_dist alex_t_chan_dist(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('d', 0, 8):
switch(in[1]){
case onechar('c', 0, 8):
return atok_t_chan_dist::DC;
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('e', 8, 32) | onechar('a', 16, 32) | onechar('k', 24, 32):
return atok_t_chan_dist::PEAK;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('d', 0, 32) | onechar('i', 8, 32) | onechar('s', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
return atok_t_chan_dist::DISTR;
break;
default: break;
}
break;
case onechar('w', 0, 32) | onechar('i', 8, 32) | onechar('d', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('h', 0, 8):
return atok_t_chan_dist::WIDTH;
break;
default: break;
}
break;
case onechar('x', 0, 32) | onechar('p', 8, 32) | onechar('e', 16, 32) | onechar('a', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
return atok_t_chan_dist::XPEAK;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <chan_dist>.");
}
inline atok_t_pb_type_clock alex_t_pb_type_clock(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_pb_type_clock::NAME;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('n', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('i', 40, 64) | onechar('n', 48, 64) | onechar('s', 56, 64):
return atok_t_pb_type_clock::NUM_PINS;
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('q', 8, 64) | onechar('u', 16, 64) | onechar('i', 24, 64) | onechar('v', 32, 64) | onechar('a', 40, 64) | onechar('l', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('n', 0, 8):
switch(in[9]){
case onechar('t', 0, 8):
return atok_t_pb_type_clock::EQUIVALENT;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('r', 16, 64) | onechar('t', 24, 64) | onechar('_', 32, 64) | onechar('c', 40, 64) | onechar('l', 48, 64) | onechar('a', 56, 64):
switch(in[8]){
case onechar('s', 0, 8):
switch(in[9]){
case onechar('s', 0, 8):
return atok_t_pb_type_clock::PORT_CLASS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <pb_type_clock>.");
}
inline atok_t_delay_matrix alex_t_delay_matrix(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_delay_matrix::TYPE;
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('p', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_delay_matrix::IN_PORT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('o', 40, 64) | onechar('r', 48, 64) | onechar('t', 56, 64):
return atok_t_delay_matrix::OUT_PORT;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <delay_matrix>.");
}
inline atok_t_T_timing_minmax alex_t_T_timing_minmax(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('a', 0, 8):
switch(in[2]){
case onechar('x', 0, 8):
return atok_t_T_timing_minmax::MAX;
break;
default: break;
}
break;
case onechar('i', 0, 8):
switch(in[2]){
case onechar('n', 0, 8):
return atok_t_T_timing_minmax::MIN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('p', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_T_timing_minmax::IN_PORT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('o', 40, 64) | onechar('r', 48, 64) | onechar('t', 56, 64):
return atok_t_T_timing_minmax::OUT_PORT;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <T_timing_minmax>.");
}
inline atok_t_T_timing alex_t_T_timing(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('t', 24, 32):
return atok_t_T_timing::PORT;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('o', 16, 32) | onechar('c', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
return atok_t_T_timing::CLOCK;
break;
default: break;
}
break;
case onechar('v', 0, 32) | onechar('a', 8, 32) | onechar('l', 16, 32) | onechar('u', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
return atok_t_T_timing::VALUE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <T_timing>.");
}
inline atok_t_T_clock_timing alex_t_T_clock_timing(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('a', 0, 8):
switch(in[2]){
case onechar('x', 0, 8):
return atok_t_T_clock_timing::MAX;
break;
default: break;
}
break;
case onechar('i', 0, 8):
switch(in[2]){
case onechar('n', 0, 8):
return atok_t_T_clock_timing::MIN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('t', 24, 32):
return atok_t_T_clock_timing::PORT;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('o', 16, 32) | onechar('c', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
return atok_t_T_clock_timing::CLOCK;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <T_clock_timing>.");
}
inline atok_t_pack_pattern alex_t_pack_pattern(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_pack_pattern::NAME;
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('p', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_pack_pattern::IN_PORT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('o', 40, 64) | onechar('r', 48, 64) | onechar('t', 56, 64):
return atok_t_pack_pattern::OUT_PORT;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <pack_pattern>.");
}
inline atok_t_power_dynamic_power alex_t_power_dynamic_power(const char *in){
unsigned int len = strlen(in);
switch(len){
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('C', 0, 64) | onechar('_', 8, 64) | onechar('i', 16, 64) | onechar('n', 24, 64) | onechar('t', 32, 64) | onechar('e', 40, 64) | onechar('r', 48, 64) | onechar('n', 56, 64):
switch(in[8]){
case onechar('a', 0, 8):
switch(in[9]){
case onechar('l', 0, 8):
return atok_t_power_dynamic_power::C_INTERNAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 18:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('w', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('_', 40, 64) | onechar('p', 48, 64) | onechar('e', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('r', 0, 64) | onechar('_', 8, 64) | onechar('i', 16, 64) | onechar('n', 24, 64) | onechar('s', 32, 64) | onechar('t', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(in[16]){
case onechar('c', 0, 8):
switch(in[17]){
case onechar('e', 0, 8):
return atok_t_power_dynamic_power::POWER_PER_INSTANCE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_dynamic_power>.");
}
inline atok_t_power_static_power alex_t_power_static_power(const char *in){
unsigned int len = strlen(in);
switch(len){
case 18:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('w', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('_', 40, 64) | onechar('p', 48, 64) | onechar('e', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('r', 0, 64) | onechar('_', 8, 64) | onechar('i', 16, 64) | onechar('n', 24, 64) | onechar('s', 32, 64) | onechar('t', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(in[16]){
case onechar('c', 0, 8):
switch(in[17]){
case onechar('e', 0, 8):
return atok_t_power_static_power::POWER_PER_INSTANCE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_static_power>.");
}
inline atok_t_power_port alex_t_power_port(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_power_port::NAME;
break;
default: break;
}
break;
case 17:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('n', 8, 64) | onechar('e', 16, 64) | onechar('r', 24, 64) | onechar('g', 32, 64) | onechar('y', 40, 64) | onechar('_', 48, 64) | onechar('p', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('e', 0, 64) | onechar('r', 8, 64) | onechar('_', 16, 64) | onechar('t', 24, 64) | onechar('o', 32, 64) | onechar('g', 40, 64) | onechar('g', 48, 64) | onechar('l', 56, 64):
switch(in[16]){
case onechar('e', 0, 8):
return atok_t_power_port::ENERGY_PER_TOGGLE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 21:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('c', 8, 64) | onechar('a', 16, 64) | onechar('l', 24, 64) | onechar('e', 32, 64) | onechar('d', 40, 64) | onechar('_', 48, 64) | onechar('b', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('y', 0, 64) | onechar('_', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('a', 32, 64) | onechar('t', 40, 64) | onechar('i', 48, 64) | onechar('c', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('_', 0, 32) | onechar('p', 8, 32) | onechar('r', 16, 32) | onechar('o', 24, 32):
switch(in[20]){
case onechar('b', 0, 8):
return atok_t_power_port::SCALED_BY_STATIC_PROB;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 23:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('c', 8, 64) | onechar('a', 16, 64) | onechar('l', 24, 64) | onechar('e', 32, 64) | onechar('d', 40, 64) | onechar('_', 48, 64) | onechar('b', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('y', 0, 64) | onechar('_', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('a', 32, 64) | onechar('t', 40, 64) | onechar('i', 48, 64) | onechar('c', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('_', 0, 32) | onechar('p', 8, 32) | onechar('r', 16, 32) | onechar('o', 24, 32):
switch(in[20]){
case onechar('b', 0, 8):
switch(in[21]){
case onechar('_', 0, 8):
switch(in[22]){
case onechar('n', 0, 8):
return atok_t_power_port::SCALED_BY_STATIC_PROB_N;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_port>.");
}
inline atok_t_power_local_interconnect alex_t_power_local_interconnect(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('C', 0, 32) | onechar('_', 8, 32) | onechar('w', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return atok_t_power_local_interconnect::C_WIRE;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('f', 0, 32) | onechar('a', 8, 32) | onechar('c', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
return atok_t_power_local_interconnect::FACTOR;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_local_interconnect>.");
}
inline atok_t_power_buffers alex_t_power_buffers(const char *in){
unsigned int len = strlen(in);
switch(len){
case 21:
switch(*((triehash_uu64*)&in[0])){
case onechar('l', 0, 64) | onechar('o', 8, 64) | onechar('g', 16, 64) | onechar('i', 24, 64) | onechar('c', 32, 64) | onechar('a', 40, 64) | onechar('l', 48, 64) | onechar('_', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('e', 0, 64) | onechar('f', 8, 64) | onechar('f', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('t', 40, 64) | onechar('_', 48, 64) | onechar('f', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('a', 0, 32) | onechar('c', 8, 32) | onechar('t', 16, 32) | onechar('o', 24, 32):
switch(in[20]){
case onechar('r', 0, 8):
return atok_t_power_buffers::LOGICAL_EFFORT_FACTOR;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_buffers>.");
}
inline atok_t_power_ff_size alex_t_power_ff_size(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('F', 0, 32) | onechar('F', 8, 32) | onechar('_', 16, 32) | onechar('s', 24, 32):
switch(in[4]){
case onechar('i', 0, 8):
switch(in[5]){
case onechar('z', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return atok_t_power_ff_size::FF_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_ff_size>.");
}
inline atok_t_power_LUT_transistor_size alex_t_power_LUT_transistor_size(const char *in){
unsigned int len = strlen(in);
switch(len){
case 19:
switch(*((triehash_uu64*)&in[0])){
case onechar('L', 0, 64) | onechar('U', 8, 64) | onechar('T', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('r', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('s', 0, 64) | onechar('i', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('o', 32, 64) | onechar('r', 40, 64) | onechar('_', 48, 64) | onechar('s', 56, 64):
switch(in[16]){
case onechar('i', 0, 8):
switch(in[17]){
case onechar('z', 0, 8):
switch(in[18]){
case onechar('e', 0, 8):
return atok_t_power_LUT_transistor_size::LUT_TRANSISTOR_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_LUT_transistor_size>.");
}
inline atok_t_power_mux_transistor_size alex_t_power_mux_transistor_size(const char *in){
unsigned int len = strlen(in);
switch(len){
case 19:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('u', 8, 64) | onechar('x', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('r', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('s', 0, 64) | onechar('i', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('o', 32, 64) | onechar('r', 40, 64) | onechar('_', 48, 64) | onechar('s', 56, 64):
switch(in[16]){
case onechar('i', 0, 8):
switch(in[17]){
case onechar('z', 0, 8):
switch(in[18]){
case onechar('e', 0, 8):
return atok_t_power_mux_transistor_size::MUX_TRANSISTOR_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power_mux_transistor_size>.");
}
inline atok_t_loc alex_t_loc(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('i', 8, 32) | onechar('d', 16, 32) | onechar('e', 24, 32):
return atok_t_loc::SIDE;
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('x', 0, 32) | onechar('o', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_loc::XOFFSET;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('y', 0, 32) | onechar('o', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_loc::YOFFSET;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <loc>.");
}
inline atok_t_sb_loc alex_t_sb_loc(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_sb_loc::TYPE;
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('x', 0, 32) | onechar('o', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_sb_loc::XOFFSET;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('y', 0, 32) | onechar('o', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return atok_t_sb_loc::YOFFSET;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 15:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('_', 48, 64) | onechar('o', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('v', 0, 32) | onechar('e', 8, 32) | onechar('r', 16, 32) | onechar('r', 24, 32):
switch(in[12]){
case onechar('i', 0, 8):
switch(in[13]){
case onechar('d', 0, 8):
switch(in[14]){
case onechar('e', 0, 8):
return atok_t_sb_loc::SWITCH_OVERRIDE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <sb_loc>.");
}
inline atok_t_map alex_t_map(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('t', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
return atok_t_map::TO;
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('r', 8, 32) | onechar('o', 16, 32) | onechar('m', 24, 32):
return atok_t_map::FROM;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('n', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('i', 40, 64) | onechar('n', 48, 64) | onechar('s', 56, 64):
return atok_t_map::NUM_PINS;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <map>.");
}
inline atok_t_segment_block alex_t_segment_block(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_segment_block::TYPE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <segment_block>.");
}
inline atok_t_segment_mux alex_t_segment_mux(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_segment_mux::NAME;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <segment_mux>.");
}
inline atok_t_segment_wire_switch alex_t_segment_wire_switch(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_segment_wire_switch::NAME;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <segment_wire_switch>.");
}
inline atok_t_direct alex_t_direct(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_direct::NAME;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('o', 8, 32) | onechar('_', 16, 32) | onechar('p', 24, 32):
switch(in[4]){
case onechar('i', 0, 8):
switch(in[5]){
case onechar('n', 0, 8):
return atok_t_direct::TO_PIN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('f', 0, 64) | onechar('r', 8, 64) | onechar('o', 16, 64) | onechar('m', 24, 64) | onechar('_', 32, 64) | onechar('p', 40, 64) | onechar('i', 48, 64) | onechar('n', 56, 64):
return atok_t_direct::FROM_PIN;
break;
case onechar('x', 0, 64) | onechar('_', 8, 64) | onechar('o', 16, 64) | onechar('f', 24, 64) | onechar('f', 32, 64) | onechar('s', 40, 64) | onechar('e', 48, 64) | onechar('t', 56, 64):
return atok_t_direct::X_OFFSET;
break;
case onechar('y', 0, 64) | onechar('_', 8, 64) | onechar('o', 16, 64) | onechar('f', 24, 64) | onechar('f', 32, 64) | onechar('s', 40, 64) | onechar('e', 48, 64) | onechar('t', 56, 64):
return atok_t_direct::Y_OFFSET;
break;
case onechar('z', 0, 64) | onechar('_', 8, 64) | onechar('o', 16, 64) | onechar('f', 24, 64) | onechar('f', 32, 64) | onechar('s', 40, 64) | onechar('e', 48, 64) | onechar('t', 56, 64):
return atok_t_direct::Z_OFFSET;
break;
default: break;
}
break;
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('_', 48, 64) | onechar('n', 56, 64):
switch(in[8]){
case onechar('a', 0, 8):
switch(in[9]){
case onechar('m', 0, 8):
switch(in[10]){
case onechar('e', 0, 8):
return atok_t_direct::SWITCH_NAME;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <direct>.");
}
inline atok_t_switchblock_location alex_t_switchblock_location(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_switchblock_location::TYPE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <switchblock_location>.");
}
inline atok_t_wireconn_connection alex_t_wireconn_connection(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_wireconn_connection::TYPE;
break;
default: break;
}
break;
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('p', 48, 64) | onechar('o', 56, 64):
switch(in[8]){
case onechar('i', 0, 8):
switch(in[9]){
case onechar('n', 0, 8):
switch(in[10]){
case onechar('t', 0, 8):
return atok_t_wireconn_connection::SWITCHPOINT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <wireconn_connection>.");
}
inline atok_t_clock alex_t_clock(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('C', 0, 32) | onechar('_', 8, 32) | onechar('w', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return atok_t_clock::C_WIRE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('b', 0, 64) | onechar('u', 8, 64) | onechar('f', 16, 64) | onechar('f', 24, 64) | onechar('e', 32, 64) | onechar('r', 40, 64) | onechar('_', 48, 64) | onechar('s', 56, 64):
switch(in[8]){
case onechar('i', 0, 8):
switch(in[9]){
case onechar('z', 0, 8):
switch(in[10]){
case onechar('e', 0, 8):
return atok_t_clock::BUFFER_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('C', 0, 64) | onechar('_', 8, 64) | onechar('w', 16, 64) | onechar('i', 24, 64) | onechar('r', 32, 64) | onechar('e', 40, 64) | onechar('_', 48, 64) | onechar('p', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('e', 0, 32) | onechar('r', 8, 32) | onechar('_', 16, 32) | onechar('m', 24, 32):
return atok_t_clock::C_WIRE_PER_M;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <clock>.");
}
inline atok_t_sizing alex_t_sizing(const char *in){
unsigned int len = strlen(in);
switch(len){
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('R', 0, 64) | onechar('_', 8, 64) | onechar('m', 16, 64) | onechar('i', 24, 64) | onechar('n', 32, 64) | onechar('W', 40, 64) | onechar('_', 48, 64) | onechar('n', 56, 64):
switch(in[8]){
case onechar('m', 0, 8):
switch(in[9]){
case onechar('o', 0, 8):
switch(in[10]){
case onechar('s', 0, 8):
return atok_t_sizing::R_MINW_NMOS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('R', 0, 64) | onechar('_', 8, 64) | onechar('m', 16, 64) | onechar('i', 24, 64) | onechar('n', 32, 64) | onechar('W', 40, 64) | onechar('_', 48, 64) | onechar('p', 56, 64):
switch(in[8]){
case onechar('m', 0, 8):
switch(in[9]){
case onechar('o', 0, 8):
switch(in[10]){
case onechar('s', 0, 8):
return atok_t_sizing::R_MINW_PMOS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <sizing>.");
}
inline atok_t_connection_block alex_t_connection_block(const char *in){
unsigned int len = strlen(in);
switch(len){
case 17:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('p', 16, 64) | onechar('u', 24, 64) | onechar('t', 32, 64) | onechar('_', 40, 64) | onechar('s', 48, 64) | onechar('w', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('i', 0, 64) | onechar('t', 8, 64) | onechar('c', 16, 64) | onechar('h', 24, 64) | onechar('_', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('m', 56, 64):
switch(in[16]){
case onechar('e', 0, 8):
return atok_t_connection_block::INPUT_SWITCH_NAME;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <connection_block>.");
}
inline atok_t_area alex_t_area(const char *in){
unsigned int len = strlen(in);
switch(len){
case 20:
switch(*((triehash_uu64*)&in[0])){
case onechar('g', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('d', 24, 64) | onechar('_', 32, 64) | onechar('l', 40, 64) | onechar('o', 48, 64) | onechar('g', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('i', 0, 64) | onechar('c', 8, 64) | onechar('_', 16, 64) | onechar('t', 24, 64) | onechar('i', 32, 64) | onechar('l', 40, 64) | onechar('e', 48, 64) | onechar('_', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('a', 0, 32) | onechar('r', 8, 32) | onechar('e', 16, 32) | onechar('a', 24, 32):
return atok_t_area::GRID_LOGIC_TILE_AREA;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <area>.");
}
inline atok_t_switch_block alex_t_switch_block(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('f', 0, 8):
switch(in[1]){
case onechar('s', 0, 8):
return atok_t_switch_block::FS;
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_switch_block::TYPE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <switch_block>.");
}
inline atok_t_default_fc alex_t_default_fc(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('v', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('l', 0, 8):
return atok_t_default_fc::IN_VAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return atok_t_default_fc::IN_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('o', 0, 32) | onechar('u', 8, 32) | onechar('t', 16, 32) | onechar('_', 24, 32):
switch(in[4]){
case onechar('v', 0, 8):
switch(in[5]){
case onechar('a', 0, 8):
switch(in[6]){
case onechar('l', 0, 8):
return atok_t_default_fc::OUT_VAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('y', 40, 64) | onechar('p', 48, 64) | onechar('e', 56, 64):
return atok_t_default_fc::OUT_TYPE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <default_fc>.");
}
inline atok_t_Tdel alex_t_Tdel(const char *in){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('d', 0, 32) | onechar('e', 8, 32) | onechar('l', 16, 32) | onechar('a', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
return atok_t_Tdel::DELAY;
break;
default: break;
}
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('n', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('_', 24, 64) | onechar('i', 32, 64) | onechar('n', 40, 64) | onechar('p', 48, 64) | onechar('u', 56, 64):
switch(in[8]){
case onechar('t', 0, 8):
switch(in[9]){
case onechar('s', 0, 8):
return atok_t_Tdel::NUM_INPUTS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <Tdel>.");
}
inline atok_t_fc_override alex_t_fc_override(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('c', 8, 32) | onechar('_', 16, 32) | onechar('v', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('l', 0, 8):
return atok_t_fc_override::FC_VAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('c', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return atok_t_fc_override::FC_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('r', 16, 64) | onechar('t', 24, 64) | onechar('_', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('m', 56, 64):
switch(in[8]){
case onechar('e', 0, 8):
return atok_t_fc_override::PORT_NAME;
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('e', 8, 64) | onechar('g', 16, 64) | onechar('m', 24, 64) | onechar('e', 32, 64) | onechar('n', 40, 64) | onechar('t', 48, 64) | onechar('_', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_fc_override::SEGMENT_NAME;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <fc_override>.");
}
inline atok_t_func alex_t_func(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_func::TYPE;
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('m', 24, 32):
switch(in[4]){
case onechar('u', 0, 8):
switch(in[5]){
case onechar('l', 0, 8):
switch(in[6]){
case onechar('a', 0, 8):
return atok_t_func::FORMULA;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <func>.");
}
inline gtok_t_metadata glex_t_metadata(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('e', 8, 32) | onechar('t', 16, 32) | onechar('a', 24, 32):
return gtok_t_metadata::META;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <metadata>.");
}
inline gtok_t_port_list glex_t_port_list(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('t', 24, 32):
return gtok_t_port_list::PORT;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <port_list>.");
}
inline gtok_t_chan_width_distr glex_t_chan_width_distr(const char *in){
unsigned int len = strlen(in);
switch(len){
case 1:
switch(in[0]){
case onechar('x', 0, 8):
return gtok_t_chan_width_distr::X;
break;
case onechar('y', 0, 8):
return gtok_t_chan_width_distr::Y;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <chan_width_distr>.");
}
inline gtok_t_switch glex_t_switch(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('T', 0, 32) | onechar('d', 8, 32) | onechar('e', 16, 32) | onechar('l', 24, 32):
return gtok_t_switch::TDEL;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <switch>.");
}
inline atok_t_switch alex_t_switch(const char *in){
unsigned int len = strlen(in);
switch(len){
case 1:
switch(in[0]){
case onechar('R', 0, 8):
return atok_t_switch::R;
break;
default: break;
}
break;
case 3:
switch(in[0]){
case onechar('C', 0, 8):
switch(in[1]){
case onechar('i', 0, 8):
switch(in[2]){
case onechar('n', 0, 8):
return atok_t_switch::CIN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('C', 0, 32) | onechar('o', 8, 32) | onechar('u', 16, 32) | onechar('t', 24, 32):
return atok_t_switch::COUT;
break;
case onechar('T', 0, 32) | onechar('d', 8, 32) | onechar('e', 16, 32) | onechar('l', 24, 32):
return atok_t_switch::TDEL;
break;
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_switch::NAME;
break;
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_switch::TYPE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('b', 0, 64) | onechar('u', 8, 64) | onechar('f', 16, 64) | onechar('_', 24, 64) | onechar('s', 32, 64) | onechar('i', 40, 64) | onechar('z', 48, 64) | onechar('e', 56, 64):
return atok_t_switch::BUF_SIZE;
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('C', 0, 64) | onechar('i', 8, 64) | onechar('n', 16, 64) | onechar('t', 24, 64) | onechar('e', 32, 64) | onechar('r', 40, 64) | onechar('n', 48, 64) | onechar('a', 56, 64):
switch(in[8]){
case onechar('l', 0, 8):
return atok_t_switch::CINTERNAL;
break;
default: break;
}
break;
default: break;
}
break;
case 14:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('u', 8, 64) | onechar('x', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('r', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('s', 0, 32) | onechar('_', 8, 32) | onechar('s', 16, 32) | onechar('i', 24, 32):
switch(in[12]){
case onechar('z', 0, 8):
switch(in[13]){
case onechar('e', 0, 8):
return atok_t_switch::MUX_TRANS_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('w', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('_', 40, 64) | onechar('b', 48, 64) | onechar('u', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('f', 0, 32) | onechar('_', 8, 32) | onechar('s', 16, 32) | onechar('i', 24, 32):
switch(in[12]){
case onechar('z', 0, 8):
switch(in[13]){
case onechar('e', 0, 8):
return atok_t_switch::POWER_BUF_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <switch>.");
}
inline gtok_t_power glex_t_power(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('t', 24, 32):
return gtok_t_power::PORT;
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('t', 8, 64) | onechar('a', 16, 64) | onechar('t', 24, 64) | onechar('i', 32, 64) | onechar('c', 40, 64) | onechar('_', 48, 64) | onechar('p', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('o', 0, 32) | onechar('w', 8, 32) | onechar('e', 16, 32) | onechar('r', 24, 32):
return gtok_t_power::STATIC_POWER;
break;
default: break;
}
break;
default: break;
}
break;
case 13:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('y', 8, 64) | onechar('n', 16, 64) | onechar('a', 24, 64) | onechar('m', 32, 64) | onechar('i', 40, 64) | onechar('c', 48, 64) | onechar('_', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('w', 16, 32) | onechar('e', 24, 32):
switch(in[12]){
case onechar('r', 0, 8):
return gtok_t_power::DYNAMIC_POWER;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <power>.");
}
inline atok_t_power alex_t_power(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('e', 8, 32) | onechar('t', 16, 32) | onechar('h', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('d', 0, 8):
return atok_t_power::METHOD;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <power>.");
}
inline gtok_t_global_power glex_t_global_power(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('F', 0, 32) | onechar('F', 8, 32) | onechar('_', 16, 32) | onechar('s', 24, 32):
switch(in[4]){
case onechar('i', 0, 8):
switch(in[5]){
case onechar('z', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return gtok_t_global_power::FF_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('b', 0, 32) | onechar('u', 8, 32) | onechar('f', 16, 32) | onechar('f', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('s', 0, 8):
return gtok_t_global_power::BUFFERS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 18:
switch(*((triehash_uu64*)&in[0])){
case onechar('l', 0, 64) | onechar('o', 8, 64) | onechar('c', 16, 64) | onechar('a', 24, 64) | onechar('l', 32, 64) | onechar('_', 40, 64) | onechar('i', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('t', 0, 64) | onechar('e', 8, 64) | onechar('r', 16, 64) | onechar('c', 24, 64) | onechar('o', 32, 64) | onechar('n', 40, 64) | onechar('n', 48, 64) | onechar('e', 56, 64):
switch(in[16]){
case onechar('c', 0, 8):
switch(in[17]){
case onechar('t', 0, 8):
return gtok_t_global_power::LOCAL_INTERCONNECT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 19:
switch(*((triehash_uu64*)&in[0])){
case onechar('L', 0, 64) | onechar('U', 8, 64) | onechar('T', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('r', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('s', 0, 64) | onechar('i', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('o', 32, 64) | onechar('r', 40, 64) | onechar('_', 48, 64) | onechar('s', 56, 64):
switch(in[16]){
case onechar('i', 0, 8):
switch(in[17]){
case onechar('z', 0, 8):
switch(in[18]){
case onechar('e', 0, 8):
return gtok_t_global_power::LUT_TRANSISTOR_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('m', 0, 64) | onechar('u', 8, 64) | onechar('x', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('r', 40, 64) | onechar('a', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('s', 0, 64) | onechar('i', 8, 64) | onechar('s', 16, 64) | onechar('t', 24, 64) | onechar('o', 32, 64) | onechar('r', 40, 64) | onechar('_', 48, 64) | onechar('s', 56, 64):
switch(in[16]){
case onechar('i', 0, 8):
switch(in[17]){
case onechar('z', 0, 8):
switch(in[18]){
case onechar('e', 0, 8):
return gtok_t_global_power::MUX_TRANSISTOR_SIZE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <global_power>.");
}
inline atok_t_global_power alex_t_global_power(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('e', 8, 32) | onechar('t', 16, 32) | onechar('h', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('d', 0, 8):
return atok_t_global_power::METHOD;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <global_power>.");
}
inline gtok_t_pinlocations glex_t_pinlocations(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('l', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('c', 0, 8):
return gtok_t_pinlocations::LOC;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <pinlocations>.");
}
inline atok_t_pinlocations alex_t_pinlocations(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('a', 8, 32) | onechar('t', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('n', 0, 8):
return atok_t_pinlocations::PATTERN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <pinlocations>.");
}
inline gtok_t_switchblock_locations glex_t_switchblock_locations(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('b', 8, 32) | onechar('_', 16, 32) | onechar('l', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('c', 0, 8):
return gtok_t_switchblock_locations::SB_LOC;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <switchblock_locations>.");
}
inline atok_t_switchblock_locations alex_t_switchblock_locations(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('a', 8, 32) | onechar('t', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('n', 0, 8):
return atok_t_switchblock_locations::PATTERN;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 15:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('t', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('n', 40, 64) | onechar('a', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('_', 0, 32) | onechar('s', 8, 32) | onechar('w', 16, 32) | onechar('i', 24, 32):
switch(in[12]){
case onechar('t', 0, 8):
switch(in[13]){
case onechar('c', 0, 8):
switch(in[14]){
case onechar('h', 0, 8):
return atok_t_switchblock_locations::INTERNAL_SWITCH;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <switchblock_locations>.");
}
inline gtok_t_fc glex_t_fc(const char *in){
unsigned int len = strlen(in);
switch(len){
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('f', 0, 64) | onechar('c', 8, 64) | onechar('_', 16, 64) | onechar('o', 24, 64) | onechar('v', 32, 64) | onechar('e', 40, 64) | onechar('r', 48, 64) | onechar('r', 56, 64):
switch(in[8]){
case onechar('i', 0, 8):
switch(in[9]){
case onechar('d', 0, 8):
switch(in[10]){
case onechar('e', 0, 8):
return gtok_t_fc::FC_OVERRIDE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <fc>.");
}
inline atok_t_fc alex_t_fc(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('v', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('l', 0, 8):
return atok_t_fc::IN_VAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return atok_t_fc::IN_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('o', 0, 32) | onechar('u', 8, 32) | onechar('t', 16, 32) | onechar('_', 24, 32):
switch(in[4]){
case onechar('v', 0, 8):
switch(in[5]){
case onechar('a', 0, 8):
switch(in[6]){
case onechar('l', 0, 8):
return atok_t_fc::OUT_VAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('y', 40, 64) | onechar('p', 48, 64) | onechar('e', 56, 64):
return atok_t_fc::OUT_TYPE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <fc>.");
}
inline gtok_t_tile_mode glex_t_tile_mode(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('a', 0, 8):
switch(in[2]){
case onechar('p', 0, 8):
return gtok_t_tile_mode::MAP;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <tile_mode>.");
}
inline atok_t_tile_mode alex_t_tile_mode(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_tile_mode::NAME;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <tile_mode>.");
}
inline gtok_t_segment glex_t_segment(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('c', 0, 8):
switch(in[1]){
case onechar('b', 0, 8):
return gtok_t_segment::CB;
break;
default: break;
}
break;
case onechar('s', 0, 8):
switch(in[1]){
case onechar('b', 0, 8):
return gtok_t_segment::SB;
break;
default: break;
}
break;
default: break;
}
break;
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('u', 0, 8):
switch(in[2]){
case onechar('x', 0, 8):
return gtok_t_segment::MUX;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('p', 8, 64) | onechar('i', 16, 64) | onechar('n', 24, 64) | onechar('_', 32, 64) | onechar('s', 40, 64) | onechar('w', 48, 64) | onechar('i', 56, 64):
switch(in[8]){
case onechar('t', 0, 8):
switch(in[9]){
case onechar('c', 0, 8):
switch(in[10]){
case onechar('h', 0, 8):
return gtok_t_segment::OPIN_SWITCH;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('w', 0, 64) | onechar('i', 8, 64) | onechar('r', 16, 64) | onechar('e', 24, 64) | onechar('_', 32, 64) | onechar('s', 40, 64) | onechar('w', 48, 64) | onechar('i', 56, 64):
switch(in[8]){
case onechar('t', 0, 8):
switch(in[9]){
case onechar('c', 0, 8):
switch(in[10]){
case onechar('h', 0, 8):
return gtok_t_segment::WIRE_SWITCH;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <segment>.");
}
inline atok_t_segment alex_t_segment(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('r', 8, 32) | onechar('e', 16, 32) | onechar('q', 24, 32):
return atok_t_segment::FREQ;
break;
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_segment::NAME;
break;
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_segment::TYPE;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('C', 0, 32) | onechar('m', 8, 32) | onechar('e', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('l', 0, 8):
return atok_t_segment::CMETAL;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('R', 0, 32) | onechar('m', 8, 32) | onechar('e', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('a', 0, 8):
switch(in[5]){
case onechar('l', 0, 8):
return atok_t_segment::RMETAL;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('l', 0, 32) | onechar('e', 8, 32) | onechar('n', 16, 32) | onechar('g', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
switch(in[5]){
case onechar('h', 0, 8):
return atok_t_segment::LENGTH;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <segment>.");
}
inline gtok_t_directlist glex_t_directlist(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('d', 0, 32) | onechar('i', 8, 32) | onechar('r', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('c', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return gtok_t_directlist::DIRECT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <directlist>.");
}
inline gtok_t_switchblock_func glex_t_switchblock_func(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('u', 8, 32) | onechar('n', 16, 32) | onechar('c', 24, 32):
return gtok_t_switchblock_func::FUNC;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <switchblock_func>.");
}
inline gtok_t_wireconn glex_t_wireconn(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('t', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
return gtok_t_wireconn::TO;
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('r', 8, 32) | onechar('o', 16, 32) | onechar('m', 24, 32):
return gtok_t_wireconn::FROM;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <wireconn>.");
}
inline atok_t_wireconn alex_t_wireconn(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('o', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return atok_t_wireconn::TO_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('f', 0, 64) | onechar('r', 8, 64) | onechar('o', 16, 64) | onechar('m', 24, 64) | onechar('_', 32, 64) | onechar('t', 40, 64) | onechar('y', 48, 64) | onechar('p', 56, 64):
switch(in[8]){
case onechar('e', 0, 8):
return atok_t_wireconn::FROM_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
case 14:
switch(*((triehash_uu64*)&in[0])){
case onechar('n', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('_', 24, 64) | onechar('c', 32, 64) | onechar('o', 40, 64) | onechar('n', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('s', 0, 32) | onechar('_', 8, 32) | onechar('t', 16, 32) | onechar('y', 24, 32):
switch(in[12]){
case onechar('p', 0, 8):
switch(in[13]){
case onechar('e', 0, 8):
return atok_t_wireconn::NUM_CONNS_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('t', 0, 64) | onechar('o', 8, 64) | onechar('_', 16, 64) | onechar('s', 24, 64) | onechar('w', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('c', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('h', 0, 32) | onechar('p', 8, 32) | onechar('o', 16, 32) | onechar('i', 24, 32):
switch(in[12]){
case onechar('n', 0, 8):
switch(in[13]){
case onechar('t', 0, 8):
return atok_t_wireconn::TO_SWITCHPOINT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 16:
switch(*((triehash_uu64*)&in[0])){
case onechar('f', 0, 64) | onechar('r', 8, 64) | onechar('o', 16, 64) | onechar('m', 24, 64) | onechar('_', 32, 64) | onechar('s', 40, 64) | onechar('w', 48, 64) | onechar('i', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('t', 0, 64) | onechar('c', 8, 64) | onechar('h', 16, 64) | onechar('p', 24, 64) | onechar('o', 32, 64) | onechar('i', 40, 64) | onechar('n', 48, 64) | onechar('t', 56, 64):
return atok_t_wireconn::FROM_SWITCHPOINT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <wireconn>.");
}
inline gtok_t_clocks glex_t_clocks(const char *in){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('o', 16, 32) | onechar('c', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
return gtok_t_clocks::CLOCK;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <clocks>.");
}
inline gtok_t_model_type glex_t_model_type(const char *in){
unsigned int len = strlen(in);
switch(len){
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('p', 16, 64) | onechar('u', 24, 64) | onechar('t', 32, 64) | onechar('_', 40, 64) | onechar('p', 48, 64) | onechar('o', 56, 64):
switch(in[8]){
case onechar('r', 0, 8):
switch(in[9]){
case onechar('t', 0, 8):
switch(in[10]){
case onechar('s', 0, 8):
return gtok_t_model_type::INPUT_PORTS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('o', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('p', 24, 64) | onechar('u', 32, 64) | onechar('t', 40, 64) | onechar('_', 48, 64) | onechar('p', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('o', 0, 32) | onechar('r', 8, 32) | onechar('t', 16, 32) | onechar('s', 24, 32):
return gtok_t_model_type::OUTPUT_PORTS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <model_type>.");
}
inline atok_t_model_type alex_t_model_type(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_model_type::NAME;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <model_type>.");
}
inline gtok_t_single glex_t_single(const char *in){
unsigned int len = strlen(in);
switch(len){
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('e', 8, 64) | onechar('t', 16, 64) | onechar('a', 24, 64) | onechar('d', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('a', 56, 64):
return gtok_t_single::METADATA;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <single>.");
}
inline atok_t_single alex_t_single(const char *in){
unsigned int len = strlen(in);
switch(len){
case 1:
switch(in[0]){
case onechar('x', 0, 8):
return atok_t_single::X;
break;
case onechar('y', 0, 8):
return atok_t_single::Y;
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_single::TYPE;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('r', 8, 64) | onechar('i', 16, 64) | onechar('o', 24, 64) | onechar('r', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_single::PRIORITY;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <single>.");
}
inline gtok_t_device glex_t_device(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('a', 0, 32) | onechar('r', 8, 32) | onechar('e', 16, 32) | onechar('a', 24, 32):
return gtok_t_device::AREA;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('i', 8, 32) | onechar('z', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('n', 0, 8):
switch(in[5]){
case onechar('g', 0, 8):
return gtok_t_device::SIZING;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('e', 8, 64) | onechar('f', 16, 64) | onechar('a', 24, 64) | onechar('u', 32, 64) | onechar('l', 40, 64) | onechar('t', 48, 64) | onechar('_', 56, 64):
switch(in[8]){
case onechar('f', 0, 8):
switch(in[9]){
case onechar('c', 0, 8):
return gtok_t_device::DEFAULT_FC;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('_', 48, 64) | onechar('b', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('l', 0, 32) | onechar('o', 8, 32) | onechar('c', 16, 32) | onechar('k', 24, 32):
return gtok_t_device::SWITCH_BLOCK;
break;
default: break;
}
break;
default: break;
}
break;
case 16:
switch(*((triehash_uu64*)&in[0])){
case onechar('c', 0, 64) | onechar('h', 8, 64) | onechar('a', 16, 64) | onechar('n', 24, 64) | onechar('_', 32, 64) | onechar('w', 40, 64) | onechar('i', 48, 64) | onechar('d', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('t', 0, 64) | onechar('h', 8, 64) | onechar('_', 16, 64) | onechar('d', 24, 64) | onechar('i', 32, 64) | onechar('s', 40, 64) | onechar('t', 48, 64) | onechar('r', 56, 64):
return gtok_t_device::CHAN_WIDTH_DISTR;
break;
default: break;
}
break;
case onechar('c', 0, 64) | onechar('o', 8, 64) | onechar('n', 16, 64) | onechar('n', 24, 64) | onechar('e', 32, 64) | onechar('c', 40, 64) | onechar('t', 48, 64) | onechar('i', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('o', 0, 64) | onechar('n', 8, 64) | onechar('_', 16, 64) | onechar('b', 24, 64) | onechar('l', 32, 64) | onechar('o', 40, 64) | onechar('c', 48, 64) | onechar('k', 56, 64):
return gtok_t_device::CONNECTION_BLOCK;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <device>.");
}
inline gtok_t_switchlist glex_t_switchlist(const char *in){
unsigned int len = strlen(in);
switch(len){
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('w', 8, 32) | onechar('i', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('c', 0, 8):
switch(in[5]){
case onechar('h', 0, 8):
return gtok_t_switchlist::SWITCH;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <switchlist>.");
}
inline gtok_t_pb_type_input glex_t_pb_type_input(const char *in){
unsigned int len = strlen(in);
switch(len){
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('e', 8, 64) | onechar('t', 16, 64) | onechar('a', 24, 64) | onechar('d', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('a', 56, 64):
return gtok_t_pb_type_input::METADATA;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <pb_type_input>.");
}
inline atok_t_pb_type_input alex_t_pb_type_input(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_pb_type_input::NAME;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('n', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('i', 40, 64) | onechar('n', 48, 64) | onechar('s', 56, 64):
return atok_t_pb_type_input::NUM_PINS;
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('q', 8, 64) | onechar('u', 16, 64) | onechar('i', 24, 64) | onechar('v', 32, 64) | onechar('a', 40, 64) | onechar('l', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('n', 0, 8):
switch(in[9]){
case onechar('t', 0, 8):
return atok_t_pb_type_input::EQUIVALENT;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('r', 16, 64) | onechar('t', 24, 64) | onechar('_', 32, 64) | onechar('c', 40, 64) | onechar('l', 48, 64) | onechar('a', 56, 64):
switch(in[8]){
case onechar('s', 0, 8):
switch(in[9]){
case onechar('s', 0, 8):
return atok_t_pb_type_input::PORT_CLASS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 19:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('s', 8, 64) | onechar('_', 16, 64) | onechar('n', 24, 64) | onechar('o', 32, 64) | onechar('n', 40, 64) | onechar('_', 48, 64) | onechar('c', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('l', 0, 64) | onechar('o', 8, 64) | onechar('c', 16, 64) | onechar('k', 24, 64) | onechar('_', 32, 64) | onechar('g', 40, 64) | onechar('l', 48, 64) | onechar('o', 56, 64):
switch(in[16]){
case onechar('b', 0, 8):
switch(in[17]){
case onechar('a', 0, 8):
switch(in[18]){
case onechar('l', 0, 8):
return atok_t_pb_type_input::IS_NON_CLOCK_GLOBAL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <pb_type_input>.");
}
inline gtok_t_pb_type_output glex_t_pb_type_output(const char *in){
unsigned int len = strlen(in);
switch(len){
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('e', 8, 64) | onechar('t', 16, 64) | onechar('a', 24, 64) | onechar('d', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('a', 56, 64):
return gtok_t_pb_type_output::METADATA;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <pb_type_output>.");
}
inline atok_t_pb_type_output alex_t_pb_type_output(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_pb_type_output::NAME;
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('n', 0, 64) | onechar('u', 8, 64) | onechar('m', 16, 64) | onechar('_', 24, 64) | onechar('p', 32, 64) | onechar('i', 40, 64) | onechar('n', 48, 64) | onechar('s', 56, 64):
return atok_t_pb_type_output::NUM_PINS;
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('q', 8, 64) | onechar('u', 16, 64) | onechar('i', 24, 64) | onechar('v', 32, 64) | onechar('a', 40, 64) | onechar('l', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('n', 0, 8):
switch(in[9]){
case onechar('t', 0, 8):
return atok_t_pb_type_output::EQUIVALENT;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('o', 8, 64) | onechar('r', 16, 64) | onechar('t', 24, 64) | onechar('_', 32, 64) | onechar('c', 40, 64) | onechar('l', 48, 64) | onechar('a', 56, 64):
switch(in[8]){
case onechar('s', 0, 8):
switch(in[9]){
case onechar('s', 0, 8):
return atok_t_pb_type_output::PORT_CLASS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <pb_type_output>.");
}
inline gtok_t_interconnect_type glex_t_interconnect_type(const char *in){
unsigned int len = strlen(in);
switch(len){
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('e', 8, 64) | onechar('t', 16, 64) | onechar('a', 24, 64) | onechar('d', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('a', 56, 64):
return gtok_t_interconnect_type::METADATA;
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('e', 8, 64) | onechar('l', 16, 64) | onechar('a', 24, 64) | onechar('y', 32, 64) | onechar('_', 40, 64) | onechar('m', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('t', 0, 32) | onechar('r', 8, 32) | onechar('i', 16, 32) | onechar('x', 24, 32):
return gtok_t_interconnect_type::DELAY_MATRIX;
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('a', 8, 64) | onechar('c', 16, 64) | onechar('k', 24, 64) | onechar('_', 32, 64) | onechar('p', 40, 64) | onechar('a', 48, 64) | onechar('t', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('t', 0, 32) | onechar('e', 8, 32) | onechar('r', 16, 32) | onechar('n', 24, 32):
return gtok_t_interconnect_type::PACK_PATTERN;
break;
default: break;
}
break;
default: break;
}
break;
case 14:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('e', 8, 64) | onechar('l', 16, 64) | onechar('a', 24, 64) | onechar('y', 32, 64) | onechar('_', 40, 64) | onechar('c', 48, 64) | onechar('o', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('n', 0, 32) | onechar('s', 8, 32) | onechar('t', 16, 32) | onechar('a', 24, 32):
switch(in[12]){
case onechar('n', 0, 8):
switch(in[13]){
case onechar('t', 0, 8):
return gtok_t_interconnect_type::DELAY_CONSTANT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <interconnect_type>.");
}
inline atok_t_interconnect_type alex_t_interconnect_type(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_interconnect_type::NAME;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('p', 16, 32) | onechar('u', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
return atok_t_interconnect_type::INPUT;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('o', 0, 32) | onechar('u', 8, 32) | onechar('t', 16, 32) | onechar('p', 24, 32):
switch(in[4]){
case onechar('u', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return atok_t_interconnect_type::OUTPUT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <interconnect_type>.");
}
inline gtok_t_equivalent_tiles glex_t_equivalent_tiles(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('o', 8, 32) | onechar('d', 16, 32) | onechar('e', 24, 32):
return gtok_t_equivalent_tiles::MODE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <equivalent_tiles>.");
}
inline gtok_t_segmentlist glex_t_segmentlist(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('s', 0, 32) | onechar('e', 8, 32) | onechar('g', 16, 32) | onechar('m', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('n', 0, 8):
switch(in[6]){
case onechar('t', 0, 8):
return gtok_t_segmentlist::SEGMENT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <segmentlist>.");
}
inline gtok_t_switchblock glex_t_switchblock(const char *in){
unsigned int len = strlen(in);
switch(len){
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('w', 0, 64) | onechar('i', 8, 64) | onechar('r', 16, 64) | onechar('e', 24, 64) | onechar('c', 32, 64) | onechar('o', 40, 64) | onechar('n', 48, 64) | onechar('n', 56, 64):
return gtok_t_switchblock::WIRECONN;
break;
default: break;
}
break;
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('f', 48, 64) | onechar('u', 56, 64):
switch(in[8]){
case onechar('n', 0, 8):
switch(in[9]){
case onechar('c', 0, 8):
switch(in[10]){
case onechar('s', 0, 8):
return gtok_t_switchblock::SWITCHFUNCS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 20:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('b', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('o', 0, 64) | onechar('c', 8, 64) | onechar('k', 16, 64) | onechar('_', 24, 64) | onechar('l', 32, 64) | onechar('o', 40, 64) | onechar('c', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('t', 0, 32) | onechar('i', 8, 32) | onechar('o', 16, 32) | onechar('n', 24, 32):
return gtok_t_switchblock::SWITCHBLOCK_LOCATION;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <switchblock>.");
}
inline atok_t_switchblock alex_t_switchblock(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_switchblock::NAME;
break;
case onechar('t', 0, 32) | onechar('y', 8, 32) | onechar('p', 16, 32) | onechar('e', 24, 32):
return atok_t_switchblock::TYPE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <switchblock>.");
}
inline gtok_t_models glex_t_models(const char *in){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('o', 8, 32) | onechar('d', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('l', 0, 8):
return gtok_t_models::MODEL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <models>.");
}
inline gtok_t_layout_info glex_t_layout_info(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('c', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('l', 0, 8):
return gtok_t_layout_info::COL;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('r', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('w', 0, 8):
return gtok_t_layout_info::ROW;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return gtok_t_layout_info::FILL;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('e', 8, 32) | onechar('g', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('n', 0, 8):
return gtok_t_layout_info::REGION;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('s', 0, 32) | onechar('i', 8, 32) | onechar('n', 16, 32) | onechar('g', 24, 32):
switch(in[4]){
case onechar('l', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return gtok_t_layout_info::SINGLE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('n', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('s', 0, 8):
return gtok_t_layout_info::CORNERS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('e', 8, 64) | onechar('r', 16, 64) | onechar('i', 24, 64) | onechar('m', 32, 64) | onechar('e', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('r', 0, 8):
return gtok_t_layout_info::PERIMETER;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <layout_info>.");
}
inline gtok_t_auto_layout glex_t_auto_layout(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('c', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('l', 0, 8):
return gtok_t_auto_layout::COL;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('r', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('w', 0, 8):
return gtok_t_auto_layout::ROW;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return gtok_t_auto_layout::FILL;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('e', 8, 32) | onechar('g', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('n', 0, 8):
return gtok_t_auto_layout::REGION;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('s', 0, 32) | onechar('i', 8, 32) | onechar('n', 16, 32) | onechar('g', 24, 32):
switch(in[4]){
case onechar('l', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return gtok_t_auto_layout::SINGLE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('n', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('s', 0, 8):
return gtok_t_auto_layout::CORNERS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('e', 8, 64) | onechar('r', 16, 64) | onechar('i', 24, 64) | onechar('m', 32, 64) | onechar('e', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('r', 0, 8):
return gtok_t_auto_layout::PERIMETER;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <auto_layout>.");
}
inline atok_t_auto_layout alex_t_auto_layout(const char *in){
unsigned int len = strlen(in);
switch(len){
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('a', 0, 64) | onechar('s', 8, 64) | onechar('p', 16, 64) | onechar('e', 24, 64) | onechar('c', 32, 64) | onechar('t', 40, 64) | onechar('_', 48, 64) | onechar('r', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('a', 0, 32) | onechar('t', 8, 32) | onechar('i', 16, 32) | onechar('o', 24, 32):
return atok_t_auto_layout::ASPECT_RATIO;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <auto_layout>.");
}
inline gtok_t_fixed_layout glex_t_fixed_layout(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('c', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('l', 0, 8):
return gtok_t_fixed_layout::COL;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('r', 0, 8):
switch(in[1]){
case onechar('o', 0, 8):
switch(in[2]){
case onechar('w', 0, 8):
return gtok_t_fixed_layout::ROW;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('f', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('l', 24, 32):
return gtok_t_fixed_layout::FILL;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('r', 0, 32) | onechar('e', 8, 32) | onechar('g', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('o', 0, 8):
switch(in[5]){
case onechar('n', 0, 8):
return gtok_t_fixed_layout::REGION;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('s', 0, 32) | onechar('i', 8, 32) | onechar('n', 16, 32) | onechar('g', 24, 32):
switch(in[4]){
case onechar('l', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return gtok_t_fixed_layout::SINGLE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('o', 8, 32) | onechar('r', 16, 32) | onechar('n', 24, 32):
switch(in[4]){
case onechar('e', 0, 8):
switch(in[5]){
case onechar('r', 0, 8):
switch(in[6]){
case onechar('s', 0, 8):
return gtok_t_fixed_layout::CORNERS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 9:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('e', 8, 64) | onechar('r', 16, 64) | onechar('i', 24, 64) | onechar('m', 32, 64) | onechar('e', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
switch(in[8]){
case onechar('r', 0, 8):
return gtok_t_fixed_layout::PERIMETER;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <fixed_layout>.");
}
inline atok_t_fixed_layout alex_t_fixed_layout(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_fixed_layout::NAME;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('w', 0, 32) | onechar('i', 8, 32) | onechar('d', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('h', 0, 8):
return atok_t_fixed_layout::WIDTH;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('h', 0, 32) | onechar('e', 8, 32) | onechar('i', 16, 32) | onechar('g', 24, 32):
switch(in[4]){
case onechar('h', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return atok_t_fixed_layout::HEIGHT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <fixed_layout>.");
}
inline gtok_t_interconnect glex_t_interconnect(const char *in){
unsigned int len = strlen(in);
switch(len){
case 3:
switch(in[0]){
case onechar('m', 0, 8):
switch(in[1]){
case onechar('u', 0, 8):
switch(in[2]){
case onechar('x', 0, 8):
return gtok_t_interconnect::MUX;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('d', 0, 32) | onechar('i', 8, 32) | onechar('r', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('c', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return gtok_t_interconnect::DIRECT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('c', 0, 64) | onechar('o', 8, 64) | onechar('m', 16, 64) | onechar('p', 24, 64) | onechar('l', 32, 64) | onechar('e', 40, 64) | onechar('t', 48, 64) | onechar('e', 56, 64):
return gtok_t_interconnect::COMPLETE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <interconnect>.");
}
inline gtok_t_tile glex_t_tile(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('f', 0, 8):
switch(in[1]){
case onechar('c', 0, 8):
return gtok_t_tile::FC;
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('p', 0, 64) | onechar('i', 8, 64) | onechar('n', 16, 64) | onechar('l', 24, 64) | onechar('o', 32, 64) | onechar('c', 40, 64) | onechar('a', 48, 64) | onechar('t', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('i', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('s', 24, 32):
return gtok_t_tile::PINLOCATIONS;
break;
default: break;
}
break;
default: break;
}
break;
case 16:
switch(*((triehash_uu64*)&in[0])){
case onechar('e', 0, 64) | onechar('q', 8, 64) | onechar('u', 16, 64) | onechar('i', 24, 64) | onechar('v', 32, 64) | onechar('a', 40, 64) | onechar('l', 48, 64) | onechar('e', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('n', 0, 64) | onechar('t', 8, 64) | onechar('_', 16, 64) | onechar('t', 24, 64) | onechar('i', 32, 64) | onechar('l', 40, 64) | onechar('e', 48, 64) | onechar('s', 56, 64):
return gtok_t_tile::EQUIVALENT_TILES;
break;
default: break;
}
break;
default: break;
}
break;
case 21:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('b', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('o', 0, 64) | onechar('c', 8, 64) | onechar('k', 16, 64) | onechar('_', 24, 64) | onechar('l', 32, 64) | onechar('o', 40, 64) | onechar('c', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('t', 0, 32) | onechar('i', 8, 32) | onechar('o', 16, 32) | onechar('n', 24, 32):
switch(in[20]){
case onechar('s', 0, 8):
return gtok_t_tile::SWITCHBLOCK_LOCATIONS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <tile>.");
}
inline atok_t_tile alex_t_tile(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_tile::NAME;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <tile>.");
}
inline gtok_t_switchblocklist glex_t_switchblocklist(const char *in){
unsigned int len = strlen(in);
switch(len){
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('b', 48, 64) | onechar('l', 56, 64):
switch(in[8]){
case onechar('o', 0, 8):
switch(in[9]){
case onechar('c', 0, 8):
switch(in[10]){
case onechar('k', 0, 8):
return gtok_t_switchblocklist::SWITCHBLOCK;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <switchblocklist>.");
}
inline gtok_t_layout glex_t_layout(const char *in){
unsigned int len = strlen(in);
switch(len){
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('a', 0, 64) | onechar('u', 8, 64) | onechar('t', 16, 64) | onechar('o', 24, 64) | onechar('_', 32, 64) | onechar('l', 40, 64) | onechar('a', 48, 64) | onechar('y', 56, 64):
switch(in[8]){
case onechar('o', 0, 8):
switch(in[9]){
case onechar('u', 0, 8):
switch(in[10]){
case onechar('t', 0, 8):
return gtok_t_layout::AUTO_LAYOUT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('f', 0, 64) | onechar('i', 8, 64) | onechar('x', 16, 64) | onechar('e', 24, 64) | onechar('d', 32, 64) | onechar('_', 40, 64) | onechar('l', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('y', 0, 32) | onechar('o', 8, 32) | onechar('u', 16, 32) | onechar('t', 24, 32):
return gtok_t_layout::FIXED_LAYOUT;
break;
default: break;
}
break;
default: break;
}
break;
case 13:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('e', 8, 64) | onechar('v', 16, 64) | onechar('i', 24, 64) | onechar('c', 32, 64) | onechar('e', 40, 64) | onechar('_', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('a', 0, 32) | onechar('y', 8, 32) | onechar('o', 16, 32) | onechar('u', 24, 32):
switch(in[12]){
case onechar('t', 0, 8):
return gtok_t_layout::DEVICE_LAYOUT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <layout>.");
}
inline gtok_t_mode glex_t_mode(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('b', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return gtok_t_mode::PB_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('e', 8, 64) | onechar('t', 16, 64) | onechar('a', 24, 64) | onechar('d', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('a', 56, 64):
return gtok_t_mode::METADATA;
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('t', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('c', 40, 64) | onechar('o', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('n', 0, 32) | onechar('e', 8, 32) | onechar('c', 16, 32) | onechar('t', 24, 32):
return gtok_t_mode::INTERCONNECT;
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('i', 8, 64) | onechar('n', 16, 64) | onechar('l', 24, 64) | onechar('o', 32, 64) | onechar('c', 40, 64) | onechar('a', 48, 64) | onechar('t', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('i', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('s', 24, 32):
return gtok_t_mode::PINLOCATIONS;
break;
default: break;
}
break;
default: break;
}
break;
case 21:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('b', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('o', 0, 64) | onechar('c', 8, 64) | onechar('k', 16, 64) | onechar('_', 24, 64) | onechar('l', 32, 64) | onechar('o', 40, 64) | onechar('c', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('t', 0, 32) | onechar('i', 8, 32) | onechar('o', 16, 32) | onechar('n', 24, 32):
switch(in[20]){
case onechar('s', 0, 8):
return gtok_t_mode::SWITCHBLOCK_LOCATIONS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <mode>.");
}
inline atok_t_mode alex_t_mode(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_mode::NAME;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <mode>.");
}
inline gtok_t_tiles glex_t_tiles(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('t', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('e', 24, 32):
return gtok_t_tiles::TILE;
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <tiles>.");
}
inline gtok_t_pb_type glex_t_pb_type(const char *in){
unsigned int len = strlen(in);
switch(len){
case 2:
switch(in[0]){
case onechar('f', 0, 8):
switch(in[1]){
case onechar('c', 0, 8):
return gtok_t_pb_type::FC;
break;
default: break;
}
break;
default: break;
}
break;
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('m', 0, 32) | onechar('o', 8, 32) | onechar('d', 16, 32) | onechar('e', 24, 32):
return gtok_t_pb_type::MODE;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('o', 16, 32) | onechar('c', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
return gtok_t_pb_type::CLOCK;
break;
default: break;
}
break;
case onechar('i', 0, 32) | onechar('n', 8, 32) | onechar('p', 16, 32) | onechar('u', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
return gtok_t_pb_type::INPUT;
break;
default: break;
}
break;
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('w', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
return gtok_t_pb_type::POWER;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('T', 0, 32) | onechar('_', 8, 32) | onechar('h', 16, 32) | onechar('o', 24, 32):
switch(in[4]){
case onechar('l', 0, 8):
switch(in[5]){
case onechar('d', 0, 8):
return gtok_t_pb_type::T_HOLD;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('o', 0, 32) | onechar('u', 8, 32) | onechar('t', 16, 32) | onechar('p', 24, 32):
switch(in[4]){
case onechar('u', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return gtok_t_pb_type::OUTPUT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('T', 0, 32) | onechar('_', 8, 32) | onechar('s', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('t', 0, 8):
switch(in[5]){
case onechar('u', 0, 8):
switch(in[6]){
case onechar('p', 0, 8):
return gtok_t_pb_type::T_SETUP;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case onechar('p', 0, 32) | onechar('b', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return gtok_t_pb_type::PB_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('m', 0, 64) | onechar('e', 8, 64) | onechar('t', 16, 64) | onechar('a', 24, 64) | onechar('d', 32, 64) | onechar('a', 40, 64) | onechar('t', 48, 64) | onechar('a', 56, 64):
return gtok_t_pb_type::METADATA;
break;
default: break;
}
break;
case 12:
switch(*((triehash_uu64*)&in[0])){
case onechar('T', 0, 64) | onechar('_', 8, 64) | onechar('c', 16, 64) | onechar('l', 24, 64) | onechar('o', 32, 64) | onechar('c', 40, 64) | onechar('k', 48, 64) | onechar('_', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('t', 0, 32) | onechar('o', 8, 32) | onechar('_', 16, 32) | onechar('Q', 24, 32):
return gtok_t_pb_type::T_CLOCK_TO_Q;
break;
default: break;
}
break;
case onechar('d', 0, 64) | onechar('e', 8, 64) | onechar('l', 16, 64) | onechar('a', 24, 64) | onechar('y', 32, 64) | onechar('_', 40, 64) | onechar('m', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('t', 0, 32) | onechar('r', 8, 32) | onechar('i', 16, 32) | onechar('x', 24, 32):
return gtok_t_pb_type::DELAY_MATRIX;
break;
default: break;
}
break;
case onechar('i', 0, 64) | onechar('n', 8, 64) | onechar('t', 16, 64) | onechar('e', 24, 64) | onechar('r', 32, 64) | onechar('c', 40, 64) | onechar('o', 48, 64) | onechar('n', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('n', 0, 32) | onechar('e', 8, 32) | onechar('c', 16, 32) | onechar('t', 24, 32):
return gtok_t_pb_type::INTERCONNECT;
break;
default: break;
}
break;
case onechar('p', 0, 64) | onechar('i', 8, 64) | onechar('n', 16, 64) | onechar('l', 24, 64) | onechar('o', 32, 64) | onechar('c', 40, 64) | onechar('a', 48, 64) | onechar('t', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('i', 0, 32) | onechar('o', 8, 32) | onechar('n', 16, 32) | onechar('s', 24, 32):
return gtok_t_pb_type::PINLOCATIONS;
break;
default: break;
}
break;
default: break;
}
break;
case 14:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('e', 8, 64) | onechar('l', 16, 64) | onechar('a', 24, 64) | onechar('y', 32, 64) | onechar('_', 40, 64) | onechar('c', 48, 64) | onechar('o', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('n', 0, 32) | onechar('s', 8, 32) | onechar('t', 16, 32) | onechar('a', 24, 32):
switch(in[12]){
case onechar('n', 0, 8):
switch(in[13]){
case onechar('t', 0, 8):
return gtok_t_pb_type::DELAY_CONSTANT;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 21:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('b', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('o', 0, 64) | onechar('c', 8, 64) | onechar('k', 16, 64) | onechar('_', 24, 64) | onechar('l', 32, 64) | onechar('o', 40, 64) | onechar('c', 48, 64) | onechar('a', 56, 64):
switch(*((triehash_uu32*)&in[16])){
case onechar('t', 0, 32) | onechar('i', 8, 32) | onechar('o', 16, 32) | onechar('n', 24, 32):
switch(in[20]){
case onechar('s', 0, 8):
return gtok_t_pb_type::SWITCHBLOCK_LOCATIONS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <pb_type>.");
}
inline atok_t_pb_type alex_t_pb_type(const char *in){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('a', 0, 32) | onechar('r', 8, 32) | onechar('e', 16, 32) | onechar('a', 24, 32):
return atok_t_pb_type::AREA;
break;
case onechar('n', 0, 32) | onechar('a', 8, 32) | onechar('m', 16, 32) | onechar('e', 24, 32):
return atok_t_pb_type::NAME;
break;
default: break;
}
break;
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('a', 16, 32) | onechar('s', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
return atok_t_pb_type::CLASS;
break;
default: break;
}
break;
case onechar('w', 0, 32) | onechar('i', 8, 32) | onechar('d', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('h', 0, 8):
return atok_t_pb_type::WIDTH;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('h', 0, 32) | onechar('e', 8, 32) | onechar('i', 16, 32) | onechar('g', 24, 32):
switch(in[4]){
case onechar('h', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return atok_t_pb_type::HEIGHT;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('n', 0, 32) | onechar('u', 8, 32) | onechar('m', 16, 32) | onechar('_', 24, 32):
switch(in[4]){
case onechar('p', 0, 8):
switch(in[5]){
case onechar('b', 0, 8):
return atok_t_pb_type::NUM_PB;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 8:
switch(*((triehash_uu64*)&in[0])){
case onechar('c', 0, 64) | onechar('a', 8, 64) | onechar('p', 16, 64) | onechar('a', 24, 64) | onechar('c', 32, 64) | onechar('i', 40, 64) | onechar('t', 48, 64) | onechar('y', 56, 64):
return atok_t_pb_type::CAPACITY;
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('b', 0, 64) | onechar('l', 8, 64) | onechar('i', 16, 64) | onechar('f', 24, 64) | onechar('_', 32, 64) | onechar('m', 40, 64) | onechar('o', 48, 64) | onechar('d', 56, 64):
switch(in[8]){
case onechar('e', 0, 8):
switch(in[9]){
case onechar('l', 0, 8):
return atok_t_pb_type::BLIF_MODEL;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized attribute " + std::string(in) + " of <pb_type>.");
}
inline gtok_t_complexblocklist glex_t_complexblocklist(const char *in){
unsigned int len = strlen(in);
switch(len){
case 7:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('b', 8, 32) | onechar('_', 16, 32) | onechar('t', 24, 32):
switch(in[4]){
case onechar('y', 0, 8):
switch(in[5]){
case onechar('p', 0, 8):
switch(in[6]){
case onechar('e', 0, 8):
return gtok_t_complexblocklist::PB_TYPE;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <complexblocklist>.");
}
inline gtok_t_architecture glex_t_architecture(const char *in){
unsigned int len = strlen(in);
switch(len){
case 5:
switch(*((triehash_uu32*)&in[0])){
case onechar('p', 0, 32) | onechar('o', 8, 32) | onechar('w', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('r', 0, 8):
return gtok_t_architecture::POWER;
break;
default: break;
}
break;
case onechar('t', 0, 32) | onechar('i', 8, 32) | onechar('l', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('s', 0, 8):
return gtok_t_architecture::TILES;
break;
default: break;
}
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('c', 0, 32) | onechar('l', 8, 32) | onechar('o', 16, 32) | onechar('c', 24, 32):
switch(in[4]){
case onechar('k', 0, 8):
switch(in[5]){
case onechar('s', 0, 8):
return gtok_t_architecture::CLOCKS;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('d', 0, 32) | onechar('e', 8, 32) | onechar('v', 16, 32) | onechar('i', 24, 32):
switch(in[4]){
case onechar('c', 0, 8):
switch(in[5]){
case onechar('e', 0, 8):
return gtok_t_architecture::DEVICE;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('l', 0, 32) | onechar('a', 8, 32) | onechar('y', 16, 32) | onechar('o', 24, 32):
switch(in[4]){
case onechar('u', 0, 8):
switch(in[5]){
case onechar('t', 0, 8):
return gtok_t_architecture::LAYOUT;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('m', 0, 32) | onechar('o', 8, 32) | onechar('d', 16, 32) | onechar('e', 24, 32):
switch(in[4]){
case onechar('l', 0, 8):
switch(in[5]){
case onechar('s', 0, 8):
return gtok_t_architecture::MODELS;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 10:
switch(*((triehash_uu64*)&in[0])){
case onechar('d', 0, 64) | onechar('i', 8, 64) | onechar('r', 16, 64) | onechar('e', 24, 64) | onechar('c', 32, 64) | onechar('t', 40, 64) | onechar('l', 48, 64) | onechar('i', 56, 64):
switch(in[8]){
case onechar('s', 0, 8):
switch(in[9]){
case onechar('t', 0, 8):
return gtok_t_architecture::DIRECTLIST;
break;
default: break;
}
break;
default: break;
}
break;
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('l', 48, 64) | onechar('i', 56, 64):
switch(in[8]){
case onechar('s', 0, 8):
switch(in[9]){
case onechar('t', 0, 8):
return gtok_t_architecture::SWITCHLIST;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 11:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('e', 8, 64) | onechar('g', 16, 64) | onechar('m', 24, 64) | onechar('e', 32, 64) | onechar('n', 40, 64) | onechar('t', 48, 64) | onechar('l', 56, 64):
switch(in[8]){
case onechar('i', 0, 8):
switch(in[9]){
case onechar('s', 0, 8):
switch(in[10]){
case onechar('t', 0, 8):
return gtok_t_architecture::SEGMENTLIST;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 15:
switch(*((triehash_uu64*)&in[0])){
case onechar('s', 0, 64) | onechar('w', 8, 64) | onechar('i', 16, 64) | onechar('t', 24, 64) | onechar('c', 32, 64) | onechar('h', 40, 64) | onechar('b', 48, 64) | onechar('l', 56, 64):
switch(*((triehash_uu32*)&in[8])){
case onechar('o', 0, 32) | onechar('c', 8, 32) | onechar('k', 16, 32) | onechar('l', 24, 32):
switch(in[12]){
case onechar('i', 0, 8):
switch(in[13]){
case onechar('s', 0, 8):
switch(in[14]){
case onechar('t', 0, 8):
return gtok_t_architecture::SWITCHBLOCKLIST;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
break;
case 16:
switch(*((triehash_uu64*)&in[0])){
case onechar('c', 0, 64) | onechar('o', 8, 64) | onechar('m', 16, 64) | onechar('p', 24, 64) | onechar('l', 32, 64) | onechar('e', 40, 64) | onechar('x', 48, 64) | onechar('b', 56, 64):
switch(*((triehash_uu64*)&in[8])){
case onechar('l', 0, 64) | onechar('o', 8, 64) | onechar('c', 16, 64) | onechar('k', 24, 64) | onechar('l', 32, 64) | onechar('i', 40, 64) | onechar('s', 48, 64) | onechar('t', 56, 64):
return gtok_t_architecture::COMPLEXBLOCKLIST;
break;
default: break;
}
break;
default: break;
}
break;
default: break;
}
throw std::runtime_error("Found unrecognized child " + std::string(in) + " of <architecture>.");
}
/* runtime error for <xs:choice> or <xs:sequence>s */
void dfa_error(const char *wrong, int *states, const char **lookup, int len){
std::vector<std::string> expected;
for(int i=0; i<len; i++){
if(states[i] != -1) expected.push_back(lookup[i]);
}
std::string expected_or = expected[0];
for(unsigned int i=1; i<expected.size(); i++)
expected_or += std::string(" or ") + expected[i];
throw std::runtime_error("Expected " + expected_or + ", found " + std::string(wrong));
}
/* runtime error for attributes */
template<std::size_t N>
void attr_error(std::bitset<N> astate, const char **lookup){
std::vector<std::string> missing;
for(unsigned int i=0; i<N; i++){
if(astate[i] == 0) missing.push_back(lookup[i]);
}
std::string missing_and = missing[0];
for(unsigned int i=1; i<missing.size(); i++)
missing_and += std::string(", ") + missing[i];
throw std::runtime_error("Didn't find required attributes " + missing_and + ".");
}
/* runtime error for <xs:all>s */
template<std::size_t N>
void all_error(std::bitset<N> gstate, const char **lookup){
std::vector<std::string> missing;
for(unsigned int i=0; i<N; i++){
if(gstate[i] == 0) missing.push_back(lookup[i]);
}
std::string missing_and = missing[0];
for(unsigned int i=1; i<missing.size(); i++)
missing_and += std::string(", ") + missing[i];
throw std::runtime_error("Didn't find required elements " + missing_and + ".");
}
/**
* Validating&counting functions. These do the tree validation and count elements to allocate arenas.
**/
void count_meta(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <meta>.");
}
void count_port(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <port>.");
}
void count_fill(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <fill>.");
}
void count_perimeter(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <perimeter>.");
}
void count_corners(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <corners>.");
}
void count_col(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <col>.");
}
void count_row(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <row>.");
}
void count_region(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <region>.");
}
void count_chan_dist(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <chan_dist>.");
}
void count_pb_type_clock(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <pb_type_clock>.");
}
void count_delay_matrix(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <delay_matrix>.");
}
void count_T_timing_minmax(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <T_timing_minmax>.");
}
void count_T_timing(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <T_timing>.");
}
void count_T_clock_timing(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <T_clock_timing>.");
}
void count_pack_pattern(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <pack_pattern>.");
}
void count_power_dynamic_power(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_dynamic_power>.");
}
void count_power_static_power(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_static_power>.");
}
void count_power_port(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_port>.");
}
void count_power_local_interconnect(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_local_interconnect>.");
}
void count_power_buffers(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_buffers>.");
}
void count_power_ff_size(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_ff_size>.");
}
void count_power_LUT_transistor_size(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_LUT_transistor_size>.");
}
void count_power_mux_transistor_size(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <power_mux_transistor_size>.");
}
void count_loc(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <loc>.");
}
void count_sb_loc(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <sb_loc>.");
}
void count_map(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <map>.");
}
void count_segment_block(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <segment_block>.");
}
void count_segment_mux(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <segment_mux>.");
}
void count_segment_wire_switch(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <segment_wire_switch>.");
}
void count_direct(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <direct>.");
}
void count_switchblock_location(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <switchblock_location>.");
}
void count_wireconn_connection(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <wireconn_connection>.");
}
void count_clock(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <clock>.");
}
void count_sizing(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <sizing>.");
}
void count_connection_block(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <connection_block>.");
}
void count_area(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <area>.");
}
void count_switch_block(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <switch_block>.");
}
void count_default_fc(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <default_fc>.");
}
void count_Tdel(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <Tdel>.");
}
void count_fc_override(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <fc_override>.");
}
void count_func(const pugi::xml_node &root){
if(root.first_child().type() == pugi::node_element) throw std::runtime_error("Unexpected child element in <func>.");
}
int gstate_t_metadata[1][1] = {
{0},
};
void count_metadata(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_metadata in = glex_t_metadata(node.name());
next = gstate_t_metadata[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_metadata[(int)in], gstate_t_metadata[state], gtok_lookup_t_metadata, 1);
state = next;
switch(in){
case gtok_t_metadata::META:
count_meta(node);
g_num_meta++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_metadata[state], gtok_lookup_t_metadata, 1);
}
int gstate_t_port_list[1][1] = {
{0},
};
void count_port_list(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_port_list in = glex_t_port_list(node.name());
next = gstate_t_port_list[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_port_list[(int)in], gstate_t_port_list[state], gtok_lookup_t_port_list, 1);
state = next;
switch(in){
case gtok_t_port_list::PORT:
count_port(node);
g_num_port++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_port_list[state], gtok_lookup_t_port_list, 1);
}
int gstate_t_chan_width_distr[2][2] = {
{0, 0},
{0, 0},
};
void count_chan_width_distr(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_chan_width_distr in = glex_t_chan_width_distr(node.name());
next = gstate_t_chan_width_distr[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_chan_width_distr[(int)in], gstate_t_chan_width_distr[state], gtok_lookup_t_chan_width_distr, 2);
state = next;
switch(in){
case gtok_t_chan_width_distr::X:
count_chan_dist(node);
g_num_chan_dist++;
break;
case gtok_t_chan_width_distr::Y:
count_chan_dist(node);
g_num_chan_dist++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_chan_width_distr[state], gtok_lookup_t_chan_width_distr, 2);
}
int gstate_t_switch[1][1] = {
{0},
};
void count_switch(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switch in = glex_t_switch(node.name());
next = gstate_t_switch[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_switch[(int)in], gstate_t_switch[state], gtok_lookup_t_switch, 1);
state = next;
switch(in){
case gtok_t_switch::TDEL:
count_Tdel(node);
g_num_Tdel++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_switch[state], gtok_lookup_t_switch, 1);
}
int gstate_t_power[1][3] = {
{0, 0, 0},
};
void count_power(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_power in = glex_t_power(node.name());
next = gstate_t_power[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_power[(int)in], gstate_t_power[state], gtok_lookup_t_power, 3);
state = next;
switch(in){
case gtok_t_power::DYNAMIC_POWER:
count_power_dynamic_power(node);
g_num_power_dynamic_power++;
break;
case gtok_t_power::STATIC_POWER:
count_power_static_power(node);
g_num_power_static_power++;
break;
case gtok_t_power::PORT:
count_power_port(node);
g_num_power_port++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_power[state], gtok_lookup_t_power, 3);
}
int gstate_t_global_power[2][5] = {
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0},
};
void count_global_power(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_global_power in = glex_t_global_power(node.name());
next = gstate_t_global_power[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_global_power[(int)in], gstate_t_global_power[state], gtok_lookup_t_global_power, 5);
state = next;
switch(in){
case gtok_t_global_power::LOCAL_INTERCONNECT:
count_power_local_interconnect(node);
g_num_power_local_interconnect++;
break;
case gtok_t_global_power::BUFFERS:
count_power_buffers(node);
g_num_power_buffers++;
break;
case gtok_t_global_power::MUX_TRANSISTOR_SIZE:
count_power_mux_transistor_size(node);
g_num_power_mux_transistor_size++;
break;
case gtok_t_global_power::FF_SIZE:
count_power_ff_size(node);
g_num_power_ff_size++;
break;
case gtok_t_global_power::LUT_TRANSISTOR_SIZE:
count_power_LUT_transistor_size(node);
g_num_power_LUT_transistor_size++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_global_power[state], gtok_lookup_t_global_power, 5);
}
int gstate_t_pinlocations[1][1] = {
{0},
};
void count_pinlocations(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pinlocations in = glex_t_pinlocations(node.name());
next = gstate_t_pinlocations[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_pinlocations[(int)in], gstate_t_pinlocations[state], gtok_lookup_t_pinlocations, 1);
state = next;
switch(in){
case gtok_t_pinlocations::LOC:
count_loc(node);
g_num_loc++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_pinlocations[state], gtok_lookup_t_pinlocations, 1);
}
int gstate_t_switchblock_locations[1][1] = {
{0},
};
void count_switchblock_locations(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblock_locations in = glex_t_switchblock_locations(node.name());
next = gstate_t_switchblock_locations[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_switchblock_locations[(int)in], gstate_t_switchblock_locations[state], gtok_lookup_t_switchblock_locations, 1);
state = next;
switch(in){
case gtok_t_switchblock_locations::SB_LOC:
count_sb_loc(node);
g_num_sb_loc++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_switchblock_locations[state], gtok_lookup_t_switchblock_locations, 1);
}
int gstate_t_fc[1][1] = {
{0},
};
void count_fc(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_fc in = glex_t_fc(node.name());
next = gstate_t_fc[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_fc[(int)in], gstate_t_fc[state], gtok_lookup_t_fc, 1);
state = next;
switch(in){
case gtok_t_fc::FC_OVERRIDE:
count_fc_override(node);
g_num_fc_override++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_fc[state], gtok_lookup_t_fc, 1);
}
int gstate_t_tile_mode[1][1] = {
{0},
};
void count_tile_mode(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_tile_mode in = glex_t_tile_mode(node.name());
next = gstate_t_tile_mode[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_tile_mode[(int)in], gstate_t_tile_mode[state], gtok_lookup_t_tile_mode, 1);
state = next;
switch(in){
case gtok_t_tile_mode::MAP:
count_map(node);
g_num_map++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_tile_mode[state], gtok_lookup_t_tile_mode, 1);
}
int gstate_t_segment[2][5] = {
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0},
};
void count_segment(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_segment in = glex_t_segment(node.name());
next = gstate_t_segment[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_segment[(int)in], gstate_t_segment[state], gtok_lookup_t_segment, 5);
state = next;
switch(in){
case gtok_t_segment::SB:
count_segment_block(node);
g_num_segment_block++;
break;
case gtok_t_segment::CB:
count_segment_block(node);
g_num_segment_block++;
break;
case gtok_t_segment::MUX:
count_segment_mux(node);
g_num_segment_mux++;
break;
case gtok_t_segment::WIRE_SWITCH:
count_segment_wire_switch(node);
g_num_segment_wire_switch++;
break;
case gtok_t_segment::OPIN_SWITCH:
count_segment_wire_switch(node);
g_num_segment_wire_switch++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_segment[state], gtok_lookup_t_segment, 5);
}
int gstate_t_directlist[2][1] = {
{0},
{0},
};
void count_directlist(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_directlist in = glex_t_directlist(node.name());
next = gstate_t_directlist[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_directlist[(int)in], gstate_t_directlist[state], gtok_lookup_t_directlist, 1);
state = next;
switch(in){
case gtok_t_directlist::DIRECT:
count_direct(node);
g_num_direct++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_directlist[state], gtok_lookup_t_directlist, 1);
}
int gstate_t_switchblock_func[2][1] = {
{0},
{0},
};
void count_switchblock_func(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblock_func in = glex_t_switchblock_func(node.name());
next = gstate_t_switchblock_func[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_switchblock_func[(int)in], gstate_t_switchblock_func[state], gtok_lookup_t_switchblock_func, 1);
state = next;
switch(in){
case gtok_t_switchblock_func::FUNC:
count_func(node);
g_num_func++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_switchblock_func[state], gtok_lookup_t_switchblock_func, 1);
}
int gstate_t_wireconn[1][2] = {
{0, 0},
};
void count_wireconn(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_wireconn in = glex_t_wireconn(node.name());
next = gstate_t_wireconn[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_wireconn[(int)in], gstate_t_wireconn[state], gtok_lookup_t_wireconn, 2);
state = next;
switch(in){
case gtok_t_wireconn::FROM:
count_wireconn_connection(node);
g_num_wireconn_connection++;
break;
case gtok_t_wireconn::TO:
count_wireconn_connection(node);
g_num_wireconn_connection++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_wireconn[state], gtok_lookup_t_wireconn, 2);
}
int gstate_t_clocks[1][1] = {
{0},
};
void count_clocks(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_clocks in = glex_t_clocks(node.name());
next = gstate_t_clocks[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_clocks[(int)in], gstate_t_clocks[state], gtok_lookup_t_clocks, 1);
state = next;
switch(in){
case gtok_t_clocks::CLOCK:
count_clock(node);
g_num_clock++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_clocks[state], gtok_lookup_t_clocks, 1);
}
int gstate_t_model_type[2][2] = {
{0, 0},
{0, 0},
};
void count_model_type(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_model_type in = glex_t_model_type(node.name());
next = gstate_t_model_type[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_model_type[(int)in], gstate_t_model_type[state], gtok_lookup_t_model_type, 2);
state = next;
switch(in){
case gtok_t_model_type::INPUT_PORTS:
count_port_list(node);
g_num_port_list++;
break;
case gtok_t_model_type::OUTPUT_PORTS:
count_port_list(node);
g_num_port_list++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_model_type[state], gtok_lookup_t_model_type, 2);
}
int gstate_t_single[1][1] = {
{0},
};
void count_single(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_single in = glex_t_single(node.name());
next = gstate_t_single[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_single[(int)in], gstate_t_single[state], gtok_lookup_t_single, 1);
state = next;
switch(in){
case gtok_t_single::METADATA:
count_metadata(node);
g_num_metadata++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_single[state], gtok_lookup_t_single, 1);
}
void count_device(const pugi::xml_node &root){
std::bitset<6> gstate = 0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_device in = glex_t_device(node.name());
if(gstate[(int)in] == 0) gstate[(int)in] = 1;
else throw std::runtime_error("Duplicate element " + std::string(node.name()) + " in <device>.");
switch(in){
case gtok_t_device::SIZING:
count_sizing(node);
break;
case gtok_t_device::CONNECTION_BLOCK:
count_connection_block(node);
break;
case gtok_t_device::AREA:
count_area(node);
break;
case gtok_t_device::SWITCH_BLOCK:
count_switch_block(node);
break;
case gtok_t_device::CHAN_WIDTH_DISTR:
count_chan_width_distr(node);
break;
case gtok_t_device::DEFAULT_FC:
count_default_fc(node);
break;
default: break; /* Not possible. */
}
}
std::bitset<6> test_state = gstate | std::bitset<6>(0b110000);
if(!test_state.all()) all_error(test_state, gtok_lookup_t_device);
}
int gstate_t_switchlist[2][1] = {
{0},
{0},
};
void count_switchlist(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchlist in = glex_t_switchlist(node.name());
next = gstate_t_switchlist[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_switchlist[(int)in], gstate_t_switchlist[state], gtok_lookup_t_switchlist, 1);
state = next;
switch(in){
case gtok_t_switchlist::SWITCH:
count_switch(node);
g_num_switch++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_switchlist[state], gtok_lookup_t_switchlist, 1);
}
void count_pb_type_input(const pugi::xml_node &root){
std::bitset<1> gstate = 0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pb_type_input in = glex_t_pb_type_input(node.name());
if(gstate[(int)in] == 0) gstate[(int)in] = 1;
else throw std::runtime_error("Duplicate element " + std::string(node.name()) + " in <pb_type_input>.");
switch(in){
case gtok_t_pb_type_input::METADATA:
count_metadata(node);
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = gstate | std::bitset<1>(0b1);
if(!test_state.all()) all_error(test_state, gtok_lookup_t_pb_type_input);
}
void count_pb_type_output(const pugi::xml_node &root){
std::bitset<1> gstate = 0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pb_type_output in = glex_t_pb_type_output(node.name());
if(gstate[(int)in] == 0) gstate[(int)in] = 1;
else throw std::runtime_error("Duplicate element " + std::string(node.name()) + " in <pb_type_output>.");
switch(in){
case gtok_t_pb_type_output::METADATA:
count_metadata(node);
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = gstate | std::bitset<1>(0b1);
if(!test_state.all()) all_error(test_state, gtok_lookup_t_pb_type_output);
}
int gstate_t_interconnect_type[1][4] = {
{0, 0, 0, 0},
};
void count_interconnect_type(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_interconnect_type in = glex_t_interconnect_type(node.name());
next = gstate_t_interconnect_type[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_interconnect_type[(int)in], gstate_t_interconnect_type[state], gtok_lookup_t_interconnect_type, 4);
state = next;
switch(in){
case gtok_t_interconnect_type::PACK_PATTERN:
count_pack_pattern(node);
g_num_pack_pattern++;
break;
case gtok_t_interconnect_type::DELAY_CONSTANT:
count_T_timing_minmax(node);
g_num_T_timing_minmax++;
break;
case gtok_t_interconnect_type::DELAY_MATRIX:
count_delay_matrix(node);
g_num_delay_matrix++;
break;
case gtok_t_interconnect_type::METADATA:
count_metadata(node);
g_num_metadata++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_interconnect_type[state], gtok_lookup_t_interconnect_type, 4);
}
int gstate_t_equivalent_tiles[1][1] = {
{0},
};
void count_equivalent_tiles(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_equivalent_tiles in = glex_t_equivalent_tiles(node.name());
next = gstate_t_equivalent_tiles[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_equivalent_tiles[(int)in], gstate_t_equivalent_tiles[state], gtok_lookup_t_equivalent_tiles, 1);
state = next;
switch(in){
case gtok_t_equivalent_tiles::MODE:
count_tile_mode(node);
g_num_tile_mode++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_equivalent_tiles[state], gtok_lookup_t_equivalent_tiles, 1);
}
int gstate_t_segmentlist[2][1] = {
{0},
{0},
};
void count_segmentlist(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_segmentlist in = glex_t_segmentlist(node.name());
next = gstate_t_segmentlist[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_segmentlist[(int)in], gstate_t_segmentlist[state], gtok_lookup_t_segmentlist, 1);
state = next;
switch(in){
case gtok_t_segmentlist::SEGMENT:
count_segment(node);
g_num_segment++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_segmentlist[state], gtok_lookup_t_segmentlist, 1);
}
int gstate_t_switchblock[4][3] = {
{-1, -1, 0},
{-1, 1, 0},
{2, 1, -1},
{2, -1, -1},
};
void count_switchblock(const pugi::xml_node &root){
int next, state=3;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblock in = glex_t_switchblock(node.name());
next = gstate_t_switchblock[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_switchblock[(int)in], gstate_t_switchblock[state], gtok_lookup_t_switchblock, 3);
state = next;
switch(in){
case gtok_t_switchblock::SWITCHBLOCK_LOCATION:
count_switchblock_location(node);
g_num_switchblock_location++;
break;
case gtok_t_switchblock::SWITCHFUNCS:
count_switchblock_func(node);
g_num_switchblock_func++;
break;
case gtok_t_switchblock::WIRECONN:
count_wireconn(node);
g_num_wireconn++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_switchblock[state], gtok_lookup_t_switchblock, 3);
}
int gstate_t_models[1][1] = {
{0},
};
void count_models(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_models in = glex_t_models(node.name());
next = gstate_t_models[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_models[(int)in], gstate_t_models[state], gtok_lookup_t_models, 1);
state = next;
switch(in){
case gtok_t_models::MODEL:
count_model_type(node);
g_num_model_type++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_models[state], gtok_lookup_t_models, 1);
}
int gstate_t_layout_info[1][7] = {
{0, 0, 0, 0, 0, 0, 0},
};
void count_layout_info(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_layout_info in = glex_t_layout_info(node.name());
next = gstate_t_layout_info[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_layout_info[(int)in], gstate_t_layout_info[state], gtok_lookup_t_layout_info, 7);
state = next;
switch(in){
case gtok_t_layout_info::FILL:
count_fill(node);
g_num_fill++;
break;
case gtok_t_layout_info::PERIMETER:
count_perimeter(node);
g_num_perimeter++;
break;
case gtok_t_layout_info::CORNERS:
count_corners(node);
g_num_corners++;
break;
case gtok_t_layout_info::SINGLE:
count_single(node);
g_num_single++;
break;
case gtok_t_layout_info::COL:
count_col(node);
g_num_col++;
break;
case gtok_t_layout_info::ROW:
count_row(node);
g_num_row++;
break;
case gtok_t_layout_info::REGION:
count_region(node);
g_num_region++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_layout_info[state], gtok_lookup_t_layout_info, 7);
}
int gstate_t_auto_layout[1][7] = {
{0, 0, 0, 0, 0, 0, 0},
};
void count_auto_layout(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_auto_layout in = glex_t_auto_layout(node.name());
next = gstate_t_auto_layout[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_auto_layout[(int)in], gstate_t_auto_layout[state], gtok_lookup_t_auto_layout, 7);
state = next;
switch(in){
case gtok_t_auto_layout::FILL:
count_fill(node);
g_num_fill++;
break;
case gtok_t_auto_layout::PERIMETER:
count_perimeter(node);
g_num_perimeter++;
break;
case gtok_t_auto_layout::CORNERS:
count_corners(node);
g_num_corners++;
break;
case gtok_t_auto_layout::SINGLE:
count_single(node);
g_num_single++;
break;
case gtok_t_auto_layout::COL:
count_col(node);
g_num_col++;
break;
case gtok_t_auto_layout::ROW:
count_row(node);
g_num_row++;
break;
case gtok_t_auto_layout::REGION:
count_region(node);
g_num_region++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_auto_layout[state], gtok_lookup_t_auto_layout, 7);
}
int gstate_t_fixed_layout[1][7] = {
{0, 0, 0, 0, 0, 0, 0},
};
void count_fixed_layout(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_fixed_layout in = glex_t_fixed_layout(node.name());
next = gstate_t_fixed_layout[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_fixed_layout[(int)in], gstate_t_fixed_layout[state], gtok_lookup_t_fixed_layout, 7);
state = next;
switch(in){
case gtok_t_fixed_layout::FILL:
count_fill(node);
g_num_fill++;
break;
case gtok_t_fixed_layout::PERIMETER:
count_perimeter(node);
g_num_perimeter++;
break;
case gtok_t_fixed_layout::CORNERS:
count_corners(node);
g_num_corners++;
break;
case gtok_t_fixed_layout::SINGLE:
count_single(node);
g_num_single++;
break;
case gtok_t_fixed_layout::COL:
count_col(node);
g_num_col++;
break;
case gtok_t_fixed_layout::ROW:
count_row(node);
g_num_row++;
break;
case gtok_t_fixed_layout::REGION:
count_region(node);
g_num_region++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_fixed_layout[state], gtok_lookup_t_fixed_layout, 7);
}
int gstate_t_interconnect[2][3] = {
{0, 0, 0},
{0, 0, 0},
};
void count_interconnect(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_interconnect in = glex_t_interconnect(node.name());
next = gstate_t_interconnect[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_interconnect[(int)in], gstate_t_interconnect[state], gtok_lookup_t_interconnect, 3);
state = next;
switch(in){
case gtok_t_interconnect::COMPLETE:
count_interconnect_type(node);
g_num_interconnect_type++;
break;
case gtok_t_interconnect::DIRECT:
count_interconnect_type(node);
g_num_interconnect_type++;
break;
case gtok_t_interconnect::MUX:
count_interconnect_type(node);
g_num_interconnect_type++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_interconnect[state], gtok_lookup_t_interconnect, 3);
}
int gstate_t_tile[1][4] = {
{0, 0, 0, 0},
};
void count_tile(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_tile in = glex_t_tile(node.name());
next = gstate_t_tile[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_tile[(int)in], gstate_t_tile[state], gtok_lookup_t_tile, 4);
state = next;
switch(in){
case gtok_t_tile::EQUIVALENT_TILES:
count_equivalent_tiles(node);
g_num_equivalent_tiles++;
break;
case gtok_t_tile::PINLOCATIONS:
count_pinlocations(node);
g_num_pinlocations++;
break;
case gtok_t_tile::FC:
count_fc(node);
g_num_fc++;
break;
case gtok_t_tile::SWITCHBLOCK_LOCATIONS:
count_switchblock_locations(node);
g_num_switchblock_locations++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_tile[state], gtok_lookup_t_tile, 4);
}
int gstate_t_switchblocklist[2][1] = {
{0},
{0},
};
void count_switchblocklist(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblocklist in = glex_t_switchblocklist(node.name());
next = gstate_t_switchblocklist[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_switchblocklist[(int)in], gstate_t_switchblocklist[state], gtok_lookup_t_switchblocklist, 1);
state = next;
switch(in){
case gtok_t_switchblocklist::SWITCHBLOCK:
count_switchblock(node);
g_num_switchblock++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_switchblocklist[state], gtok_lookup_t_switchblocklist, 1);
}
int gstate_t_layout[4][3] = {
{-1, 0, -1},
{-1, -1, -1},
{-1, -1, 2},
{1, 0, 2},
};
void count_layout(const pugi::xml_node &root){
int next, state=3;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_layout in = glex_t_layout(node.name());
next = gstate_t_layout[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_layout[(int)in], gstate_t_layout[state], gtok_lookup_t_layout, 3);
state = next;
switch(in){
case gtok_t_layout::AUTO_LAYOUT:
count_auto_layout(node);
break;
case gtok_t_layout::FIXED_LAYOUT:
count_fixed_layout(node);
g_num_fixed_layout++;
break;
case gtok_t_layout::DEVICE_LAYOUT:
count_fixed_layout(node);
g_num_fixed_layout++;
break;
default: break; /* Not possible. */
}
}
if(state != 0 && state != 1 && state != 2) dfa_error("end of input", gstate_t_layout[state], gtok_lookup_t_layout, 3);
}
int gstate_t_mode[1][5] = {
{0, 0, 0, 0, 0},
};
void count_mode(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_mode in = glex_t_mode(node.name());
next = gstate_t_mode[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_mode[(int)in], gstate_t_mode[state], gtok_lookup_t_mode, 5);
state = next;
switch(in){
case gtok_t_mode::PB_TYPE:
count_pb_type(node);
g_num_pb_type++;
break;
case gtok_t_mode::INTERCONNECT:
count_interconnect(node);
g_num_interconnect++;
break;
case gtok_t_mode::PINLOCATIONS:
count_pinlocations(node);
g_num_pinlocations++;
break;
case gtok_t_mode::SWITCHBLOCK_LOCATIONS:
count_switchblock_locations(node);
g_num_switchblock_locations++;
break;
case gtok_t_mode::METADATA:
count_metadata(node);
g_num_metadata++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_mode[state], gtok_lookup_t_mode, 5);
}
int gstate_t_tiles[2][1] = {
{0},
{0},
};
void count_tiles(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_tiles in = glex_t_tiles(node.name());
next = gstate_t_tiles[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_tiles[(int)in], gstate_t_tiles[state], gtok_lookup_t_tiles, 1);
state = next;
switch(in){
case gtok_t_tiles::TILE:
count_tile(node);
g_num_tile++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_tiles[state], gtok_lookup_t_tiles, 1);
}
int gstate_t_pb_type[1][16] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};
void count_pb_type(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pb_type in = glex_t_pb_type(node.name());
next = gstate_t_pb_type[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_pb_type[(int)in], gstate_t_pb_type[state], gtok_lookup_t_pb_type, 16);
state = next;
switch(in){
case gtok_t_pb_type::PB_TYPE:
count_pb_type(node);
g_num_pb_type++;
break;
case gtok_t_pb_type::INPUT:
count_pb_type_input(node);
g_num_pb_type_input++;
break;
case gtok_t_pb_type::OUTPUT:
count_pb_type_output(node);
g_num_pb_type_output++;
break;
case gtok_t_pb_type::CLOCK:
count_pb_type_clock(node);
g_num_pb_type_clock++;
break;
case gtok_t_pb_type::METADATA:
count_metadata(node);
g_num_metadata++;
break;
case gtok_t_pb_type::MODE:
count_mode(node);
g_num_mode++;
break;
case gtok_t_pb_type::INTERCONNECT:
count_interconnect(node);
g_num_interconnect++;
break;
case gtok_t_pb_type::PINLOCATIONS:
count_pinlocations(node);
g_num_pinlocations++;
break;
case gtok_t_pb_type::SWITCHBLOCK_LOCATIONS:
count_switchblock_locations(node);
g_num_switchblock_locations++;
break;
case gtok_t_pb_type::FC:
count_fc(node);
g_num_fc++;
break;
case gtok_t_pb_type::DELAY_CONSTANT:
count_T_timing_minmax(node);
g_num_T_timing_minmax++;
break;
case gtok_t_pb_type::DELAY_MATRIX:
count_delay_matrix(node);
g_num_delay_matrix++;
break;
case gtok_t_pb_type::T_SETUP:
count_T_timing(node);
g_num_T_timing++;
break;
case gtok_t_pb_type::T_HOLD:
count_T_timing(node);
g_num_T_timing++;
break;
case gtok_t_pb_type::T_CLOCK_TO_Q:
count_T_clock_timing(node);
g_num_T_clock_timing++;
break;
case gtok_t_pb_type::POWER:
count_power(node);
g_num_power++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_pb_type[state], gtok_lookup_t_pb_type, 16);
}
int gstate_t_complexblocklist[2][1] = {
{0},
{0},
};
void count_complexblocklist(const pugi::xml_node &root){
int next, state=1;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_complexblocklist in = glex_t_complexblocklist(node.name());
next = gstate_t_complexblocklist[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_complexblocklist[(int)in], gstate_t_complexblocklist[state], gtok_lookup_t_complexblocklist, 1);
state = next;
switch(in){
case gtok_t_complexblocklist::PB_TYPE:
count_pb_type(node);
g_num_pb_type++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_complexblocklist[state], gtok_lookup_t_complexblocklist, 1);
}
int gstate_t_architecture[1][11] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};
void count_architecture(const pugi::xml_node &root){
int next, state=0;
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_architecture in = glex_t_architecture(node.name());
next = gstate_t_architecture[state][(int)in];
if(next == -1) dfa_error(gtok_lookup_t_architecture[(int)in], gstate_t_architecture[state], gtok_lookup_t_architecture, 11);
state = next;
switch(in){
case gtok_t_architecture::MODELS:
count_models(node);
g_num_models++;
break;
case gtok_t_architecture::LAYOUT:
count_layout(node);
g_num_layout++;
break;
case gtok_t_architecture::DEVICE:
count_device(node);
g_num_device++;
break;
case gtok_t_architecture::SWITCHLIST:
count_switchlist(node);
g_num_switchlist++;
break;
case gtok_t_architecture::SWITCHBLOCKLIST:
count_switchblocklist(node);
g_num_switchblocklist++;
break;
case gtok_t_architecture::SEGMENTLIST:
count_segmentlist(node);
g_num_segmentlist++;
break;
case gtok_t_architecture::POWER:
count_global_power(node);
g_num_global_power++;
break;
case gtok_t_architecture::CLOCKS:
count_clocks(node);
g_num_clocks++;
break;
case gtok_t_architecture::DIRECTLIST:
count_directlist(node);
g_num_directlist++;
break;
case gtok_t_architecture::TILES:
count_tiles(node);
g_num_tiles++;
break;
case gtok_t_architecture::COMPLEXBLOCKLIST:
count_complexblocklist(node);
g_num_complexblocklist++;
break;
default: break; /* Not possible. */
}
}
if(state != 0) dfa_error("end of input", gstate_t_architecture[state], gtok_lookup_t_architecture, 11);
}
/**
* This allocates space for the complex types which can occur more than once.
* It resets the global type counters for use with loading functions.
**/
void alloc_arenas(void){
if(!(T_clock_timing_arena = (t_T_clock_timing *)std::calloc(g_num_T_clock_timing, sizeof(t_T_clock_timing))))
throw std::runtime_error("Couldn't get memory for <T_clock_timing> arena.");
if(!(T_timing_arena = (t_T_timing *)std::calloc(g_num_T_timing, sizeof(t_T_timing))))
throw std::runtime_error("Couldn't get memory for <T_timing> arena.");
if(!(T_timing_minmax_arena = (t_T_timing_minmax *)std::calloc(g_num_T_timing_minmax, sizeof(t_T_timing_minmax))))
throw std::runtime_error("Couldn't get memory for <T_timing_minmax> arena.");
if(!(Tdel_arena = (t_Tdel *)std::calloc(g_num_Tdel, sizeof(t_Tdel))))
throw std::runtime_error("Couldn't get memory for <Tdel> arena.");
if(!(chan_dist_arena = (t_chan_dist *)std::calloc(g_num_chan_dist, sizeof(t_chan_dist))))
throw std::runtime_error("Couldn't get memory for <chan_dist> arena.");
if(!(clock_arena = (t_clock *)std::calloc(g_num_clock, sizeof(t_clock))))
throw std::runtime_error("Couldn't get memory for <clock> arena.");
if(!(clocks_arena = (t_clocks *)std::calloc(g_num_clocks, sizeof(t_clocks))))
throw std::runtime_error("Couldn't get memory for <clocks> arena.");
if(!(col_arena = (t_col *)std::calloc(g_num_col, sizeof(t_col))))
throw std::runtime_error("Couldn't get memory for <col> arena.");
if(!(complexblocklist_arena = (t_complexblocklist *)std::calloc(g_num_complexblocklist, sizeof(t_complexblocklist))))
throw std::runtime_error("Couldn't get memory for <complexblocklist> arena.");
if(!(corners_arena = (t_corners *)std::calloc(g_num_corners, sizeof(t_corners))))
throw std::runtime_error("Couldn't get memory for <corners> arena.");
if(!(delay_matrix_arena = (t_delay_matrix *)std::calloc(g_num_delay_matrix, sizeof(t_delay_matrix))))
throw std::runtime_error("Couldn't get memory for <delay_matrix> arena.");
if(!(device_arena = (t_device *)std::calloc(g_num_device, sizeof(t_device))))
throw std::runtime_error("Couldn't get memory for <device> arena.");
if(!(direct_arena = (t_direct *)std::calloc(g_num_direct, sizeof(t_direct))))
throw std::runtime_error("Couldn't get memory for <direct> arena.");
if(!(directlist_arena = (t_directlist *)std::calloc(g_num_directlist, sizeof(t_directlist))))
throw std::runtime_error("Couldn't get memory for <directlist> arena.");
if(!(equivalent_tiles_arena = (t_equivalent_tiles *)std::calloc(g_num_equivalent_tiles, sizeof(t_equivalent_tiles))))
throw std::runtime_error("Couldn't get memory for <equivalent_tiles> arena.");
if(!(fc_arena = (t_fc *)std::calloc(g_num_fc, sizeof(t_fc))))
throw std::runtime_error("Couldn't get memory for <fc> arena.");
if(!(fc_override_arena = (t_fc_override *)std::calloc(g_num_fc_override, sizeof(t_fc_override))))
throw std::runtime_error("Couldn't get memory for <fc_override> arena.");
if(!(fill_arena = (t_fill *)std::calloc(g_num_fill, sizeof(t_fill))))
throw std::runtime_error("Couldn't get memory for <fill> arena.");
if(!(fixed_layout_arena = (t_fixed_layout *)std::calloc(g_num_fixed_layout, sizeof(t_fixed_layout))))
throw std::runtime_error("Couldn't get memory for <fixed_layout> arena.");
if(!(func_arena = (t_func *)std::calloc(g_num_func, sizeof(t_func))))
throw std::runtime_error("Couldn't get memory for <func> arena.");
if(!(global_power_arena = (t_global_power *)std::calloc(g_num_global_power, sizeof(t_global_power))))
throw std::runtime_error("Couldn't get memory for <global_power> arena.");
if(!(interconnect_arena = (t_interconnect *)std::calloc(g_num_interconnect, sizeof(t_interconnect))))
throw std::runtime_error("Couldn't get memory for <interconnect> arena.");
if(!(interconnect_type_arena = (t_interconnect_type *)std::calloc(g_num_interconnect_type, sizeof(t_interconnect_type))))
throw std::runtime_error("Couldn't get memory for <interconnect_type> arena.");
if(!(layout_arena = (t_layout *)std::calloc(g_num_layout, sizeof(t_layout))))
throw std::runtime_error("Couldn't get memory for <layout> arena.");
if(!(loc_arena = (t_loc *)std::calloc(g_num_loc, sizeof(t_loc))))
throw std::runtime_error("Couldn't get memory for <loc> arena.");
if(!(map_arena = (t_map *)std::calloc(g_num_map, sizeof(t_map))))
throw std::runtime_error("Couldn't get memory for <map> arena.");
if(!(meta_arena = (t_meta *)std::calloc(g_num_meta, sizeof(t_meta))))
throw std::runtime_error("Couldn't get memory for <meta> arena.");
if(!(metadata_arena = (t_metadata *)std::calloc(g_num_metadata, sizeof(t_metadata))))
throw std::runtime_error("Couldn't get memory for <metadata> arena.");
if(!(mode_arena = (t_mode *)std::calloc(g_num_mode, sizeof(t_mode))))
throw std::runtime_error("Couldn't get memory for <mode> arena.");
if(!(model_type_arena = (t_model_type *)std::calloc(g_num_model_type, sizeof(t_model_type))))
throw std::runtime_error("Couldn't get memory for <model_type> arena.");
if(!(models_arena = (t_models *)std::calloc(g_num_models, sizeof(t_models))))
throw std::runtime_error("Couldn't get memory for <models> arena.");
if(!(pack_pattern_arena = (t_pack_pattern *)std::calloc(g_num_pack_pattern, sizeof(t_pack_pattern))))
throw std::runtime_error("Couldn't get memory for <pack_pattern> arena.");
if(!(pb_type_arena = (t_pb_type *)std::calloc(g_num_pb_type, sizeof(t_pb_type))))
throw std::runtime_error("Couldn't get memory for <pb_type> arena.");
if(!(pb_type_clock_arena = (t_pb_type_clock *)std::calloc(g_num_pb_type_clock, sizeof(t_pb_type_clock))))
throw std::runtime_error("Couldn't get memory for <pb_type_clock> arena.");
if(!(pb_type_input_arena = (t_pb_type_input *)std::calloc(g_num_pb_type_input, sizeof(t_pb_type_input))))
throw std::runtime_error("Couldn't get memory for <pb_type_input> arena.");
if(!(pb_type_output_arena = (t_pb_type_output *)std::calloc(g_num_pb_type_output, sizeof(t_pb_type_output))))
throw std::runtime_error("Couldn't get memory for <pb_type_output> arena.");
if(!(perimeter_arena = (t_perimeter *)std::calloc(g_num_perimeter, sizeof(t_perimeter))))
throw std::runtime_error("Couldn't get memory for <perimeter> arena.");
if(!(pinlocations_arena = (t_pinlocations *)std::calloc(g_num_pinlocations, sizeof(t_pinlocations))))
throw std::runtime_error("Couldn't get memory for <pinlocations> arena.");
if(!(port_arena = (t_port *)std::calloc(g_num_port, sizeof(t_port))))
throw std::runtime_error("Couldn't get memory for <port> arena.");
if(!(port_list_arena = (t_port_list *)std::calloc(g_num_port_list, sizeof(t_port_list))))
throw std::runtime_error("Couldn't get memory for <port_list> arena.");
if(!(power_arena = (t_power *)std::calloc(g_num_power, sizeof(t_power))))
throw std::runtime_error("Couldn't get memory for <power> arena.");
if(!(power_LUT_transistor_size_arena = (t_power_LUT_transistor_size *)std::calloc(g_num_power_LUT_transistor_size, sizeof(t_power_LUT_transistor_size))))
throw std::runtime_error("Couldn't get memory for <power_LUT_transistor_size> arena.");
if(!(power_buffers_arena = (t_power_buffers *)std::calloc(g_num_power_buffers, sizeof(t_power_buffers))))
throw std::runtime_error("Couldn't get memory for <power_buffers> arena.");
if(!(power_dynamic_power_arena = (t_power_dynamic_power *)std::calloc(g_num_power_dynamic_power, sizeof(t_power_dynamic_power))))
throw std::runtime_error("Couldn't get memory for <power_dynamic_power> arena.");
if(!(power_ff_size_arena = (t_power_ff_size *)std::calloc(g_num_power_ff_size, sizeof(t_power_ff_size))))
throw std::runtime_error("Couldn't get memory for <power_ff_size> arena.");
if(!(power_local_interconnect_arena = (t_power_local_interconnect *)std::calloc(g_num_power_local_interconnect, sizeof(t_power_local_interconnect))))
throw std::runtime_error("Couldn't get memory for <power_local_interconnect> arena.");
if(!(power_mux_transistor_size_arena = (t_power_mux_transistor_size *)std::calloc(g_num_power_mux_transistor_size, sizeof(t_power_mux_transistor_size))))
throw std::runtime_error("Couldn't get memory for <power_mux_transistor_size> arena.");
if(!(power_port_arena = (t_power_port *)std::calloc(g_num_power_port, sizeof(t_power_port))))
throw std::runtime_error("Couldn't get memory for <power_port> arena.");
if(!(power_static_power_arena = (t_power_static_power *)std::calloc(g_num_power_static_power, sizeof(t_power_static_power))))
throw std::runtime_error("Couldn't get memory for <power_static_power> arena.");
if(!(region_arena = (t_region *)std::calloc(g_num_region, sizeof(t_region))))
throw std::runtime_error("Couldn't get memory for <region> arena.");
if(!(row_arena = (t_row *)std::calloc(g_num_row, sizeof(t_row))))
throw std::runtime_error("Couldn't get memory for <row> arena.");
if(!(sb_loc_arena = (t_sb_loc *)std::calloc(g_num_sb_loc, sizeof(t_sb_loc))))
throw std::runtime_error("Couldn't get memory for <sb_loc> arena.");
if(!(segment_arena = (t_segment *)std::calloc(g_num_segment, sizeof(t_segment))))
throw std::runtime_error("Couldn't get memory for <segment> arena.");
if(!(segment_block_arena = (t_segment_block *)std::calloc(g_num_segment_block, sizeof(t_segment_block))))
throw std::runtime_error("Couldn't get memory for <segment_block> arena.");
if(!(segment_mux_arena = (t_segment_mux *)std::calloc(g_num_segment_mux, sizeof(t_segment_mux))))
throw std::runtime_error("Couldn't get memory for <segment_mux> arena.");
if(!(segment_wire_switch_arena = (t_segment_wire_switch *)std::calloc(g_num_segment_wire_switch, sizeof(t_segment_wire_switch))))
throw std::runtime_error("Couldn't get memory for <segment_wire_switch> arena.");
if(!(segmentlist_arena = (t_segmentlist *)std::calloc(g_num_segmentlist, sizeof(t_segmentlist))))
throw std::runtime_error("Couldn't get memory for <segmentlist> arena.");
if(!(single_arena = (t_single *)std::calloc(g_num_single, sizeof(t_single))))
throw std::runtime_error("Couldn't get memory for <single> arena.");
if(!(switch_arena = (t_switch *)std::calloc(g_num_switch, sizeof(t_switch))))
throw std::runtime_error("Couldn't get memory for <switch> arena.");
if(!(switchblock_arena = (t_switchblock *)std::calloc(g_num_switchblock, sizeof(t_switchblock))))
throw std::runtime_error("Couldn't get memory for <switchblock> arena.");
if(!(switchblock_func_arena = (t_switchblock_func *)std::calloc(g_num_switchblock_func, sizeof(t_switchblock_func))))
throw std::runtime_error("Couldn't get memory for <switchblock_func> arena.");
if(!(switchblock_location_arena = (t_switchblock_location *)std::calloc(g_num_switchblock_location, sizeof(t_switchblock_location))))
throw std::runtime_error("Couldn't get memory for <switchblock_location> arena.");
if(!(switchblock_locations_arena = (t_switchblock_locations *)std::calloc(g_num_switchblock_locations, sizeof(t_switchblock_locations))))
throw std::runtime_error("Couldn't get memory for <switchblock_locations> arena.");
if(!(switchblocklist_arena = (t_switchblocklist *)std::calloc(g_num_switchblocklist, sizeof(t_switchblocklist))))
throw std::runtime_error("Couldn't get memory for <switchblocklist> arena.");
if(!(switchlist_arena = (t_switchlist *)std::calloc(g_num_switchlist, sizeof(t_switchlist))))
throw std::runtime_error("Couldn't get memory for <switchlist> arena.");
if(!(tile_arena = (t_tile *)std::calloc(g_num_tile, sizeof(t_tile))))
throw std::runtime_error("Couldn't get memory for <tile> arena.");
if(!(tile_mode_arena = (t_tile_mode *)std::calloc(g_num_tile_mode, sizeof(t_tile_mode))))
throw std::runtime_error("Couldn't get memory for <tile_mode> arena.");
if(!(tiles_arena = (t_tiles *)std::calloc(g_num_tiles, sizeof(t_tiles))))
throw std::runtime_error("Couldn't get memory for <tiles> arena.");
if(!(wireconn_arena = (t_wireconn *)std::calloc(g_num_wireconn, sizeof(t_wireconn))))
throw std::runtime_error("Couldn't get memory for <wireconn> arena.");
if(!(wireconn_connection_arena = (t_wireconn_connection *)std::calloc(g_num_wireconn_connection, sizeof(t_wireconn_connection))))
throw std::runtime_error("Couldn't get memory for <wireconn_connection> arena.");
g_num_T_clock_timing = 0;
g_num_T_timing = 0;
g_num_T_timing_minmax = 0;
g_num_Tdel = 0;
g_num_chan_dist = 0;
g_num_clock = 0;
g_num_clocks = 0;
g_num_col = 0;
g_num_complexblocklist = 0;
g_num_corners = 0;
g_num_delay_matrix = 0;
g_num_device = 0;
g_num_direct = 0;
g_num_directlist = 0;
g_num_equivalent_tiles = 0;
g_num_fc = 0;
g_num_fc_override = 0;
g_num_fill = 0;
g_num_fixed_layout = 0;
g_num_func = 0;
g_num_global_power = 0;
g_num_interconnect = 0;
g_num_interconnect_type = 0;
g_num_layout = 0;
g_num_loc = 0;
g_num_map = 0;
g_num_meta = 0;
g_num_metadata = 0;
g_num_mode = 0;
g_num_model_type = 0;
g_num_models = 0;
g_num_pack_pattern = 0;
g_num_pb_type = 0;
g_num_pb_type_clock = 0;
g_num_pb_type_input = 0;
g_num_pb_type_output = 0;
g_num_perimeter = 0;
g_num_pinlocations = 0;
g_num_port = 0;
g_num_port_list = 0;
g_num_power = 0;
g_num_power_LUT_transistor_size = 0;
g_num_power_buffers = 0;
g_num_power_dynamic_power = 0;
g_num_power_ff_size = 0;
g_num_power_local_interconnect = 0;
g_num_power_mux_transistor_size = 0;
g_num_power_port = 0;
g_num_power_static_power = 0;
g_num_region = 0;
g_num_row = 0;
g_num_sb_loc = 0;
g_num_segment = 0;
g_num_segment_block = 0;
g_num_segment_mux = 0;
g_num_segment_wire_switch = 0;
g_num_segmentlist = 0;
g_num_single = 0;
g_num_switch = 0;
g_num_switchblock = 0;
g_num_switchblock_func = 0;
g_num_switchblock_location = 0;
g_num_switchblock_locations = 0;
g_num_switchblocklist = 0;
g_num_switchlist = 0;
g_num_tile = 0;
g_num_tile_mode = 0;
g_num_tiles = 0;
g_num_wireconn = 0;
g_num_wireconn_connection = 0;
}
/**
* Loading functions. These load the DOM data into the generated structures.
**/
void load_meta(const pugi::xml_node &root, t_meta *out){
out->value = strdup(root.child_value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->value.");
std::bitset<5> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_meta in = alex_t_meta(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <meta>.");
switch(in){
case atok_t_meta::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_meta::X_OFFSET:
out->x_offset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->x_offset.");
break;
case atok_t_meta::XOFFSET:
out->xoffset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->xoffset.");
break;
case atok_t_meta::Y_OFFSET:
out->y_offset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->y_offset.");
break;
case atok_t_meta::YOFFSET:
out->yoffset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->yoffset.");
break;
default: break; /* Not possible. */
}
}
std::bitset<5> test_state = astate | std::bitset<5>(0b11110);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_meta);
}
void load_port(const pugi::xml_node &root, t_port *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_port in = alex_t_port(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <port>.");
switch(in){
case atok_t_port::CLOCK:
out->clock = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->clock.");
break;
case atok_t_port::COMBINATIONAL_SINK_PORTS:
out->combinational_sink_ports = strdup(attr.value());
break;
case atok_t_port::IS_CLOCK:
out->is_clock = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a bool into out->is_clock.");
break;
case atok_t_port::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b0111);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_port);
}
void load_fill(const pugi::xml_node &root, t_fill *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_fill in = alex_t_fill(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <fill>.");
switch(in){
case atok_t_fill::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_fill::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_fill);
}
void load_perimeter(const pugi::xml_node &root, t_perimeter *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_perimeter in = alex_t_perimeter(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <perimeter>.");
switch(in){
case atok_t_perimeter::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_perimeter::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_perimeter);
}
void load_corners(const pugi::xml_node &root, t_corners *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_corners in = alex_t_corners(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <corners>.");
switch(in){
case atok_t_corners::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_corners::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_corners);
}
void load_col(const pugi::xml_node &root, t_col *out){
std::bitset<6> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_col in = alex_t_col(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <col>.");
switch(in){
case atok_t_col::INCRY:
out->incry = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->incry.");
break;
case atok_t_col::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_col::REPEATX:
out->repeatx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->repeatx.");
break;
case atok_t_col::STARTX:
out->startx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->startx.");
break;
case atok_t_col::STARTY:
out->starty = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->starty.");
break;
case atok_t_col::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<6> test_state = astate | std::bitset<6>(0b010101);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_col);
}
void load_row(const pugi::xml_node &root, t_row *out){
std::bitset<6> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_row in = alex_t_row(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <row>.");
switch(in){
case atok_t_row::INCRX:
out->incrx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->incrx.");
break;
case atok_t_row::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_row::REPEATY:
out->repeaty = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->repeaty.");
break;
case atok_t_row::STARTX:
out->startx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->startx.");
break;
case atok_t_row::STARTY:
out->starty = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->starty.");
break;
case atok_t_row::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<6> test_state = astate | std::bitset<6>(0b001101);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_row);
}
void load_region(const pugi::xml_node &root, t_region *out){
std::bitset<10> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_region in = alex_t_region(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <region>.");
switch(in){
case atok_t_region::ENDX:
out->endx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->endx.");
break;
case atok_t_region::ENDY:
out->endy = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->endy.");
break;
case atok_t_region::INCRX:
out->incrx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->incrx.");
break;
case atok_t_region::INCRY:
out->incry = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->incry.");
break;
case atok_t_region::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_region::REPEATX:
out->repeatx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->repeatx.");
break;
case atok_t_region::REPEATY:
out->repeaty = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->repeaty.");
break;
case atok_t_region::STARTX:
out->startx = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->startx.");
break;
case atok_t_region::STARTY:
out->starty = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->starty.");
break;
case atok_t_region::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<10> test_state = astate | std::bitset<10>(0b0111101111);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_region);
}
void load_chan_dist(const pugi::xml_node &root, t_chan_dist *out){
std::bitset<5> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_chan_dist in = alex_t_chan_dist(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <chan_dist>.");
switch(in){
case atok_t_chan_dist::DC:
out->dc = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->dc.");
break;
case atok_t_chan_dist::DISTR:
out->distr = lex_chan_distribution(attr.value(), true);
break;
case atok_t_chan_dist::PEAK:
out->peak = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->peak.");
break;
case atok_t_chan_dist::WIDTH:
out->width = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->width.");
break;
case atok_t_chan_dist::XPEAK:
out->xpeak = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->xpeak.");
break;
default: break; /* Not possible. */
}
}
std::bitset<5> test_state = astate | std::bitset<5>(0b11001);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_chan_dist);
}
void load_pb_type_clock(const pugi::xml_node &root, t_pb_type_clock *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_pb_type_clock in = alex_t_pb_type_clock(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <pb_type_clock>.");
switch(in){
case atok_t_pb_type_clock::EQUIVALENT:
out->equivalent = lex_pb_clock_equivalent(attr.value(), true);
break;
case atok_t_pb_type_clock::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_pb_type_clock::NUM_PINS:
out->num_pins = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->num_pins.");
break;
case atok_t_pb_type_clock::PORT_CLASS:
out->port_class = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->port_class.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b1001);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_pb_type_clock);
}
void load_delay_matrix(const pugi::xml_node &root, t_delay_matrix *out){
out->value = strdup(root.child_value());
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_delay_matrix in = alex_t_delay_matrix(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <delay_matrix>.");
switch(in){
case atok_t_delay_matrix::IN_PORT:
out->in_port = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->in_port.");
break;
case atok_t_delay_matrix::OUT_PORT:
out->out_port = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->out_port.");
break;
case atok_t_delay_matrix::TYPE:
out->type = lex_delay_matrix_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_delay_matrix);
}
void load_T_timing_minmax(const pugi::xml_node &root, t_T_timing_minmax *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_T_timing_minmax in = alex_t_T_timing_minmax(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <T_timing_minmax>.");
switch(in){
case atok_t_T_timing_minmax::IN_PORT:
out->in_port = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->in_port.");
break;
case atok_t_T_timing_minmax::MAX:
out->max = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->max.");
break;
case atok_t_T_timing_minmax::MIN:
out->min = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->min.");
break;
case atok_t_T_timing_minmax::OUT_PORT:
out->out_port = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->out_port.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b0110);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_T_timing_minmax);
}
void load_T_timing(const pugi::xml_node &root, t_T_timing *out){
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_T_timing in = alex_t_T_timing(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <T_timing>.");
switch(in){
case atok_t_T_timing::CLOCK:
out->clock = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->clock.");
break;
case atok_t_T_timing::PORT:
out->port = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->port.");
break;
case atok_t_T_timing::VALUE:
out->value = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->value.");
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_T_timing);
}
void load_T_clock_timing(const pugi::xml_node &root, t_T_clock_timing *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_T_clock_timing in = alex_t_T_clock_timing(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <T_clock_timing>.");
switch(in){
case atok_t_T_clock_timing::CLOCK:
out->clock = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->clock.");
break;
case atok_t_T_clock_timing::MAX:
out->max = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->max.");
break;
case atok_t_T_clock_timing::MIN:
out->min = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->min.");
break;
case atok_t_T_clock_timing::PORT:
out->port = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->port.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b0110);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_T_clock_timing);
}
void load_pack_pattern(const pugi::xml_node &root, t_pack_pattern *out){
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_pack_pattern in = alex_t_pack_pattern(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <pack_pattern>.");
switch(in){
case atok_t_pack_pattern::IN_PORT:
out->in_port = strdup(attr.value());
break;
case atok_t_pack_pattern::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_pack_pattern::OUT_PORT:
out->out_port = strdup(attr.value());
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_pack_pattern);
}
void load_power_dynamic_power(const pugi::xml_node &root, t_power_dynamic_power *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_dynamic_power in = alex_t_power_dynamic_power(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_dynamic_power>.");
switch(in){
case atok_t_power_dynamic_power::C_INTERNAL:
out->C_internal = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->C_internal.");
break;
case atok_t_power_dynamic_power::POWER_PER_INSTANCE:
out->power_per_instance = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->power_per_instance.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b11);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_dynamic_power);
}
void load_power_static_power(const pugi::xml_node &root, t_power_static_power *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_static_power in = alex_t_power_static_power(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_static_power>.");
switch(in){
case atok_t_power_static_power::POWER_PER_INSTANCE:
out->power_per_instance = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->power_per_instance.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b1);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_static_power);
}
void load_power_port(const pugi::xml_node &root, t_power_port *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_port in = alex_t_power_port(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_port>.");
switch(in){
case atok_t_power_port::ENERGY_PER_TOGGLE:
out->energy_per_toggle = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->energy_per_toggle.");
break;
case atok_t_power_port::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_power_port::SCALED_BY_STATIC_PROB:
out->scaled_by_static_prob = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->scaled_by_static_prob.");
break;
case atok_t_power_port::SCALED_BY_STATIC_PROB_N:
out->scaled_by_static_prob_n = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->scaled_by_static_prob_n.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b1100);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_port);
}
void load_power_local_interconnect(const pugi::xml_node &root, t_power_local_interconnect *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_local_interconnect in = alex_t_power_local_interconnect(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_local_interconnect>.");
switch(in){
case atok_t_power_local_interconnect::C_WIRE:
out->C_wire = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->C_wire.");
break;
case atok_t_power_local_interconnect::FACTOR:
out->factor = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->factor.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b10);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_local_interconnect);
}
void load_power_buffers(const pugi::xml_node &root, t_power_buffers *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_buffers in = alex_t_power_buffers(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_buffers>.");
switch(in){
case atok_t_power_buffers::LOGICAL_EFFORT_FACTOR:
out->logical_effort_factor = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->logical_effort_factor.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b1);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_buffers);
}
void load_power_ff_size(const pugi::xml_node &root, t_power_ff_size *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_ff_size in = alex_t_power_ff_size(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_ff_size>.");
switch(in){
case atok_t_power_ff_size::FF_SIZE:
out->FF_size = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->FF_size.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_ff_size);
}
void load_power_LUT_transistor_size(const pugi::xml_node &root, t_power_LUT_transistor_size *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_LUT_transistor_size in = alex_t_power_LUT_transistor_size(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_LUT_transistor_size>.");
switch(in){
case atok_t_power_LUT_transistor_size::LUT_TRANSISTOR_SIZE:
out->LUT_transistor_size = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->LUT_transistor_size.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_LUT_transistor_size);
}
void load_power_mux_transistor_size(const pugi::xml_node &root, t_power_mux_transistor_size *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power_mux_transistor_size in = alex_t_power_mux_transistor_size(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power_mux_transistor_size>.");
switch(in){
case atok_t_power_mux_transistor_size::MUX_TRANSISTOR_SIZE:
out->mux_transistor_size = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->mux_transistor_size.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power_mux_transistor_size);
}
void load_loc(const pugi::xml_node &root, t_loc *out){
out->value = strdup(root.child_value());
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_loc in = alex_t_loc(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <loc>.");
switch(in){
case atok_t_loc::SIDE:
out->side = lex_loc_side(attr.value(), true);
break;
case atok_t_loc::XOFFSET:
out->xoffset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->xoffset.");
break;
case atok_t_loc::YOFFSET:
out->yoffset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->yoffset.");
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b110);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_loc);
}
void load_sb_loc(const pugi::xml_node &root, t_sb_loc *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_sb_loc in = alex_t_sb_loc(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <sb_loc>.");
switch(in){
case atok_t_sb_loc::SWITCH_OVERRIDE:
out->switch_override = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->switch_override.");
break;
case atok_t_sb_loc::TYPE:
out->type = lex_sb_loc_type(attr.value(), true);
break;
case atok_t_sb_loc::XOFFSET:
out->xoffset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->xoffset.");
break;
case atok_t_sb_loc::YOFFSET:
out->yoffset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->yoffset.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b1111);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_sb_loc);
}
void load_map(const pugi::xml_node &root, t_map *out){
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_map in = alex_t_map(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <map>.");
switch(in){
case atok_t_map::FROM:
out->from = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->from.");
break;
case atok_t_map::NUM_PINS:
out->num_pins = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->num_pins.");
break;
case atok_t_map::TO:
out->to = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->to.");
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b010);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_map);
}
void load_segment_block(const pugi::xml_node &root, t_segment_block *out){
out->value = strdup(root.child_value());
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_segment_block in = alex_t_segment_block(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <segment_block>.");
switch(in){
case atok_t_segment_block::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_segment_block);
}
void load_segment_mux(const pugi::xml_node &root, t_segment_mux *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_segment_mux in = alex_t_segment_mux(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <segment_mux>.");
switch(in){
case atok_t_segment_mux::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_segment_mux);
}
void load_segment_wire_switch(const pugi::xml_node &root, t_segment_wire_switch *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_segment_wire_switch in = alex_t_segment_wire_switch(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <segment_wire_switch>.");
switch(in){
case atok_t_segment_wire_switch::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_segment_wire_switch);
}
void load_direct(const pugi::xml_node &root, t_direct *out){
std::bitset<7> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_direct in = alex_t_direct(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <direct>.");
switch(in){
case atok_t_direct::FROM_PIN:
out->from_pin = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->from_pin.");
break;
case atok_t_direct::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_direct::SWITCH_NAME:
out->switch_name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->switch_name.");
break;
case atok_t_direct::TO_PIN:
out->to_pin = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->to_pin.");
break;
case atok_t_direct::X_OFFSET:
out->x_offset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->x_offset.");
break;
case atok_t_direct::Y_OFFSET:
out->y_offset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->y_offset.");
break;
case atok_t_direct::Z_OFFSET:
out->z_offset = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->z_offset.");
break;
default: break; /* Not possible. */
}
}
std::bitset<7> test_state = astate | std::bitset<7>(0b0000100);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_direct);
}
void load_switchblock_location(const pugi::xml_node &root, t_switchblock_location *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_switchblock_location in = alex_t_switchblock_location(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <switchblock_location>.");
switch(in){
case atok_t_switchblock_location::TYPE:
out->type = lex_switchblock_location_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_switchblock_location);
}
void load_wireconn_connection(const pugi::xml_node &root, t_wireconn_connection *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_wireconn_connection in = alex_t_wireconn_connection(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <wireconn_connection>.");
switch(in){
case atok_t_wireconn_connection::SWITCHPOINT:
out->switchpoint = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->switchpoint.");
break;
case atok_t_wireconn_connection::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_wireconn_connection);
}
void load_clock(const pugi::xml_node &root, t_clock *out){
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_clock in = alex_t_clock(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <clock>.");
switch(in){
case atok_t_clock::C_WIRE:
out->C_wire = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->C_wire.");
break;
case atok_t_clock::C_WIRE_PER_M:
out->C_wire_per_m = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->C_wire_per_m.");
break;
case atok_t_clock::BUFFER_SIZE:
out->buffer_size.tag = type_tag::ENUM_BUF_SIZE;
out->buffer_size.as_enum_buf_size = lex_buf_size(attr.value(), false);
if(out->buffer_size.as_enum_buf_size != enum_buf_size::UXSD_INVALID)
break;
out->buffer_size.tag = type_tag::DOUBLE;
out->buffer_size.as_double = std::strtod(attr.value(), NULL);
if(errno == 0)
break;
throw std::runtime_error("Couldn't load a suitable value into union buf_size.");
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b111);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_clock);
}
void load_sizing(const pugi::xml_node &root, t_sizing *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_sizing in = alex_t_sizing(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <sizing>.");
switch(in){
case atok_t_sizing::R_MINW_NMOS:
out->R_minW_nmos = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->R_minW_nmos.");
break;
case atok_t_sizing::R_MINW_PMOS:
out->R_minW_pmos = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->R_minW_pmos.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_sizing);
}
void load_connection_block(const pugi::xml_node &root, t_connection_block *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_connection_block in = alex_t_connection_block(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <connection_block>.");
switch(in){
case atok_t_connection_block::INPUT_SWITCH_NAME:
out->input_switch_name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->input_switch_name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_connection_block);
}
void load_area(const pugi::xml_node &root, t_area *out){
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_area in = alex_t_area(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <area>.");
switch(in){
case atok_t_area::GRID_LOGIC_TILE_AREA:
out->grid_logic_tile_area = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->grid_logic_tile_area.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_area);
}
void load_switch_block(const pugi::xml_node &root, t_switch_block *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_switch_block in = alex_t_switch_block(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <switch_block>.");
switch(in){
case atok_t_switch_block::FS:
out->fs = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->fs.");
break;
case atok_t_switch_block::TYPE:
out->type = lex_switch_block_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b01);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_switch_block);
}
void load_default_fc(const pugi::xml_node &root, t_default_fc *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_default_fc in = alex_t_default_fc(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <default_fc>.");
switch(in){
case atok_t_default_fc::IN_TYPE:
out->in_type = lex_fc_type_enum(attr.value(), true);
break;
case atok_t_default_fc::IN_VAL:
out->in_val = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->in_val.");
break;
case atok_t_default_fc::OUT_TYPE:
out->out_type = lex_fc_type_enum(attr.value(), true);
break;
case atok_t_default_fc::OUT_VAL:
out->out_val = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->out_val.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b1111);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_default_fc);
}
void load_Tdel(const pugi::xml_node &root, t_Tdel *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_Tdel in = alex_t_Tdel(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <Tdel>.");
switch(in){
case atok_t_Tdel::DELAY:
out->delay = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->delay.");
break;
case atok_t_Tdel::NUM_INPUTS:
out->num_inputs = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->num_inputs.");
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_Tdel);
}
void load_fc_override(const pugi::xml_node &root, t_fc_override *out){
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_fc_override in = alex_t_fc_override(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <fc_override>.");
switch(in){
case atok_t_fc_override::FC_TYPE:
out->fc_type = lex_fc_type_enum(attr.value(), true);
break;
case atok_t_fc_override::FC_VAL:
out->fc_val = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->fc_val.");
break;
case atok_t_fc_override::PORT_NAME:
out->port_name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->port_name.");
break;
case atok_t_fc_override::SEGMENT_NAME:
out->segment_name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->segment_name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b1100);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_fc_override);
}
void load_func(const pugi::xml_node &root, t_func *out){
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_func in = alex_t_func(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <func>.");
switch(in){
case atok_t_func::FORMULA:
out->formula = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->formula.");
break;
case atok_t_func::TYPE:
out->type = lex_func_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_func);
}
void load_metadata(const pugi::xml_node &root, t_metadata *out){
out->meta_list = &meta_arena[g_num_meta];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_metadata in = glex_t_metadata(node.name());
switch(in){
case gtok_t_metadata::META:
load_meta(node, &meta_arena[g_num_meta]);
g_num_meta++;
out->num_meta++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <metadata>.");
}
void load_port_list(const pugi::xml_node &root, t_port_list *out){
out->port_list = &port_arena[g_num_port];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_port_list in = glex_t_port_list(node.name());
switch(in){
case gtok_t_port_list::PORT:
load_port(node, &port_arena[g_num_port]);
g_num_port++;
out->num_port++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <port_list>.");
}
void load_chan_width_distr(const pugi::xml_node &root, t_chan_width_distr *out){
out->x_list = &chan_dist_arena[g_num_chan_dist];
out->y_list = &chan_dist_arena[g_num_chan_dist];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_chan_width_distr in = glex_t_chan_width_distr(node.name());
switch(in){
case gtok_t_chan_width_distr::X:
load_chan_dist(node, &chan_dist_arena[g_num_chan_dist]);
g_num_chan_dist++;
out->num_x++;
break;
case gtok_t_chan_width_distr::Y:
load_chan_dist(node, &chan_dist_arena[g_num_chan_dist]);
g_num_chan_dist++;
out->num_y++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <chan_width_distr>.");
}
void load_switch(const pugi::xml_node &root, t_switch *out){
out->Tdel_list = &Tdel_arena[g_num_Tdel];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switch in = glex_t_switch(node.name());
switch(in){
case gtok_t_switch::TDEL:
load_Tdel(node, &Tdel_arena[g_num_Tdel]);
g_num_Tdel++;
out->num_Tdel++;
break;
default: break; /* Not possible. */
}
}
std::bitset<10> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_switch in = alex_t_switch(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <switch>.");
switch(in){
case atok_t_switch::CIN:
out->Cin = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->Cin.");
break;
case atok_t_switch::CINTERNAL:
out->Cinternal = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->Cinternal.");
break;
case atok_t_switch::COUT:
out->Cout = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->Cout.");
break;
case atok_t_switch::R:
out->R = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->R.");
break;
case atok_t_switch::TDEL:
out->Tdel = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->Tdel.");
break;
case atok_t_switch::BUF_SIZE:
out->buf_size.tag = type_tag::ENUM_BUF_SIZE;
out->buf_size.as_enum_buf_size = lex_buf_size(attr.value(), false);
if(out->buf_size.as_enum_buf_size != enum_buf_size::UXSD_INVALID)
break;
out->buf_size.tag = type_tag::DOUBLE;
out->buf_size.as_double = std::strtod(attr.value(), NULL);
if(errno == 0)
break;
throw std::runtime_error("Couldn't load a suitable value into union buf_size.");
break;
case atok_t_switch::MUX_TRANS_SIZE:
out->mux_trans_size = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->mux_trans_size.");
break;
case atok_t_switch::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_switch::POWER_BUF_SIZE:
out->power_buf_size = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->power_buf_size.");
break;
case atok_t_switch::TYPE:
out->type = lex_switch_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<10> test_state = astate | std::bitset<10>(0b0101110110);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_switch);
}
void load_power(const pugi::xml_node &root, t_power *out){
out->dynamic_power_list = &power_dynamic_power_arena[g_num_power_dynamic_power];
out->static_power_list = &power_static_power_arena[g_num_power_static_power];
out->port_list = &power_port_arena[g_num_power_port];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_power in = glex_t_power(node.name());
switch(in){
case gtok_t_power::DYNAMIC_POWER:
load_power_dynamic_power(node, &power_dynamic_power_arena[g_num_power_dynamic_power]);
g_num_power_dynamic_power++;
out->num_dynamic_power++;
break;
case gtok_t_power::STATIC_POWER:
load_power_static_power(node, &power_static_power_arena[g_num_power_static_power]);
g_num_power_static_power++;
out->num_static_power++;
break;
case gtok_t_power::PORT:
load_power_port(node, &power_port_arena[g_num_power_port]);
g_num_power_port++;
out->num_port++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_power in = alex_t_power(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <power>.");
switch(in){
case atok_t_power::METHOD:
out->method = lex_power_estimation_method(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b1);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_power);
}
void load_global_power(const pugi::xml_node &root, t_global_power *out){
out->local_interconnect_list = &power_local_interconnect_arena[g_num_power_local_interconnect];
out->buffers_list = &power_buffers_arena[g_num_power_buffers];
out->mux_transistor_size_list = &power_mux_transistor_size_arena[g_num_power_mux_transistor_size];
out->FF_size_list = &power_ff_size_arena[g_num_power_ff_size];
out->LUT_transistor_size_list = &power_LUT_transistor_size_arena[g_num_power_LUT_transistor_size];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_global_power in = glex_t_global_power(node.name());
switch(in){
case gtok_t_global_power::LOCAL_INTERCONNECT:
load_power_local_interconnect(node, &power_local_interconnect_arena[g_num_power_local_interconnect]);
g_num_power_local_interconnect++;
out->num_local_interconnect++;
break;
case gtok_t_global_power::BUFFERS:
load_power_buffers(node, &power_buffers_arena[g_num_power_buffers]);
g_num_power_buffers++;
out->num_buffers++;
break;
case gtok_t_global_power::MUX_TRANSISTOR_SIZE:
load_power_mux_transistor_size(node, &power_mux_transistor_size_arena[g_num_power_mux_transistor_size]);
g_num_power_mux_transistor_size++;
out->num_mux_transistor_size++;
break;
case gtok_t_global_power::FF_SIZE:
load_power_ff_size(node, &power_ff_size_arena[g_num_power_ff_size]);
g_num_power_ff_size++;
out->num_FF_size++;
break;
case gtok_t_global_power::LUT_TRANSISTOR_SIZE:
load_power_LUT_transistor_size(node, &power_LUT_transistor_size_arena[g_num_power_LUT_transistor_size]);
g_num_power_LUT_transistor_size++;
out->num_LUT_transistor_size++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_global_power in = alex_t_global_power(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <global_power>.");
switch(in){
case atok_t_global_power::METHOD:
out->method = lex_power_estimation_method(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b1);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_global_power);
}
void load_pinlocations(const pugi::xml_node &root, t_pinlocations *out){
out->loc_list = &loc_arena[g_num_loc];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pinlocations in = glex_t_pinlocations(node.name());
switch(in){
case gtok_t_pinlocations::LOC:
load_loc(node, &loc_arena[g_num_loc]);
g_num_loc++;
out->num_loc++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_pinlocations in = alex_t_pinlocations(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <pinlocations>.");
switch(in){
case atok_t_pinlocations::PATTERN:
out->pattern = lex_pinlocations_pattern(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b1);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_pinlocations);
}
void load_switchblock_locations(const pugi::xml_node &root, t_switchblock_locations *out){
out->sb_loc_list = &sb_loc_arena[g_num_sb_loc];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblock_locations in = glex_t_switchblock_locations(node.name());
switch(in){
case gtok_t_switchblock_locations::SB_LOC:
load_sb_loc(node, &sb_loc_arena[g_num_sb_loc]);
g_num_sb_loc++;
out->num_sb_loc++;
break;
default: break; /* Not possible. */
}
}
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_switchblock_locations in = alex_t_switchblock_locations(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <switchblock_locations>.");
switch(in){
case atok_t_switchblock_locations::INTERNAL_SWITCH:
out->internal_switch = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->internal_switch.");
break;
case atok_t_switchblock_locations::PATTERN:
out->pattern = lex_switchblock_locations_pattern(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b11);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_switchblock_locations);
}
void load_fc(const pugi::xml_node &root, t_fc *out){
out->fc_override_list = &fc_override_arena[g_num_fc_override];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_fc in = glex_t_fc(node.name());
switch(in){
case gtok_t_fc::FC_OVERRIDE:
load_fc_override(node, &fc_override_arena[g_num_fc_override]);
g_num_fc_override++;
out->num_fc_override++;
break;
default: break; /* Not possible. */
}
}
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_fc in = alex_t_fc(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <fc>.");
switch(in){
case atok_t_fc::IN_TYPE:
out->in_type = lex_fc_type_enum(attr.value(), true);
break;
case atok_t_fc::IN_VAL:
out->in_val = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->in_val.");
break;
case atok_t_fc::OUT_TYPE:
out->out_type = lex_fc_type_enum(attr.value(), true);
break;
case atok_t_fc::OUT_VAL:
out->out_val = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->out_val.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b0000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_fc);
}
void load_tile_mode(const pugi::xml_node &root, t_tile_mode *out){
out->map_list = &map_arena[g_num_map];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_tile_mode in = glex_t_tile_mode(node.name());
switch(in){
case gtok_t_tile_mode::MAP:
load_map(node, &map_arena[g_num_map]);
g_num_map++;
out->num_map++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_tile_mode in = alex_t_tile_mode(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <tile_mode>.");
switch(in){
case atok_t_tile_mode::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_tile_mode);
}
void load_segment(const pugi::xml_node &root, t_segment *out){
out->sb_list = &segment_block_arena[g_num_segment_block];
out->cb_list = &segment_block_arena[g_num_segment_block];
out->mux_list = &segment_mux_arena[g_num_segment_mux];
out->wire_switch_list = &segment_wire_switch_arena[g_num_segment_wire_switch];
out->opin_switch_list = &segment_wire_switch_arena[g_num_segment_wire_switch];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_segment in = glex_t_segment(node.name());
switch(in){
case gtok_t_segment::SB:
load_segment_block(node, &segment_block_arena[g_num_segment_block]);
g_num_segment_block++;
out->num_sb++;
break;
case gtok_t_segment::CB:
load_segment_block(node, &segment_block_arena[g_num_segment_block]);
g_num_segment_block++;
out->num_cb++;
break;
case gtok_t_segment::MUX:
load_segment_mux(node, &segment_mux_arena[g_num_segment_mux]);
g_num_segment_mux++;
out->num_mux++;
break;
case gtok_t_segment::WIRE_SWITCH:
load_segment_wire_switch(node, &segment_wire_switch_arena[g_num_segment_wire_switch]);
g_num_segment_wire_switch++;
out->num_wire_switch++;
break;
case gtok_t_segment::OPIN_SWITCH:
load_segment_wire_switch(node, &segment_wire_switch_arena[g_num_segment_wire_switch]);
g_num_segment_wire_switch++;
out->num_opin_switch++;
break;
default: break; /* Not possible. */
}
}
std::bitset<6> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_segment in = alex_t_segment(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <segment>.");
switch(in){
case atok_t_segment::CMETAL:
out->Cmetal = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->Cmetal.");
break;
case atok_t_segment::RMETAL:
out->Rmetal = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->Rmetal.");
break;
case atok_t_segment::FREQ:
out->freq = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->freq.");
break;
case atok_t_segment::LENGTH:
out->length.tag = type_tag::ENUM_SEGMENT_LENGTH;
out->length.as_enum_segment_length = lex_segment_length(attr.value(), false);
if(out->length.as_enum_segment_length != enum_segment_length::UXSD_INVALID)
break;
out->length.tag = type_tag::UNSIGNED_INT;
out->length.as_unsigned_int = std::strtoul(attr.value(), NULL, 10);
if(errno == 0)
break;
throw std::runtime_error("Couldn't load a suitable value into union segment_length.");
break;
case atok_t_segment::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_segment::TYPE:
out->type = lex_segment_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<6> test_state = astate | std::bitset<6>(0b010000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_segment);
}
void load_directlist(const pugi::xml_node &root, t_directlist *out){
out->direct_list = &direct_arena[g_num_direct];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_directlist in = glex_t_directlist(node.name());
switch(in){
case gtok_t_directlist::DIRECT:
load_direct(node, &direct_arena[g_num_direct]);
g_num_direct++;
out->num_direct++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <directlist>.");
}
void load_switchblock_func(const pugi::xml_node &root, t_switchblock_func *out){
out->func_list = &func_arena[g_num_func];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblock_func in = glex_t_switchblock_func(node.name());
switch(in){
case gtok_t_switchblock_func::FUNC:
load_func(node, &func_arena[g_num_func]);
g_num_func++;
out->num_func++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <switchblock_func>.");
}
void load_wireconn(const pugi::xml_node &root, t_wireconn *out){
out->from_list = &wireconn_connection_arena[g_num_wireconn_connection];
out->to_list = &wireconn_connection_arena[g_num_wireconn_connection];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_wireconn in = glex_t_wireconn(node.name());
switch(in){
case gtok_t_wireconn::FROM:
load_wireconn_connection(node, &wireconn_connection_arena[g_num_wireconn_connection]);
g_num_wireconn_connection++;
out->num_from++;
break;
case gtok_t_wireconn::TO:
load_wireconn_connection(node, &wireconn_connection_arena[g_num_wireconn_connection]);
g_num_wireconn_connection++;
out->num_to++;
break;
default: break; /* Not possible. */
}
}
std::bitset<5> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_wireconn in = alex_t_wireconn(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <wireconn>.");
switch(in){
case atok_t_wireconn::FROM_SWITCHPOINT:
out->from_switchpoint = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->from_switchpoint.");
break;
case atok_t_wireconn::FROM_TYPE:
out->from_type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->from_type.");
break;
case atok_t_wireconn::NUM_CONNS_TYPE:
out->num_conns_type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->num_conns_type.");
break;
case atok_t_wireconn::TO_SWITCHPOINT:
out->to_switchpoint = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->to_switchpoint.");
break;
case atok_t_wireconn::TO_TYPE:
out->to_type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->to_type.");
break;
default: break; /* Not possible. */
}
}
std::bitset<5> test_state = astate | std::bitset<5>(0b11011);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_wireconn);
}
void load_clocks(const pugi::xml_node &root, t_clocks *out){
out->clock_list = &clock_arena[g_num_clock];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_clocks in = glex_t_clocks(node.name());
switch(in){
case gtok_t_clocks::CLOCK:
load_clock(node, &clock_arena[g_num_clock]);
g_num_clock++;
out->num_clock++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <clocks>.");
}
void load_model_type(const pugi::xml_node &root, t_model_type *out){
out->input_ports_list = &port_list_arena[g_num_port_list];
out->output_ports_list = &port_list_arena[g_num_port_list];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_model_type in = glex_t_model_type(node.name());
switch(in){
case gtok_t_model_type::INPUT_PORTS:
load_port_list(node, &port_list_arena[g_num_port_list]);
g_num_port_list++;
out->num_input_ports++;
break;
case gtok_t_model_type::OUTPUT_PORTS:
load_port_list(node, &port_list_arena[g_num_port_list]);
g_num_port_list++;
out->num_output_ports++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_model_type in = alex_t_model_type(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <model_type>.");
switch(in){
case atok_t_model_type::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_model_type);
}
void load_single(const pugi::xml_node &root, t_single *out){
out->metadata_list = &metadata_arena[g_num_metadata];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_single in = glex_t_single(node.name());
switch(in){
case gtok_t_single::METADATA:
load_metadata(node, &metadata_arena[g_num_metadata]);
g_num_metadata++;
out->num_metadata++;
break;
default: break; /* Not possible. */
}
}
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_single in = alex_t_single(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <single>.");
switch(in){
case atok_t_single::PRIORITY:
out->priority = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->priority.");
break;
case atok_t_single::TYPE:
out->type = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->type.");
break;
case atok_t_single::X:
out->x = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->x.");
break;
case atok_t_single::Y:
out->y = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->y.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b0000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_single);
}
void load_device(const pugi::xml_node &root, t_device *out){
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_device in = glex_t_device(node.name());
switch(in){
case gtok_t_device::SIZING:
load_sizing(node, &out->sizing);
break;
case gtok_t_device::CONNECTION_BLOCK:
load_connection_block(node, &out->connection_block);
break;
case gtok_t_device::AREA:
load_area(node, &out->area);
break;
case gtok_t_device::SWITCH_BLOCK:
load_switch_block(node, &out->switch_block);
break;
case gtok_t_device::CHAN_WIDTH_DISTR:
load_chan_width_distr(node, &out->chan_width_distr);
break;
case gtok_t_device::DEFAULT_FC:
load_default_fc(node, &out->default_fc);
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <device>.");
}
void load_switchlist(const pugi::xml_node &root, t_switchlist *out){
out->switch_list = &switch_arena[g_num_switch];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchlist in = glex_t_switchlist(node.name());
switch(in){
case gtok_t_switchlist::SWITCH:
load_switch(node, &switch_arena[g_num_switch]);
g_num_switch++;
out->num_switch++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <switchlist>.");
}
void load_pb_type_input(const pugi::xml_node &root, t_pb_type_input *out){
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pb_type_input in = glex_t_pb_type_input(node.name());
switch(in){
case gtok_t_pb_type_input::METADATA:
load_metadata(node, &out->metadata);
break;
default: break; /* Not possible. */
}
}
std::bitset<5> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_pb_type_input in = alex_t_pb_type_input(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <pb_type_input>.");
switch(in){
case atok_t_pb_type_input::EQUIVALENT:
out->equivalent = lex_pb_input_equivalent(attr.value(), true);
break;
case atok_t_pb_type_input::IS_NON_CLOCK_GLOBAL:
out->is_non_clock_global = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a bool into out->is_non_clock_global.");
break;
case atok_t_pb_type_input::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_pb_type_input::NUM_PINS:
out->num_pins = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->num_pins.");
break;
case atok_t_pb_type_input::PORT_CLASS:
out->port_class = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->port_class.");
break;
default: break; /* Not possible. */
}
}
std::bitset<5> test_state = astate | std::bitset<5>(0b10011);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_pb_type_input);
}
void load_pb_type_output(const pugi::xml_node &root, t_pb_type_output *out){
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pb_type_output in = glex_t_pb_type_output(node.name());
switch(in){
case gtok_t_pb_type_output::METADATA:
load_metadata(node, &out->metadata);
break;
default: break; /* Not possible. */
}
}
std::bitset<4> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_pb_type_output in = alex_t_pb_type_output(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <pb_type_output>.");
switch(in){
case atok_t_pb_type_output::EQUIVALENT:
out->equivalent = lex_pb_output_equivalent(attr.value(), true);
break;
case atok_t_pb_type_output::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_pb_type_output::NUM_PINS:
out->num_pins = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->num_pins.");
break;
case atok_t_pb_type_output::PORT_CLASS:
out->port_class = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->port_class.");
break;
default: break; /* Not possible. */
}
}
std::bitset<4> test_state = astate | std::bitset<4>(0b1001);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_pb_type_output);
}
void load_interconnect_type(const pugi::xml_node &root, t_interconnect_type *out){
out->pack_pattern_list = &pack_pattern_arena[g_num_pack_pattern];
out->delay_constant_list = &T_timing_minmax_arena[g_num_T_timing_minmax];
out->delay_matrix_list = &delay_matrix_arena[g_num_delay_matrix];
out->metadata_list = &metadata_arena[g_num_metadata];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_interconnect_type in = glex_t_interconnect_type(node.name());
switch(in){
case gtok_t_interconnect_type::PACK_PATTERN:
load_pack_pattern(node, &pack_pattern_arena[g_num_pack_pattern]);
g_num_pack_pattern++;
out->num_pack_pattern++;
break;
case gtok_t_interconnect_type::DELAY_CONSTANT:
load_T_timing_minmax(node, &T_timing_minmax_arena[g_num_T_timing_minmax]);
g_num_T_timing_minmax++;
out->num_delay_constant++;
break;
case gtok_t_interconnect_type::DELAY_MATRIX:
load_delay_matrix(node, &delay_matrix_arena[g_num_delay_matrix]);
g_num_delay_matrix++;
out->num_delay_matrix++;
break;
case gtok_t_interconnect_type::METADATA:
load_metadata(node, &metadata_arena[g_num_metadata]);
g_num_metadata++;
out->num_metadata++;
break;
default: break; /* Not possible. */
}
}
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_interconnect_type in = alex_t_interconnect_type(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <interconnect_type>.");
switch(in){
case atok_t_interconnect_type::INPUT:
out->input = strdup(attr.value());
break;
case atok_t_interconnect_type::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_interconnect_type::OUTPUT:
out->output = strdup(attr.value());
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_interconnect_type);
}
void load_equivalent_tiles(const pugi::xml_node &root, t_equivalent_tiles *out){
out->mode_list = &tile_mode_arena[g_num_tile_mode];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_equivalent_tiles in = glex_t_equivalent_tiles(node.name());
switch(in){
case gtok_t_equivalent_tiles::MODE:
load_tile_mode(node, &tile_mode_arena[g_num_tile_mode]);
g_num_tile_mode++;
out->num_mode++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <equivalent_tiles>.");
}
void load_segmentlist(const pugi::xml_node &root, t_segmentlist *out){
out->segment_list = &segment_arena[g_num_segment];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_segmentlist in = glex_t_segmentlist(node.name());
switch(in){
case gtok_t_segmentlist::SEGMENT:
load_segment(node, &segment_arena[g_num_segment]);
g_num_segment++;
out->num_segment++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <segmentlist>.");
}
void load_switchblock(const pugi::xml_node &root, t_switchblock *out){
out->switchblock_location_list = &switchblock_location_arena[g_num_switchblock_location];
out->switchfuncs_list = &switchblock_func_arena[g_num_switchblock_func];
out->wireconn_list = &wireconn_arena[g_num_wireconn];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblock in = glex_t_switchblock(node.name());
switch(in){
case gtok_t_switchblock::SWITCHBLOCK_LOCATION:
load_switchblock_location(node, &switchblock_location_arena[g_num_switchblock_location]);
g_num_switchblock_location++;
out->num_switchblock_location++;
break;
case gtok_t_switchblock::SWITCHFUNCS:
load_switchblock_func(node, &switchblock_func_arena[g_num_switchblock_func]);
g_num_switchblock_func++;
out->num_switchfuncs++;
break;
case gtok_t_switchblock::WIRECONN:
load_wireconn(node, &wireconn_arena[g_num_wireconn]);
g_num_wireconn++;
out->num_wireconn++;
break;
default: break; /* Not possible. */
}
}
std::bitset<2> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_switchblock in = alex_t_switchblock(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <switchblock>.");
switch(in){
case atok_t_switchblock::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_switchblock::TYPE:
out->type = lex_switchblock_type(attr.value(), true);
break;
default: break; /* Not possible. */
}
}
std::bitset<2> test_state = astate | std::bitset<2>(0b00);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_switchblock);
}
void load_models(const pugi::xml_node &root, t_models *out){
out->model_list = &model_type_arena[g_num_model_type];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_models in = glex_t_models(node.name());
switch(in){
case gtok_t_models::MODEL:
load_model_type(node, &model_type_arena[g_num_model_type]);
g_num_model_type++;
out->num_model++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <models>.");
}
void load_layout_info(const pugi::xml_node &root, t_layout_info *out){
out->fill_list = &fill_arena[g_num_fill];
out->perimeter_list = &perimeter_arena[g_num_perimeter];
out->corners_list = &corners_arena[g_num_corners];
out->single_list = &single_arena[g_num_single];
out->col_list = &col_arena[g_num_col];
out->row_list = &row_arena[g_num_row];
out->region_list = &region_arena[g_num_region];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_layout_info in = glex_t_layout_info(node.name());
switch(in){
case gtok_t_layout_info::FILL:
load_fill(node, &fill_arena[g_num_fill]);
g_num_fill++;
out->num_fill++;
break;
case gtok_t_layout_info::PERIMETER:
load_perimeter(node, &perimeter_arena[g_num_perimeter]);
g_num_perimeter++;
out->num_perimeter++;
break;
case gtok_t_layout_info::CORNERS:
load_corners(node, &corners_arena[g_num_corners]);
g_num_corners++;
out->num_corners++;
break;
case gtok_t_layout_info::SINGLE:
load_single(node, &single_arena[g_num_single]);
g_num_single++;
out->num_single++;
break;
case gtok_t_layout_info::COL:
load_col(node, &col_arena[g_num_col]);
g_num_col++;
out->num_col++;
break;
case gtok_t_layout_info::ROW:
load_row(node, &row_arena[g_num_row]);
g_num_row++;
out->num_row++;
break;
case gtok_t_layout_info::REGION:
load_region(node, &region_arena[g_num_region]);
g_num_region++;
out->num_region++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <layout_info>.");
}
void load_auto_layout(const pugi::xml_node &root, t_auto_layout *out){
out->fill_list = &fill_arena[g_num_fill];
out->perimeter_list = &perimeter_arena[g_num_perimeter];
out->corners_list = &corners_arena[g_num_corners];
out->single_list = &single_arena[g_num_single];
out->col_list = &col_arena[g_num_col];
out->row_list = &row_arena[g_num_row];
out->region_list = &region_arena[g_num_region];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_auto_layout in = glex_t_auto_layout(node.name());
switch(in){
case gtok_t_auto_layout::FILL:
load_fill(node, &fill_arena[g_num_fill]);
g_num_fill++;
out->num_fill++;
break;
case gtok_t_auto_layout::PERIMETER:
load_perimeter(node, &perimeter_arena[g_num_perimeter]);
g_num_perimeter++;
out->num_perimeter++;
break;
case gtok_t_auto_layout::CORNERS:
load_corners(node, &corners_arena[g_num_corners]);
g_num_corners++;
out->num_corners++;
break;
case gtok_t_auto_layout::SINGLE:
load_single(node, &single_arena[g_num_single]);
g_num_single++;
out->num_single++;
break;
case gtok_t_auto_layout::COL:
load_col(node, &col_arena[g_num_col]);
g_num_col++;
out->num_col++;
break;
case gtok_t_auto_layout::ROW:
load_row(node, &row_arena[g_num_row]);
g_num_row++;
out->num_row++;
break;
case gtok_t_auto_layout::REGION:
load_region(node, &region_arena[g_num_region]);
g_num_region++;
out->num_region++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_auto_layout in = alex_t_auto_layout(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <auto_layout>.");
switch(in){
case atok_t_auto_layout::ASPECT_RATIO:
out->aspect_ratio = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->aspect_ratio.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b1);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_auto_layout);
}
void load_fixed_layout(const pugi::xml_node &root, t_fixed_layout *out){
out->fill_list = &fill_arena[g_num_fill];
out->perimeter_list = &perimeter_arena[g_num_perimeter];
out->corners_list = &corners_arena[g_num_corners];
out->single_list = &single_arena[g_num_single];
out->col_list = &col_arena[g_num_col];
out->row_list = &row_arena[g_num_row];
out->region_list = &region_arena[g_num_region];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_fixed_layout in = glex_t_fixed_layout(node.name());
switch(in){
case gtok_t_fixed_layout::FILL:
load_fill(node, &fill_arena[g_num_fill]);
g_num_fill++;
out->num_fill++;
break;
case gtok_t_fixed_layout::PERIMETER:
load_perimeter(node, &perimeter_arena[g_num_perimeter]);
g_num_perimeter++;
out->num_perimeter++;
break;
case gtok_t_fixed_layout::CORNERS:
load_corners(node, &corners_arena[g_num_corners]);
g_num_corners++;
out->num_corners++;
break;
case gtok_t_fixed_layout::SINGLE:
load_single(node, &single_arena[g_num_single]);
g_num_single++;
out->num_single++;
break;
case gtok_t_fixed_layout::COL:
load_col(node, &col_arena[g_num_col]);
g_num_col++;
out->num_col++;
break;
case gtok_t_fixed_layout::ROW:
load_row(node, &row_arena[g_num_row]);
g_num_row++;
out->num_row++;
break;
case gtok_t_fixed_layout::REGION:
load_region(node, &region_arena[g_num_region]);
g_num_region++;
out->num_region++;
break;
default: break; /* Not possible. */
}
}
std::bitset<3> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_fixed_layout in = alex_t_fixed_layout(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <fixed_layout>.");
switch(in){
case atok_t_fixed_layout::HEIGHT:
out->height = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->height.");
break;
case atok_t_fixed_layout::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_fixed_layout::WIDTH:
out->width = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->width.");
break;
default: break; /* Not possible. */
}
}
std::bitset<3> test_state = astate | std::bitset<3>(0b000);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_fixed_layout);
}
void load_interconnect(const pugi::xml_node &root, t_interconnect *out){
out->complete_list = &interconnect_type_arena[g_num_interconnect_type];
out->direct_list = &interconnect_type_arena[g_num_interconnect_type];
out->mux_list = &interconnect_type_arena[g_num_interconnect_type];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_interconnect in = glex_t_interconnect(node.name());
switch(in){
case gtok_t_interconnect::COMPLETE:
load_interconnect_type(node, &interconnect_type_arena[g_num_interconnect_type]);
g_num_interconnect_type++;
out->num_complete++;
break;
case gtok_t_interconnect::DIRECT:
load_interconnect_type(node, &interconnect_type_arena[g_num_interconnect_type]);
g_num_interconnect_type++;
out->num_direct++;
break;
case gtok_t_interconnect::MUX:
load_interconnect_type(node, &interconnect_type_arena[g_num_interconnect_type]);
g_num_interconnect_type++;
out->num_mux++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <interconnect>.");
}
void load_tile(const pugi::xml_node &root, t_tile *out){
out->equivalent_tiles_list = &equivalent_tiles_arena[g_num_equivalent_tiles];
out->pinlocations_list = &pinlocations_arena[g_num_pinlocations];
out->fc_list = &fc_arena[g_num_fc];
out->switchblock_locations_list = &switchblock_locations_arena[g_num_switchblock_locations];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_tile in = glex_t_tile(node.name());
switch(in){
case gtok_t_tile::EQUIVALENT_TILES:
load_equivalent_tiles(node, &equivalent_tiles_arena[g_num_equivalent_tiles]);
g_num_equivalent_tiles++;
out->num_equivalent_tiles++;
break;
case gtok_t_tile::PINLOCATIONS:
load_pinlocations(node, &pinlocations_arena[g_num_pinlocations]);
g_num_pinlocations++;
out->num_pinlocations++;
break;
case gtok_t_tile::FC:
load_fc(node, &fc_arena[g_num_fc]);
g_num_fc++;
out->num_fc++;
break;
case gtok_t_tile::SWITCHBLOCK_LOCATIONS:
load_switchblock_locations(node, &switchblock_locations_arena[g_num_switchblock_locations]);
g_num_switchblock_locations++;
out->num_switchblock_locations++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_tile in = alex_t_tile(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <tile>.");
switch(in){
case atok_t_tile::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_tile);
}
void load_switchblocklist(const pugi::xml_node &root, t_switchblocklist *out){
out->switchblock_list = &switchblock_arena[g_num_switchblock];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_switchblocklist in = glex_t_switchblocklist(node.name());
switch(in){
case gtok_t_switchblocklist::SWITCHBLOCK:
load_switchblock(node, &switchblock_arena[g_num_switchblock]);
g_num_switchblock++;
out->num_switchblock++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <switchblocklist>.");
}
void load_layout(const pugi::xml_node &root, t_layout *out){
out->fixed_layout_list = &fixed_layout_arena[g_num_fixed_layout];
out->device_layout_list = &fixed_layout_arena[g_num_fixed_layout];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_layout in = glex_t_layout(node.name());
switch(in){
case gtok_t_layout::AUTO_LAYOUT:
load_auto_layout(node, &out->auto_layout);
break;
case gtok_t_layout::FIXED_LAYOUT:
load_fixed_layout(node, &fixed_layout_arena[g_num_fixed_layout]);
g_num_fixed_layout++;
out->num_fixed_layout++;
break;
case gtok_t_layout::DEVICE_LAYOUT:
load_fixed_layout(node, &fixed_layout_arena[g_num_fixed_layout]);
g_num_fixed_layout++;
out->num_device_layout++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <layout>.");
}
void load_mode(const pugi::xml_node &root, t_mode *out){
out->pb_type_list = &pb_type_arena[g_num_pb_type];
out->interconnect_list = &interconnect_arena[g_num_interconnect];
out->pinlocations_list = &pinlocations_arena[g_num_pinlocations];
out->switchblock_locations_list = &switchblock_locations_arena[g_num_switchblock_locations];
out->metadata_list = &metadata_arena[g_num_metadata];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_mode in = glex_t_mode(node.name());
switch(in){
case gtok_t_mode::PB_TYPE:
load_pb_type(node, &pb_type_arena[g_num_pb_type]);
g_num_pb_type++;
out->num_pb_type++;
break;
case gtok_t_mode::INTERCONNECT:
load_interconnect(node, &interconnect_arena[g_num_interconnect]);
g_num_interconnect++;
out->num_interconnect++;
break;
case gtok_t_mode::PINLOCATIONS:
load_pinlocations(node, &pinlocations_arena[g_num_pinlocations]);
g_num_pinlocations++;
out->num_pinlocations++;
break;
case gtok_t_mode::SWITCHBLOCK_LOCATIONS:
load_switchblock_locations(node, &switchblock_locations_arena[g_num_switchblock_locations]);
g_num_switchblock_locations++;
out->num_switchblock_locations++;
break;
case gtok_t_mode::METADATA:
load_metadata(node, &metadata_arena[g_num_metadata]);
g_num_metadata++;
out->num_metadata++;
break;
default: break; /* Not possible. */
}
}
std::bitset<1> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_mode in = alex_t_mode(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <mode>.");
switch(in){
case atok_t_mode::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
default: break; /* Not possible. */
}
}
std::bitset<1> test_state = astate | std::bitset<1>(0b0);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_mode);
}
void load_tiles(const pugi::xml_node &root, t_tiles *out){
out->tile_list = &tile_arena[g_num_tile];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_tiles in = glex_t_tiles(node.name());
switch(in){
case gtok_t_tiles::TILE:
load_tile(node, &tile_arena[g_num_tile]);
g_num_tile++;
out->num_tile++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <tiles>.");
}
void load_pb_type(const pugi::xml_node &root, t_pb_type *out){
out->pb_type_list = &pb_type_arena[g_num_pb_type];
out->input_list = &pb_type_input_arena[g_num_pb_type_input];
out->output_list = &pb_type_output_arena[g_num_pb_type_output];
out->clock_list = &pb_type_clock_arena[g_num_pb_type_clock];
out->metadata_list = &metadata_arena[g_num_metadata];
out->mode_list = &mode_arena[g_num_mode];
out->interconnect_list = &interconnect_arena[g_num_interconnect];
out->pinlocations_list = &pinlocations_arena[g_num_pinlocations];
out->switchblock_locations_list = &switchblock_locations_arena[g_num_switchblock_locations];
out->fc_list = &fc_arena[g_num_fc];
out->delay_constant_list = &T_timing_minmax_arena[g_num_T_timing_minmax];
out->delay_matrix_list = &delay_matrix_arena[g_num_delay_matrix];
out->T_setup_list = &T_timing_arena[g_num_T_timing];
out->T_hold_list = &T_timing_arena[g_num_T_timing];
out->T_clock_to_Q_list = &T_clock_timing_arena[g_num_T_clock_timing];
out->power_list = &power_arena[g_num_power];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_pb_type in = glex_t_pb_type(node.name());
switch(in){
case gtok_t_pb_type::PB_TYPE:
load_pb_type(node, &pb_type_arena[g_num_pb_type]);
g_num_pb_type++;
out->num_pb_type++;
break;
case gtok_t_pb_type::INPUT:
load_pb_type_input(node, &pb_type_input_arena[g_num_pb_type_input]);
g_num_pb_type_input++;
out->num_input++;
break;
case gtok_t_pb_type::OUTPUT:
load_pb_type_output(node, &pb_type_output_arena[g_num_pb_type_output]);
g_num_pb_type_output++;
out->num_output++;
break;
case gtok_t_pb_type::CLOCK:
load_pb_type_clock(node, &pb_type_clock_arena[g_num_pb_type_clock]);
g_num_pb_type_clock++;
out->num_clock++;
break;
case gtok_t_pb_type::METADATA:
load_metadata(node, &metadata_arena[g_num_metadata]);
g_num_metadata++;
out->num_metadata++;
break;
case gtok_t_pb_type::MODE:
load_mode(node, &mode_arena[g_num_mode]);
g_num_mode++;
out->num_mode++;
break;
case gtok_t_pb_type::INTERCONNECT:
load_interconnect(node, &interconnect_arena[g_num_interconnect]);
g_num_interconnect++;
out->num_interconnect++;
break;
case gtok_t_pb_type::PINLOCATIONS:
load_pinlocations(node, &pinlocations_arena[g_num_pinlocations]);
g_num_pinlocations++;
out->num_pinlocations++;
break;
case gtok_t_pb_type::SWITCHBLOCK_LOCATIONS:
load_switchblock_locations(node, &switchblock_locations_arena[g_num_switchblock_locations]);
g_num_switchblock_locations++;
out->num_switchblock_locations++;
break;
case gtok_t_pb_type::FC:
load_fc(node, &fc_arena[g_num_fc]);
g_num_fc++;
out->num_fc++;
break;
case gtok_t_pb_type::DELAY_CONSTANT:
load_T_timing_minmax(node, &T_timing_minmax_arena[g_num_T_timing_minmax]);
g_num_T_timing_minmax++;
out->num_delay_constant++;
break;
case gtok_t_pb_type::DELAY_MATRIX:
load_delay_matrix(node, &delay_matrix_arena[g_num_delay_matrix]);
g_num_delay_matrix++;
out->num_delay_matrix++;
break;
case gtok_t_pb_type::T_SETUP:
load_T_timing(node, &T_timing_arena[g_num_T_timing]);
g_num_T_timing++;
out->num_T_setup++;
break;
case gtok_t_pb_type::T_HOLD:
load_T_timing(node, &T_timing_arena[g_num_T_timing]);
g_num_T_timing++;
out->num_T_hold++;
break;
case gtok_t_pb_type::T_CLOCK_TO_Q:
load_T_clock_timing(node, &T_clock_timing_arena[g_num_T_clock_timing]);
g_num_T_clock_timing++;
out->num_T_clock_to_Q++;
break;
case gtok_t_pb_type::POWER:
load_power(node, &power_arena[g_num_power]);
g_num_power++;
out->num_power++;
break;
default: break; /* Not possible. */
}
}
std::bitset<8> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_pb_type in = alex_t_pb_type(attr.name());
if(astate[(int)in] == 0) astate[(int)in] = 1;
else throw std::runtime_error("Duplicate attribute " + std::string(attr.name()) + " in <pb_type>.");
switch(in){
case atok_t_pb_type::AREA:
out->area = std::strtod(attr.value(), NULL);
if(errno != 0)
throw std::runtime_error("Invalid value to load a double into out->area.");
break;
case atok_t_pb_type::BLIF_MODEL:
out->blif_model = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->blif_model.");
break;
case atok_t_pb_type::CAPACITY:
out->capacity = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->capacity.");
break;
case atok_t_pb_type::CLASS:
out->class_ = lex_pb_type_class(attr.value(), true);
break;
case atok_t_pb_type::HEIGHT:
out->height = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->height.");
break;
case atok_t_pb_type::NAME:
out->name = strdup(attr.value());
if(errno != 0)
throw std::runtime_error("Invalid value to load a const char * into out->name.");
break;
case atok_t_pb_type::NUM_PB:
out->num_pb = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->num_pb.");
break;
case atok_t_pb_type::WIDTH:
out->width = std::strtol(attr.value(), NULL, 10);
if(errno != 0)
throw std::runtime_error("Invalid value to load a int into out->width.");
break;
default: break; /* Not possible. */
}
}
std::bitset<8> test_state = astate | std::bitset<8>(0b11011111);
if(!test_state.all()) attr_error(test_state, atok_lookup_t_pb_type);
}
void load_complexblocklist(const pugi::xml_node &root, t_complexblocklist *out){
out->pb_type_list = &pb_type_arena[g_num_pb_type];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_complexblocklist in = glex_t_complexblocklist(node.name());
switch(in){
case gtok_t_complexblocklist::PB_TYPE:
load_pb_type(node, &pb_type_arena[g_num_pb_type]);
g_num_pb_type++;
out->num_pb_type++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <complexblocklist>.");
}
void load_architecture(const pugi::xml_node &root, t_architecture *out){
out->models_list = &models_arena[g_num_models];
out->layout_list = &layout_arena[g_num_layout];
out->device_list = &device_arena[g_num_device];
out->switchlist_list = &switchlist_arena[g_num_switchlist];
out->switchblocklist_list = &switchblocklist_arena[g_num_switchblocklist];
out->segmentlist_list = &segmentlist_arena[g_num_segmentlist];
out->power_list = &global_power_arena[g_num_global_power];
out->clocks_list = &clocks_arena[g_num_clocks];
out->directlist_list = &directlist_arena[g_num_directlist];
out->tiles_list = &tiles_arena[g_num_tiles];
out->complexblocklist_list = &complexblocklist_arena[g_num_complexblocklist];
for(pugi::xml_node node = root.first_child(); node; node = node.next_sibling()){
gtok_t_architecture in = glex_t_architecture(node.name());
switch(in){
case gtok_t_architecture::MODELS:
load_models(node, &models_arena[g_num_models]);
g_num_models++;
out->num_models++;
break;
case gtok_t_architecture::LAYOUT:
load_layout(node, &layout_arena[g_num_layout]);
g_num_layout++;
out->num_layout++;
break;
case gtok_t_architecture::DEVICE:
load_device(node, &device_arena[g_num_device]);
g_num_device++;
out->num_device++;
break;
case gtok_t_architecture::SWITCHLIST:
load_switchlist(node, &switchlist_arena[g_num_switchlist]);
g_num_switchlist++;
out->num_switchlist++;
break;
case gtok_t_architecture::SWITCHBLOCKLIST:
load_switchblocklist(node, &switchblocklist_arena[g_num_switchblocklist]);
g_num_switchblocklist++;
out->num_switchblocklist++;
break;
case gtok_t_architecture::SEGMENTLIST:
load_segmentlist(node, &segmentlist_arena[g_num_segmentlist]);
g_num_segmentlist++;
out->num_segmentlist++;
break;
case gtok_t_architecture::POWER:
load_global_power(node, &global_power_arena[g_num_global_power]);
g_num_global_power++;
out->num_power++;
break;
case gtok_t_architecture::CLOCKS:
load_clocks(node, &clocks_arena[g_num_clocks]);
g_num_clocks++;
out->num_clocks++;
break;
case gtok_t_architecture::DIRECTLIST:
load_directlist(node, &directlist_arena[g_num_directlist]);
g_num_directlist++;
out->num_directlist++;
break;
case gtok_t_architecture::TILES:
load_tiles(node, &tiles_arena[g_num_tiles]);
g_num_tiles++;
out->num_tiles++;
break;
case gtok_t_architecture::COMPLEXBLOCKLIST:
load_complexblocklist(node, &complexblocklist_arena[g_num_complexblocklist]);
g_num_complexblocklist++;
out->num_complexblocklist++;
break;
default: break; /* Not possible. */
}
}
if(root.first_attribute()) throw std::runtime_error("Unexpected attribute in <architecture>.");
}
/**
* Root elements.
**/
t_architecture architecture = {};
void get_root_elements(const char *filename){
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file(filename);
if(!result)
throw std::runtime_error("Could not load XML file " + std::string(filename) + ".");
for(pugi::xml_node node= doc.first_child(); node; node = node.next_sibling()){
if(std::strcmp(node.name(), "architecture") == 0){
count_architecture(node);
alloc_arenas();
load_architecture(node, &architecture);
}
else throw std::runtime_error("Invalid root-level element " + std::string(node.name()));
}
}
} /* namespace arch */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment