From d0fc22d3e90e951ae6d9b0ec2ed6974a1e07a121 Mon Sep 17 00:00:00 2001 From: Loic GUEGAN Date: Sun, 2 Sep 2018 18:46:31 +0200 Subject: Debug test on ram --- MicSim/components/ram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MicSim/components') diff --git a/MicSim/components/ram.py b/MicSim/components/ram.py index 62edb0c..a0f708e 100644 --- a/MicSim/components/ram.py +++ b/MicSim/components/ram.py @@ -69,7 +69,7 @@ class Ram: try: value=self.data[addr] except: - if addr>self.lastAddr: + if addr>self.lastAddr or addr<0: raise ValueError("You get out of the ram by trying to get value at address {}, max address is {}".format(addr,self.lastAddr)) if(value==None): return(0) -- cgit v1.2.3