From 88c956dc0ee2e4e22c04d7a841d070cca7cca2a0 Mon Sep 17 00:00:00 2001 From: Prashanth Mundkur Date: Thu, 7 Feb 2019 14:30:41 -0800 Subject: Add parameterization support for bitfields. This supports the following syntax: type xlen : Int = 64 type ylen : Int = 1 type xlenbits = bits(xlen) bitfield Mstatus : xlenbits = { SD : xlen - ylen, SXL : xlen - ylen - 1 .. xlen - ylen - 3 } --- language/sail.ott | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'language') diff --git a/language/sail.ott b/language/sail.ott index 6d2760ff..7dbd3c9e 100644 --- a/language/sail.ott +++ b/language/sail.ott @@ -316,8 +316,8 @@ type_union :: 'Tu_' ::= index_range :: 'BF_' ::= {{ com index specification, for bitfields in register types}} {{ aux _ l }} - | num :: :: 'single' {{ com single index }} - | num1 '..' num2 :: :: range {{ com index range }} + | nexp :: :: 'single' {{ com single index }} + | nexp1 '..' nexp2 :: :: range {{ com index range }} | index_range1 , index_range2 :: :: concat {{ com concatenation of index ranges }} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- cgit v1.2.3