Skip to content
Snippets Groups Projects
Commit 71c4d362 authored by Unai Sainz-Estebanez's avatar Unai Sainz-Estebanez
Browse files

Rewrite the word default to default_val

This is because since the VHDL 2008 standard the word “default” is a reserved word.

See wr-cores#101 for more info
parent abf42cf9
Branches
Tags
No related merge requests found
......@@ -37,7 +37,7 @@ PACKAGE mem_model is
width : POSITIVE; -- # word length
length : POSITIVE; -- # of memory locations
row_data_ptr : row_data_ptr_type; -- ptr to memory ptrs.
default : default_ptr_type; -- ptr to default memory word value
default_val : default_ptr_type; -- ptr to default memory word value
end record;
type mem_id_type is access mem_id_rtype;
......@@ -1068,7 +1068,7 @@ end;
ptr := mem_id.row_data_ptr(row).rowptr;
for i in 0 to mem_id.columns - 1 loop
for j in 0 to mem_id.width - 1 loop
ptr(i,j) := To_UX01(mem_id.default(j));
ptr(i,j) := To_UX01(mem_id.default_val(j));
end loop;
end loop;
end if;
......@@ -1198,7 +1198,7 @@ end;
width => width,
length => length,
row_data_ptr => NULL,
default => NULL
default_val => NULL
);
if ( (length mod SRAM_COL_SIZE) /= 0) then
......@@ -1230,7 +1230,7 @@ end;
end loop;
-- set default word
mem_id.default := new std_logic_vector(mem_id.width - 1 downto 0);
mem_id.default_val := new std_logic_vector(mem_id.width - 1 downto 0);
if (default_word'length /= mem_id.width) then
assert (default_word'length = 0)
......@@ -1239,11 +1239,11 @@ end;
& "default will be set to a word filled with 'U'"
severity ERROR;
for i in 0 to mem_id.width - 1 loop
mem_id.default(i) := 'U';
mem_id.default_val(i) := 'U';
end loop;
else
mem_id.default.all := To_X01(default_word);
mem_id.default_val.all := To_X01(default_word);
end if;
return mem_id;
......@@ -1493,13 +1493,13 @@ end;
end if;
-- if collumn not allocated & fill value is not the default or all x's then allocate
if ( (mem_id.row_data_ptr(row).rowptr = NULL) and (alias_reset /= mem_id.default.all)
if ( (mem_id.row_data_ptr(row).rowptr = NULL) and (alias_reset /= mem_id.default_val.all)
and (alias_reset /= xvector) ) then
allocate_row (mem_id, row);
-- if filling partial row with default and currently is Xs then allocate
elsif ( (mem_id.row_data_ptr(row).rowptr = NULL) and (alias_reset = mem_id.default.all)
elsif ( (mem_id.row_data_ptr(row).rowptr = NULL) and (alias_reset = mem_id.default_val.all)
and mem_id.row_data_ptr(row).all_xs and
( (rstart_col /= 0) or (rend_col /= mem_id.columns - 1)) ) then
......@@ -1512,7 +1512,7 @@ end;
end if;
-- if filling entire collumn with default then deallocate it
If ( (alias_reset = mem_id.default.all) and (rstart_col = 0) and
If ( (alias_reset = mem_id.default_val.all) and (rstart_col = 0) and
(rend_col = mem_id.columns - 1) ) then
if (mem_id.row_data_ptr(row).rowptr /= NULL) then
......@@ -1872,18 +1872,18 @@ end;
data := (others => 'X');
tdata := From_HexString1(word)(file_width - 1 downto 0);
data(rwidth - 1 downto 0) := bv_To_StdLogicvector(tdata(rwidth - 1 downto 0));
if mem_id.default = NULL then
if mem_id.default_val = NULL then
mem_id.default := new std_logic_vector(mem_id.width - 1 downto 0);
mem_id.default_val := new std_logic_vector(mem_id.width - 1 downto 0);
else
deallocate (mem_id.default);
deallocate (mem_id.default_val);
mem_id.default := new std_logic_vector(mem_id.width - 1 downto 0);
mem_id.default_val := new std_logic_vector(mem_id.width - 1 downto 0);
end if;
mem_id.default.all := data;
mem_id.default_val.all := data;
get_sym (word, str_buff, b_Index, file_error, in_file, line_num);
w_id := word_id(word);
......@@ -2173,7 +2173,7 @@ end;
mem_word := (others => 'X');
elsif (mem_id.row_data_ptr(row).rowptr = NULL) then -- if not allocated return default
mem_word := mem_id.default.all;
mem_word := mem_id.default_val.all;
else
short_ptr := mem_id.row_data_ptr(row).rowptr;
......@@ -2239,7 +2239,7 @@ end;
if (mem_id.row_data_ptr(row).all_xs) then
data := 'X';
elsif (mem_id.row_data_ptr(row).rowptr = NULL) then
data := mem_id.default(0);
data := mem_id.default_val(0);
else
--data := mem_id.row_data_ptr(row).rowptr(column,0);
-- *************************************
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment