Last active
June 14, 2019 03:16
-
-
Save duck2/02309a359ae5556690dc7b45f1fda7bf to your computer and use it in GitHub Desktop.
xsd-generated structs for arch.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <memory> | |
| #include <string> | |
| #include <vector> | |
| namespace fpga_architecture { | |
| struct t_meta; | |
| struct t_port; | |
| struct t_model_type; | |
| struct t_fill; | |
| struct t_perimeter; | |
| struct t_corners; | |
| struct t_single; | |
| struct t_col; | |
| struct t_row; | |
| struct t_region; | |
| struct t_layout_info; | |
| struct t_auto_layout; | |
| struct t_fixed_layout; | |
| struct t_layout; | |
| struct t_chan_dist; | |
| struct t_chan_width_distr; | |
| struct t_device; | |
| struct t_switch; | |
| struct t_pb_type_input; | |
| struct t_pb_type_output; | |
| 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_interconnect_type; | |
| struct t_pack_pattern; | |
| struct t_interconnect; | |
| struct t_power_dynamic_power; | |
| struct t_power_port; | |
| struct t_power_local_interconnect; | |
| struct t_power; | |
| struct t_global_power; | |
| struct t_loc; | |
| struct t_pinlocations; | |
| struct t_sb_loc; | |
| struct t_switchblock_locations; | |
| struct t_fc; | |
| struct t_mode; | |
| struct t_map; | |
| struct t_tile_mode; | |
| struct t_tile; | |
| struct t_pb_type; | |
| struct t_segment_block; | |
| struct t_segment; | |
| struct t_direct; | |
| struct t_wireconn_connection; | |
| struct t_wireconn; | |
| struct t_switchblock; | |
| struct t_clock; | |
| struct t_architecture; | |
| struct t_Tdel; | |
| struct t_fc_override; | |
| struct t_switch_block; | |
| struct t_sizing; | |
| struct t_default_fc; | |
| struct t_func; | |
| enum class power_estimation_method {SPECIFY_SIZE, AUTO_SIZE, PIN_TOGGLE, C_INTERNAL, ABSOLUTE, IGNORE, SUM_OF_CHILDREN}; | |
| enum class pb_input_equivalent {NONE, FULL, INSTANCE}; | |
| enum class pinlocations_pattern {SPREAD, SPREAD_INPUTS_PERIMETER_OUTPUTS, PERIMETER, CUSTOM}; | |
| enum class switchblock_location_type {EVERYWHERE, PERIMETER, CORNER, FRINGE, CORE}; | |
| enum class delay_matrix_type {MIN, MAX}; | |
| enum class sb_loc_type {FULL, STRAIGHT, TURNS, NONE}; | |
| enum class loc_side {LEFT, RIGHT, BOTTOM, TOP}; | |
| enum class func_type {LT, LR, LB, TR, TB, TL, RB, RL, RT, BL, BT, BR}; | |
| enum class pb_clock_equivalent {NONE, FULL, INSTANCE}; | |
| enum class pb_type_class {LUT, FLIPFLOP, MEMORY}; | |
| enum class switchblock_locations_pattern {EXTERNAL_FULL_INTERNAL_STRAIGHT, ALL, EXTERNAL, INTERNAL, NONE, CUSTOM}; | |
| enum class switchblock_type {BIDIR, UNIDIR}; | |
| enum class switch_type {MUX, TRISTATE, PASS_GATE, SHORT, BUFFER}; | |
| enum class switch_block_type {WILTON, SUBSET, UNIVERSAL, CUSTOM}; | |
| enum class segment_type {BIDIR, UNIDIR}; | |
| enum class pb_output_equivalent {NONE, FULL}; | |
| enum class fc_type_enum {FRAC, ABS}; | |
| enum class chan_distribution {GAUSSIAN, UNIFORM, PULSE, DELTA}; | |
| typedef std::vector<t_meta> t_metadata; | |
| typedef std::vector<t_port> t_port_list; | |
| typedef std::vector<t_model_type> t_models; | |
| typedef std::vector<t_switch> t_switchlist; | |
| typedef double t_power_static_power; | |
| typedef double t_power_buffers; | |
| typedef double t_power_ff_size; | |
| typedef double t_power_LUT_transistor_size; | |
| typedef double t_power_mux_transistor_size; | |
| typedef std::vector<t_tile_mode> t_equivalent_tiles; | |
| typedef std::vector<t_tile> t_tiles; | |
| typedef std::vector<t_pb_type> t_complexblocklist; | |
| typedef std::string t_segment_mux; | |
| typedef std::string t_segment_wire_switch; | |
| typedef std::vector<t_segment> t_segmentlist; | |
| typedef std::vector<t_direct> t_directlist; | |
| typedef switchblock_location_type t_switchblock_location; | |
| typedef std::vector<t_func> t_switchblock_func; | |
| typedef std::vector<t_switchblock> t_switchblocklist; | |
| typedef std::vector<t_clock> t_clocks; | |
| typedef double t_area; | |
| typedef std::string t_connection_block; | |
| struct t_meta { | |
| std::string name; | |
| int xoffset; | |
| int x_offset; | |
| int yoffset; | |
| int y_offset; | |
| std::string value; | |
| }; | |
| struct t_port { | |
| std::string name; | |
| bool is_clock; | |
| std::string clock; | |
| std::vector<std::string> combinational_sink_ports; | |
| }; | |
| struct t_model_type { | |
| std::string name; | |
| std::vector<t_port_list> input_ports_list; | |
| std::vector<t_port_list> output_ports_list; | |
| }; | |
| struct t_fill { | |
| std::string type; | |
| int priority; | |
| }; | |
| struct t_perimeter { | |
| std::string type; | |
| int priority; | |
| }; | |
| struct t_corners { | |
| std::string type; | |
| int priority; | |
| }; | |
| struct t_single { | |
| std::string type; | |
| int priority; | |
| std::string x; | |
| std::string y; | |
| std::vector<t_metadata> metadata_list; | |
| }; | |
| struct t_col { | |
| std::string type; | |
| int priority; | |
| std::string startx; | |
| std::string repeatx; | |
| std::string starty; | |
| std::string incry; | |
| }; | |
| struct t_row { | |
| std::string type; | |
| int priority; | |
| std::string starty; | |
| std::string repeaty; | |
| std::string startx; | |
| std::string incrx; | |
| }; | |
| struct t_region { | |
| std::string type; | |
| int priority; | |
| std::string startx; | |
| std::string endx; | |
| std::string incrx; | |
| std::string repeatx; | |
| std::string starty; | |
| std::string endy; | |
| std::string incry; | |
| std::string repeaty; | |
| }; | |
| struct t_layout_info { | |
| std::vector<t_fill> fill_list; | |
| std::vector<t_perimeter> perimeter_list; | |
| std::vector<t_corners> corners_list; | |
| std::vector<t_single> single_list; | |
| std::vector<t_col> col_list; | |
| std::vector<t_row> row_list; | |
| std::vector<t_region> region_list; | |
| }; | |
| struct t_auto_layout { | |
| double aspect_ratio; | |
| std::vector<t_fill> fill_list; | |
| std::vector<t_perimeter> perimeter_list; | |
| std::vector<t_corners> corners_list; | |
| std::vector<t_single> single_list; | |
| std::vector<t_col> col_list; | |
| std::vector<t_row> row_list; | |
| std::vector<t_region> region_list; | |
| }; | |
| struct t_fixed_layout { | |
| std::string name; | |
| int width; | |
| int height; | |
| std::vector<t_fill> fill_list; | |
| std::vector<t_perimeter> perimeter_list; | |
| std::vector<t_corners> corners_list; | |
| std::vector<t_single> single_list; | |
| std::vector<t_col> col_list; | |
| std::vector<t_row> row_list; | |
| std::vector<t_region> region_list; | |
| }; | |
| struct t_layout { | |
| std::unique_ptr<t_auto_layout> auto_layout; | |
| std::vector<t_fixed_layout> fixed_layout_list; | |
| std::vector<t_fixed_layout> device_layout_list; | |
| }; | |
| struct t_chan_dist { | |
| chan_distribution distr; | |
| double peak; | |
| double width; | |
| double xpeak; | |
| double dc; | |
| }; | |
| struct t_chan_width_distr { | |
| std::vector<t_chan_dist> x_list; | |
| std::vector<t_chan_dist> y_list; | |
| }; | |
| struct t_device { | |
| std::unique_ptr<t_sizing> sizing; | |
| std::unique_ptr<t_connection_block> connection_block; | |
| std::unique_ptr<t_area> area; | |
| std::unique_ptr<t_switch_block> switch_block; | |
| std::unique_ptr<t_chan_width_distr> chan_width_distr; | |
| std::unique_ptr<t_default_fc> default_fc; | |
| }; | |
| struct t_switch { | |
| switch_type type; | |
| std::string name; | |
| double R; | |
| double Cin; | |
| double Cinternal; | |
| double Cout; | |
| double Tdel; | |
| bool is_auto; | |
| double buf_size; | |
| double mux_trans_size; | |
| double power_buf_size; | |
| std::vector<t_Tdel> Tdel_list; | |
| }; | |
| struct t_pb_type_input { | |
| std::string name; | |
| pb_input_equivalent equivalent; | |
| int num_pins; | |
| bool is_non_clock_global; | |
| std::string port_class; | |
| }; | |
| struct t_pb_type_output { | |
| std::string name; | |
| pb_output_equivalent equivalent; | |
| int num_pins; | |
| std::string port_class; | |
| }; | |
| struct t_pb_type_clock { | |
| std::string name; | |
| pb_clock_equivalent equivalent; | |
| int num_pins; | |
| std::string port_class; | |
| }; | |
| struct t_delay_matrix { | |
| delay_matrix_type type; | |
| std::string in_port; | |
| std::string out_port; | |
| std::vector<double> value; | |
| }; | |
| struct t_T_timing_minmax { | |
| double max; | |
| double min; | |
| std::string in_port; | |
| std::string out_port; | |
| }; | |
| struct t_T_timing { | |
| double value; | |
| std::string port; | |
| std::string clock; | |
| }; | |
| struct t_T_clock_timing { | |
| double max; | |
| double min; | |
| std::string port; | |
| std::string clock; | |
| }; | |
| struct t_interconnect_type { | |
| std::string name; | |
| std::vector<std::string> input; | |
| std::vector<std::string> output; | |
| std::vector<t_pack_pattern> pack_pattern_list; | |
| std::vector<t_T_timing_minmax> delay_constant_list; | |
| std::vector<t_delay_matrix> delay_matrix_list; | |
| std::vector<t_metadata> metadata_list; | |
| }; | |
| struct t_pack_pattern { | |
| std::string name; | |
| std::vector<std::string> in_port; | |
| std::vector<std::string> out_port; | |
| }; | |
| struct t_interconnect { | |
| std::vector<t_interconnect_type> complete_list; | |
| std::vector<t_interconnect_type> direct_list; | |
| std::vector<t_interconnect_type> mux_list; | |
| }; | |
| struct t_power_dynamic_power { | |
| double power_per_instance; | |
| double C_internal; | |
| }; | |
| struct t_power_port { | |
| std::string name; | |
| double energy_per_toggle; | |
| std::string scaled_by_static_prob; | |
| std::string scaled_by_static_prob_n; | |
| }; | |
| struct t_power_local_interconnect { | |
| double C_wire; | |
| double factor; | |
| }; | |
| struct t_power { | |
| power_estimation_method method; | |
| std::vector<t_power_dynamic_power> dynamic_power_list; | |
| std::vector<t_power_static_power> static_power_list; | |
| std::vector<t_power_port> port_list; | |
| }; | |
| struct t_global_power { | |
| power_estimation_method method; | |
| std::vector<t_power_local_interconnect> local_interconnect_list; | |
| std::vector<t_power_buffers> buffers_list; | |
| std::vector<t_power_mux_transistor_size> mux_transistor_size_list; | |
| std::vector<t_power_ff_size> FF_size_list; | |
| std::vector<t_power_LUT_transistor_size> LUT_transistor_size_list; | |
| }; | |
| struct t_loc { | |
| loc_side side; | |
| int xoffset; | |
| int yoffset; | |
| std::vector<std::string> value; | |
| }; | |
| struct t_pinlocations { | |
| pinlocations_pattern pattern; | |
| std::vector<t_loc> loc_list; | |
| }; | |
| struct t_sb_loc { | |
| sb_loc_type type; | |
| int xoffset; | |
| int yoffset; | |
| std::string switch_override; | |
| }; | |
| struct t_switchblock_locations { | |
| switchblock_locations_pattern pattern; | |
| std::string internal_switch; | |
| std::vector<t_sb_loc> sb_loc_list; | |
| }; | |
| struct t_fc { | |
| fc_type_enum in_type; | |
| double in_val; | |
| fc_type_enum out_type; | |
| double out_val; | |
| std::vector<t_fc_override> fc_override_list; | |
| }; | |
| struct t_mode { | |
| std::string name; | |
| std::vector<t_pb_type> pb_type_list; | |
| std::vector<t_interconnect> interconnect_list; | |
| std::vector<t_pinlocations> pinlocations_list; | |
| std::vector<t_switchblock_locations> switchblock_locations_list; | |
| std::vector<t_metadata> metadata_list; | |
| }; | |
| struct t_map { | |
| std::string from; | |
| std::string to; | |
| std::string num_pins; | |
| }; | |
| struct t_tile_mode { | |
| std::string name; | |
| std::vector<t_map> map_list; | |
| }; | |
| struct t_tile { | |
| std::string name; | |
| std::vector<t_equivalent_tiles> equivalent_tiles_list; | |
| std::vector<t_pinlocations> pinlocations_list; | |
| std::vector<t_fc> fc_list; | |
| std::vector<t_switchblock_locations> switchblock_locations_list; | |
| }; | |
| struct t_pb_type { | |
| std::string name; | |
| int num_pb; | |
| std::string blif_model; | |
| int capacity; | |
| int width; | |
| int height; | |
| double area; | |
| pb_type_class class_; | |
| std::vector<t_pb_type> pb_type_list; | |
| std::vector<t_pb_type_input> input_list; | |
| std::vector<t_pb_type_output> output_list; | |
| std::vector<t_pb_type_clock> clock_list; | |
| std::vector<t_metadata> metadata_list; | |
| std::vector<t_mode> mode_list; | |
| std::vector<t_interconnect> interconnect_list; | |
| std::vector<t_pinlocations> pinlocations_list; | |
| std::vector<t_switchblock_locations> switchblock_locations_list; | |
| std::vector<t_fc> fc_list; | |
| std::vector<t_T_timing_minmax> delay_constant_list; | |
| std::vector<t_delay_matrix> delay_matrix_list; | |
| std::vector<t_T_timing> T_setup_list; | |
| std::vector<t_T_timing> T_hold_list; | |
| std::vector<t_T_clock_timing> T_clock_to_Q_list; | |
| std::vector<t_power> power_list; | |
| }; | |
| struct t_segment_block { | |
| std::string type; | |
| std::vector<int> value; | |
| }; | |
| struct t_segment { | |
| std::string name; | |
| bool is_longline; | |
| unsigned int length; | |
| segment_type type; | |
| double freq; | |
| double Rmetal; | |
| double Cmetal; | |
| std::vector<t_segment_block> sb_list; | |
| std::vector<t_segment_block> cb_list; | |
| std::vector<t_segment_mux> mux_list; | |
| std::vector<t_segment_wire_switch> wire_switch_list; | |
| std::vector<t_segment_wire_switch> opin_switch_list; | |
| }; | |
| struct t_direct { | |
| std::string name; | |
| std::string from_pin; | |
| std::string to_pin; | |
| int x_offset; | |
| int y_offset; | |
| int z_offset; | |
| std::string switch_name; | |
| }; | |
| struct t_wireconn_connection { | |
| std::string type; | |
| std::string switchpoint; | |
| }; | |
| struct t_wireconn { | |
| std::string num_conns_type; | |
| std::string from_type; | |
| std::string to_type; | |
| std::string from_switchpoint; | |
| std::string to_switchpoint; | |
| std::vector<t_wireconn_connection> from_list; | |
| std::vector<t_wireconn_connection> to_list; | |
| }; | |
| struct t_switchblock { | |
| std::string name; | |
| switchblock_type type; | |
| std::vector<t_switchblock_location> switchblock_location_list; | |
| std::vector<t_switchblock_func> switchfuncs_list; | |
| std::vector<t_wireconn> wireconn_list; | |
| }; | |
| struct t_clock { | |
| double C_wire; | |
| double C_wire_per_m; | |
| bool is_auto; | |
| double buffer_size; | |
| }; | |
| struct t_architecture { | |
| std::vector<t_models> models_list; | |
| std::vector<t_layout> layout_list; | |
| std::vector<t_device> device_list; | |
| std::vector<t_switchlist> switchlist_list; | |
| std::vector<t_switchblocklist> switchblocklist_list; | |
| std::vector<t_segmentlist> segmentlist_list; | |
| std::vector<t_global_power> power_list; | |
| std::vector<t_clocks> clocks_list; | |
| std::vector<t_directlist> directlist_list; | |
| std::vector<t_tiles> tiles_list; | |
| std::vector<t_complexblocklist> complexblocklist_list; | |
| }; | |
| struct t_Tdel { | |
| int num_inputs; | |
| double delay; | |
| }; | |
| struct t_fc_override { | |
| fc_type_enum fc_type; | |
| double fc_val; | |
| std::string port_name; | |
| std::string segment_name; | |
| }; | |
| struct t_switch_block { | |
| switch_block_type type; | |
| int fs; | |
| }; | |
| struct t_sizing { | |
| double R_minW_nmos; | |
| double R_minW_pmos; | |
| }; | |
| struct t_default_fc { | |
| fc_type_enum in_type; | |
| double in_val; | |
| fc_type_enum out_type; | |
| double out_val; | |
| }; | |
| struct t_func { | |
| func_type type; | |
| std::string formula; | |
| }; | |
| std::unique_ptr<t_architecture> architecture; | |
| } | |
| using namespace fpga_architecture; | |
| int main(){ | |
| architecture = std::unique_ptr<t_architecture>(new t_architecture); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment