<commit_before><commit_msg>Dummy LT24 implementation for tracing actions<commit_after>{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}

module Simul.LT24.DummyLT24 where

import CLaSH.Prelude
import Control.Applicative
import Debug.Trace

import LT24.LT24 (Action(..))

lt24 i@(action, din, ltdin)
    = (ready, dout, lcd_on, csx, resx, dcx, wrx, rdx, ltdout, oe)
    where
        dout = signal (0 :: Unsigned 16)
        lcd_on = signal H
        csx = signal L
        resx = signal H
        dcx = signal H
        wrx = signal H
        rdx = signal H
        ltdout = din
        oe = signal L

        iD = (unpack . register (NOP, 0, 0) . pack) i
        ready = (lt24' <^> True) iD

lt24' :: Bool
      -> (Action, Unsigned 16, Unsigned 16)
      -> (Bool, Bool)
lt24' False (action, din, _) = (True, True)
lt24' True  (NOP   , din, _) = (True, True)
lt24' True  (action, din, _) = trace ((shows action . (',':) . shows din) "")
                                  (False, False)
{'fraction_non_alphanumeric': 0.13139418254764293, 'fraction_numerical': 0.031093279839518557, 'mean_word_length': 2.198717948717949, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2190134', 'n_tokens_mistral': 388, 'n_tokens_neox': 362, 'n_words': 109}