Skip to content

Commit

Permalink
minor changes and beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Tafas committed Mar 17, 2020
1 parent 4363857 commit fd4149c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sim/std_logic_expert_tb.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
library repo;
use repo.std_logic_expert.all;
library expert;
use expert.std_logic_expert.all;
library vunit_lib;
context vunit_lib.vunit_context;

Expand Down
9 changes: 9 additions & 0 deletions src/std_logic_expert.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.math_real.all;

package std_logic_expert is

Expand Down Expand Up @@ -106,6 +107,8 @@ package std_logic_expert is
function "<=" (l:std_logic_vector; r: unsigned) return boolean;
function "<=" (l:unsigned; r: std_logic_vector) return boolean;

function size_for (input: integer) return integer;

end std_logic_expert;

--a arquitetura
Expand Down Expand Up @@ -670,4 +673,10 @@ begin
return tmp;
end "<=";

function size_for (input: integer) return integer is
begin
return integer(ceil(log2(real(input))));
end size_for;


end std_logic_expert;

0 comments on commit fd4149c

Please sign in to comment.