Clean up source files:
[matthijs/master-project/cλash.git] / cλash / CLasH / HardwareTypes.hs
index cff5c88568dd535d9b86b4059ed3166218c314b7..3b746aa242b702a9239b4dbcabd6d0fb34df0a4d 100644 (file)
@@ -51,7 +51,7 @@ resizeWord = SizedWord.resize
 data Bit = High | Low
   deriving (P.Show, P.Eq, P.Read, Typeable)
 
-$(deriveLift1 ''Bit)
+deriveLift1 ''Bit
 
 hwand :: Bit -> Bit -> Bit
 hwor  :: Bit -> Bit -> Bit
@@ -84,13 +84,14 @@ blockRAM ::
   a ->
   RangedWord s ->
   RangedWord s ->
-  Bit -> 
+  Bool -> 
   ((MemState s a), a )
 blockRAM (State mem) data_in rdaddr wraddr wrenable = 
   ((State mem'), data_out)
   where
     data_out  = mem!rdaddr
     -- Only write data_in to memory if write is enabled
-    mem' = case wrenable of
-      Low   ->  mem
-      High  ->  replace mem wraddr data_in
+    mem' =  if wrenable then
+              replace mem wraddr data_in
+            else
+              mem