Skip to content

Commit

Permalink
On MemoryRead return U when data uninitialized and X when written dat…
Browse files Browse the repository at this point in the history
…a had an X
  • Loading branch information
JimLewis committed Nov 26, 2016
1 parent fe9c209 commit a334197
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions MemoryPkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
-- 06/2015: 2015.06 Updated for Alerts, ...
-- Numerous revisions for VHDL Testbenches and Verification
-- 01/2016: 2016.01 Update for buf.all(buf'left)
-- 11/2016: 2016.11 Refinement to MemRead to return value, X (if X), U (if not initialized)
--
--
-- Copyright (c) 2005 - 2016 by SynthWorks Design Inc. All rights reserved.
Expand Down Expand Up @@ -257,13 +258,17 @@ package body MemoryPkg is
-- Address of a word within a block
WordAddr := to_integer(aAddr(BlockkWidthVar -1 downto 0)) ;

-- X in Word, return all X
if (ArrayPtrVar(BlockAddr)(WordAddr) < 0) then
if ArrayPtrVar(BlockAddr)(WordAddr) >= 0 then
-- Get the Word from the Array
Data := to_slv(ArrayPtrVar(BlockAddr)(WordAddr), Data'length) ;

elsif ArrayPtrVar(BlockAddr)(WordAddr) = -1 then
-- X in Word, return all X
Data := (Data'range => 'X') ;

-- Get the Word from the Array

else
Data := to_slv(ArrayPtrVar(BlockAddr)(WordAddr), Data'length) ;
-- Location Uninitialized, return all X
Data := (Data'range => 'U') ;

end if ;
end procedure MemRead ;
Expand Down

0 comments on commit a334197

Please sign in to comment.