Browse Source

Make proc/fnc input parameters constant

pull/1/head
T. Meissner 9 years ago
parent
commit
83bea18388
1 changed files with 17 additions and 17 deletions
  1. +17
    -17
      sim/DictP.vhd

+ 17
- 17
sim/DictP.vhd View File

@ -15,16 +15,16 @@ package DictP is
type t_dict is protected type t_dict is protected
procedure set (key : in string; data : in std_logic_vector; err : out t_dict_error);
procedure get (key : in string; data : out std_logic_vector; err : out t_dict_error);
procedure del (key : in string; err : out t_dict_error);
procedure init (logging : in boolean := false);
procedure set (constant key : in string; constant data : in std_logic_vector; err : out t_dict_error);
procedure get (constant key : in string; data : out std_logic_vector; err : out t_dict_error);
procedure del (constant key : in string; err : out t_dict_error);
procedure init (constant logging : in boolean := false);
procedure clear (err : out t_dict_error); procedure clear (err : out t_dict_error);
impure function hasKey (key : string) return boolean;
impure function hasKey (constant key : string) return boolean;
impure function size return natural; impure function size return natural;
impure function iter (dir : t_dict_dir := UP) return string;
impure function get(key : string) return std_logic_vector;
procedure setIter(constant start : in t_dict_iter := TAIL); procedure setIter(constant start : in t_dict_iter := TAIL);
impure function iter (constant dir : t_dict_dir := UP) return string;
impure function get (constant key : string) return std_logic_vector;
end protected t_dict; end protected t_dict;
@ -57,9 +57,9 @@ package body DictP is
variable v_size : natural := 0; variable v_size : natural := 0;
variable v_logging : boolean := false; variable v_logging : boolean := false;
impure function find (key : string) return t_entry_ptr;
impure function find (constant key : string) return t_entry_ptr;
procedure set (key : in string; data : in std_logic_vector; err : out t_dict_error) is
procedure set (constant key : in string; constant data : in std_logic_vector; err : out t_dict_error) is
variable v_entry : t_entry_ptr := find(key); variable v_entry : t_entry_ptr := find(key);
begin begin
if (key = "") then if (key = "") then
@ -96,7 +96,7 @@ package body DictP is
end if; end if;
end procedure set; end procedure set;
procedure get (key : in string; data : out std_logic_vector; err : out t_dict_error) is
procedure get (constant key : in string; data : out std_logic_vector; err : out t_dict_error) is
variable v_entry : t_entry_ptr := find(key); variable v_entry : t_entry_ptr := find(key);
begin begin
if(v_entry /= null) then if(v_entry /= null) then
@ -110,7 +110,7 @@ package body DictP is
end if; end if;
end procedure get; end procedure get;
procedure del (key : in string; err : out t_dict_error) is
procedure del (constant key : in string; err : out t_dict_error) is
variable v_entry : t_entry_ptr := find(key); variable v_entry : t_entry_ptr := find(key);
begin begin
if (v_entry /= null) then if (v_entry /= null) then
@ -138,7 +138,7 @@ package body DictP is
end if; end if;
end procedure del; end procedure del;
impure function find (key : string) return t_entry_ptr is
impure function find (constant key : string) return t_entry_ptr is
variable v_entry : t_entry_ptr := v_head; variable v_entry : t_entry_ptr := v_head;
begin begin
while (v_entry /= null) loop while (v_entry /= null) loop
@ -168,7 +168,7 @@ package body DictP is
err := NO_ERROR; err := NO_ERROR;
end procedure clear; end procedure clear;
impure function hasKey (key : string) return boolean is
impure function hasKey (constant key : string) return boolean is
begin begin
return find(key) /= null; return find(key) /= null;
end function hasKey; end function hasKey;
@ -178,7 +178,7 @@ package body DictP is
return v_size; return v_size;
end function size; end function size;
procedure init (logging : in boolean := false) is
procedure init (constant logging : in boolean := false) is
begin begin
v_logging := logging; v_logging := logging;
end procedure init; end procedure init;
@ -192,7 +192,7 @@ package body DictP is
end if; end if;
end procedure setIter; end procedure setIter;
impure function iter (dir : t_dict_dir := UP) return string is
impure function iter (constant dir : t_dict_dir := UP) return string is
variable v_key : t_dict_key_ptr := null; variable v_key : t_dict_key_ptr := null;
begin begin
if (v_iterator /= null) then if (v_iterator /= null) then
@ -208,7 +208,7 @@ package body DictP is
end if; end if;
end function iter; end function iter;
impure function get(key : string) return std_logic_vector is
impure function get(constant key : string) return std_logic_vector is
variable v_entry : t_entry_ptr := find(key); variable v_entry : t_entry_ptr := find(key);
begin begin
assert v_entry /= null assert v_entry /= null
@ -221,7 +221,7 @@ package body DictP is
end protected body t_dict; end protected body t_dict;
procedure merge(d0 : inout t_dict; d1 : inout t_dict; d : inout t_dict) is
procedure merge(d0 : inout t_dict; d1 : inout t_dict; d : inout t_dict; err : out t_dict_error) is
variable v_key : t_dict_key_ptr; variable v_key : t_dict_key_ptr;
variable v_data : t_dict_data_ptr; variable v_data : t_dict_data_ptr;
variable v_error : t_dict_error; variable v_error : t_dict_error;


Loading…
Cancel
Save