Skip to content

Commit 063ae77

Browse files
authored
Merge pull request steveicarus#132 from Fatsie/master
[vhdlpp]Added to_bit and to_bitvector standard functions
2 parents b4e8a12 + 447f941 commit 063ae77

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

vhdlpp/std_funcs.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,25 @@ void preload_std_funcs(void)
290290
perm_string::literal("$signed"),
291291
args, &primitive_INTEGER));
292292

293+
/* std_logic_1164 library
294+
* function to_bit (signal s : std_ulogic) return bit;
295+
*/
296+
args = new list<InterfacePort*>();
297+
args->push_back(new InterfacePort(&primitive_STDLOGIC));
298+
register_std_subprogram(new SubprogramBuiltin(perm_string::literal("to_bit"),
299+
empty_perm_string,
300+
args, &primitive_BIT));
301+
302+
/* std_logic_1164 library
303+
* function to_bitvector (signal s : std_logic_vector) return bit_vector;
304+
* function to_bitvector (signal s : std_ulogic_vector) return bit_vector;
305+
*/
306+
args = new list<InterfacePort*>();
307+
args->push_back(new InterfacePort(&primitive_STDLOGIC_VECTOR));
308+
register_std_subprogram(new SubprogramBuiltin(perm_string::literal("to_bitvector"),
309+
empty_perm_string,
310+
args, &primitive_BIT_VECTOR));
311+
293312
/* std_logic_1164 library
294313
* function rising_edge (signal s : std_ulogic) return boolean;
295314
*/

0 commit comments

Comments
 (0)