Decoding net: Fail on region resolution with non contiuous domain for address
authorDaniel Schwyn <schwyda@student.ethz.ch>
Mon, 25 Sep 2017 12:51:47 +0000 (14:51 +0200)
committerDaniel Schwyn <schwyda@student.ethz.ch>
Mon, 25 Sep 2017 13:06:54 +0000 (15:06 +0200)
Signed-off-by: Daniel Schwyn <schwyda@student.ethz.ch>

usr/skb/programs/decoding_net.pl

index ebab33a..b4b5fd5 100644 (file)
@@ -54,13 +54,18 @@ to_region(Name,Region) :-
         node_id:Id,
         address:Addr
     } = Name,
-    get_min(Addr,Min),get_max(Addr,Max),
+    get_bounds(Addr,Min,Max),
     Size is Max - Min + 1,
-    Region = region{
-        node_id:Id,
-        base:Min,
-        size:Size
-    }.
+    ( get_domain_size(Addr,Size) ->
+            Region = region{
+            node_id:Id,
+            base:Min,
+            size:Size
+        }
+    ;
+        writeln(stderr,"Name conversion to region failed: Non continuous domain for address"),
+        fail
+    ).
 
 %% Address range in block
 block_range(Block,Range) :-