Commit Graph

8 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
1e1baec50a Python 3 compat.
Try to keep our Python sources compatible with both Python 2.7 and 3.

Check with 'pylint --py3k' and 'python -3'.
2016-08-23 16:35:58 -07:00
Jakob Stoklund Olesen
514ebc6bf9 Generate code to precompute predicates.
Each ISA predicate is assigned a bit the the Flags struct, and a corresponding
method is generated.
2016-08-12 10:13:50 -07:00
Jakob Stoklund Olesen
aeb376227e Implement the machinery to create a TargetIsa.
Add an isa::lookup() function which serves as a target registry for creating
Box<TargetIsa> trait objects.

An isa::Builder makes it possible to confugure the trait object before it is
created.
2016-08-11 11:52:11 -07:00
Jakob Stoklund Olesen
b9baf06fb7 Add a settings::Builder data type.
- Move detail data structures into a settings::detail module to avoid polluting
  the settings namespace.

- Rename generated data types to 'Flags' in anticipation of computed predicate
  flags that can't be set. The Flags struct is immutable.

- Use a settings::Builder struct to manipulate settings, then pass it to
  Flags::new().
2016-08-10 15:47:06 -07:00
Jakob Stoklund Olesen
1ef72dd5ec Add support for enumerated settings.
The EnumSetting objects can take one of 256 named values.
2016-08-09 15:13:43 -07:00
Jakob Stoklund Olesen
07e851a222 Add settings::Stringwise.
This trait allows settings to be manipulated as strings, using descriptors and
constant hash-table lookups.

Amend gen_settings.py to generate the necessary constant tables.
2016-08-09 15:04:42 -07:00
Jakob Stoklund Olesen
36ad7da3ec Add ISA-dependent settings for RISC-V. 2016-08-05 16:19:46 -07:00
Jakob Stoklund Olesen
cfeefde3fc Scaffolding for defining settings.
Settings can be defined globally or per-ISA. They are available to code through
a generated Settings struct with accessor methods per setting.
2016-08-05 15:50:57 -07:00