Skip to content

Commit a334197

Browse files
committed
On MemoryRead return U when data uninitialized and X when written data had an X
1 parent fe9c209 commit a334197

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

MemoryPkg.vhd

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
-- 06/2015: 2015.06 Updated for Alerts, ...
2424
-- Numerous revisions for VHDL Testbenches and Verification
2525
-- 01/2016: 2016.01 Update for buf.all(buf'left)
26+
-- 11/2016: 2016.11 Refinement to MemRead to return value, X (if X), U (if not initialized)
2627
--
2728
--
2829
-- Copyright (c) 2005 - 2016 by SynthWorks Design Inc. All rights reserved.
@@ -257,13 +258,17 @@ package body MemoryPkg is
257258
-- Address of a word within a block
258259
WordAddr := to_integer(aAddr(BlockkWidthVar -1 downto 0)) ;
259260

260-
-- X in Word, return all X
261-
if (ArrayPtrVar(BlockAddr)(WordAddr) < 0) then
261+
if ArrayPtrVar(BlockAddr)(WordAddr) >= 0 then
262+
-- Get the Word from the Array
263+
Data := to_slv(ArrayPtrVar(BlockAddr)(WordAddr), Data'length) ;
264+
265+
elsif ArrayPtrVar(BlockAddr)(WordAddr) = -1 then
266+
-- X in Word, return all X
262267
Data := (Data'range => 'X') ;
263-
264-
-- Get the Word from the Array
268+
265269
else
266-
Data := to_slv(ArrayPtrVar(BlockAddr)(WordAddr), Data'length) ;
270+
-- Location Uninitialized, return all X
271+
Data := (Data'range => 'U') ;
267272

268273
end if ;
269274
end procedure MemRead ;

0 commit comments

Comments
 (0)