5 * Abstract machine interface.
6 * @author Christian Wuerdig
11 typedef struct _be_execution_unit_type_t be_execution_unit_type_t;
12 typedef struct _be_execution_unit_t be_execution_unit_t;
13 typedef struct _be_machine_t be_machine_t;
15 struct _be_execution_unit_t {
16 be_execution_unit_type_t *tp;
20 struct _be_execution_unit_type_t {
22 unsigned ports_per_unit;
24 be_execution_unit_t *units;
27 struct _be_machine_t {
29 unsigned bundels_per_cycle;
30 unsigned n_unit_types;
31 be_execution_unit_type_t *unit_types;
35 * Get the number of available unit types in the given machine.
37 #define be_machine_get_n_unit_types(machine) ((machine)->n_unit_types)
40 * Get the unit type number @p i from the given machine.
42 #define be_machine_get_unit_type(machine, i) ((machine)->unit_types[(i)])
45 * Get the name of the given unit type.
47 #define be_machine_get_unit_type_name(tp) ((tp)->name)
50 * Get the number of available execution units from the given unit type.
52 #define be_machine_get_n_execunits(tp) ((tp)->n_units)
55 * Get the execution unit number @p i from the given unit type.
57 #define be_machine_get_execunit(tp, i) ((tp)->units[(i)])
60 * Get the name of the given execution unit.
62 #define be_machine_get_execunit_name(unit) ((unit)->name)
65 * Get the unit type of the given execution unit.
67 #define be_machine_get_execunit_type(unit) ((unit)->tp)
69 #endif /* _BE_MACHINE_H_ */