profile
viewpoint

create barnchArturGogiyan/NLP_research

branch : master

created branch time in 4 hours

created repositoryArturGogiyan/NLP_research

created time in 4 hours

push eventryukzak/nitta

ArturGogiyan

commit sha 6357a45852159422f55663ade48959074f46a0c8

build fix

view details

push time in 13 days

push eventryukzak/nitta

BasicEC

commit sha 5d1ae9d9f00de7970f78aa57b5f7430cdc5d77d0

Introduce modifyNetwork method resolves #154

view details

BasicEC

commit sha 9c8d3032c7ea6b743e60db40f42d3c95dac99171

Refactor arch builder resolves #154

view details

BasicEC

commit sha 74d2b4432722f77c8493af7c0684af2fec6b9846

Refactor after review resolves #154

view details

Vitaliy

commit sha 9cd4514dc2b88ac91c01f6758b21a3f21e81ed28

Merge pull request #179 from ryukzak/154-reorganize-ma-builder-to-direct-work-with-network Resolves 'Reorganize microarchitecture builder to direct work with BusNetwork #154'

view details

ArturGogiyan

commit sha d6570262d15e38bc07c4358076c76f1a3cc4169f

new luaFrontend implementation

view details

Artur Gogiyan

commit sha 551e314ab558fe9670010ba3a9ffe84fd4944e77

Merge pull request #174 from ryukzak/LuaFrontend_new new LuaFrontend implementation

view details

ArturGogiyan

commit sha b763efc3890953126c8636f12c59cad54ceda75e

xeno added as XML parser

view details

ArturGogiyan

commit sha db7fcf044822ab2b7d32998f0b8d66cc2b4a5fea

sim_specs parsing

view details

ArturGogiyan

commit sha 0df8ed8165b316fcbfe65b62f00dc0c065275a33

skeleton for XMILE model

view details

ArturGogiyan

commit sha 8f1cb7c2a56584467a79dd9d5e2ef2a698bb98b0

luaFrontend moved to FrontEnds folder

view details

push time in 14 days

push eventryukzak/nitta

ArturGogiyan

commit sha aa5409c8db98d4c2ef4cf016b590a7fa2fba8b88

xeno added as XML parser

view details

ArturGogiyan

commit sha 894b31f7d8efc35cdfde07e9b3bc1ec9699f3df3

sim_specs parsing

view details

ArturGogiyan

commit sha 30e3b67ed25994e2cd2b269d9e92dc8b7c9f450b

skeleton for XMILE model

view details

ArturGogiyan

commit sha 81f411201af9ca9857d568f58d4ac391870792f7

luaFrontend moved to FrontEnds folder

view details

push time in 14 days

delete branch ryukzak/nitta

delete branch : LuaFrontend_new

delete time in a month

push eventryukzak/nitta

ArturGogiyan

commit sha d6570262d15e38bc07c4358076c76f1a3cc4169f

new luaFrontend implementation

view details

Artur Gogiyan

commit sha 551e314ab558fe9670010ba3a9ffe84fd4944e77

Merge pull request #174 from ryukzak/LuaFrontend_new new LuaFrontend implementation

view details

push time in a month

PR merged ryukzak/nitta

new LuaFrontend implementation
+605 -460

0 comment

8 changed files

ArturGogiyan

pr closed time in a month

push eventryukzak/nitta

BasicEC

commit sha 5d1ae9d9f00de7970f78aa57b5f7430cdc5d77d0

Introduce modifyNetwork method resolves #154

view details

BasicEC

commit sha 9c8d3032c7ea6b743e60db40f42d3c95dac99171

Refactor arch builder resolves #154

view details

BasicEC

commit sha 74d2b4432722f77c8493af7c0684af2fec6b9846

Refactor after review resolves #154

view details

Vitaliy

commit sha 9cd4514dc2b88ac91c01f6758b21a3f21e81ed28

Merge pull request #179 from ryukzak/154-reorganize-ma-builder-to-direct-work-with-network Resolves 'Reorganize microarchitecture builder to direct work with BusNetwork #154'

view details

ArturGogiyan

commit sha d6570262d15e38bc07c4358076c76f1a3cc4169f

new luaFrontend implementation

view details

push time in a month

push eventryukzak/nitta

ArturGogiyan

commit sha 9d51cfaeb4d35101f84a447cdcd32e354b83a700

haddock documentation of luaFrontend fix

view details

push time in a month

push eventryukzak/nitta

Aleksandr Penskoi

commit sha 54e785e8fbac700292794f25a9255ab939817a1f

Add hlint rules to force NITTA.Utils.Base

view details

Aleksandr Penskoi

commit sha 73bcc4be6fc722d19685b6b4bf057df29e07c177

Fix new hlint suggestions

view details

Aleksandr Penskoi

commit sha 28ba0dc39dc247aebc2d2e68a3e3f6cccc6b985f

Add hlint rules with qualified names.

view details

Artur Gogiyan

commit sha 0c5a20706db1bf3b9ad1302ff180349b89341265

Merge pull request #184 from ryukzak/hlint-rule Hlint rule for NITTA.Utils.Base

view details

ArturGogiyan

commit sha f43d307a505468a6a2f96abef00fb1d0ff216493

Merge remote-tracking branch 'origin/master' into 160_XMILE_parser

view details

push time in 2 months

Pull request review commentryukzak/nitta

new LuaFrontend implementation

 Copyright   : (c) Aleksandr Penskoi, 2019 License     : BSD3 Maintainer  : aleksandr.penskoi@gmail.com Stability   : experimental++This module analyzes an abstract syntax tree of the Lua language source code, provided by Language.Lua module,+and stores it into a NITTA's data flow graph.++Supported Lua costructions are:+ - simple math operators (addition, subtraction, multiplication and division);+ - variable assignments;+ - bitwise left and right shifts;+ - recursive calls. -} module NITTA.LuaFrontend (     lua2functions,     FrontendResult (..),     TraceVar (..),++    -- * Internal+    LuaAlgBuilder (..),+    LuaStatement (..),+    LuaValueInstance (..),+    findStartupFunction,+    getLuaBlockFromSources,+    processStatement, ) where -import Control.Monad.Identity import Control.Monad.State-import Data.Bifunctor import qualified Data.HashMap.Strict as HM-import Data.List (find, group, sort)+import Data.Hashable import qualified Data.Map.Strict as M import Data.Maybe import Data.String import Data.String.ToString-import qualified Data.String.Utils as S-import Data.Text (Text, pack, unpack) import qualified Data.Text as T import Language.Lua import NITTA.Intermediate.DataFlow import qualified NITTA.Intermediate.Functions as F-import NITTA.Utils (modify'_)+import NITTA.Utils.Base import Text.Printf +getUniqueLuaVariableName LuaValueInstance{luaValueInstanceName, luaValueInstanceIsConstant = True} luaValueAccessCount = "!" <> luaValueInstanceName <> "#" <> showText luaValueAccessCount+getUniqueLuaVariableName LuaValueInstance{luaValueInstanceName, luaValueInstanceAssignCount} luaValueAccessCount+    | T.head luaValueInstanceName == '_' = luaValueInstanceName+    | otherwise = luaValueInstanceName <> "^" <> showText luaValueInstanceAssignCount <> "#" <> showText luaValueAccessCount++data LuaStatement x = LuaStatement+    { fIn :: [T.Text]+    , fOut :: [LuaValueInstance]+    , fName :: T.Text+    , fValues :: [x]+    , fInt :: [Int]+    }+    deriving (Show, Eq)++-- | Stores information about a particular version of a variable. The version of a variable changes after assigning a new value to it.+data LuaValueInstance = LuaValueInstance+    { luaValueInstanceName :: T.Text+    , luaValueInstanceAssignCount :: Int+    , luaValueInstanceIsConstant :: Bool+    }+    deriving (Show, Eq)+ data FrontendResult v x = FrontendResult     { frDataFlow :: DataFlowGraph v x     , frTrace :: [TraceVar]     , frPrettyLog :: [HM.HashMap v x] -> [HM.HashMap String String]

https://github.com/ryukzak/nitta/issues/186

ArturGogiyan

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentryukzak/nitta

new LuaFrontend implementation

-{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE PartialTypeSignatures #-}-{-# LANGUAGE ScopedTypeVariables #-}+{-# OPTIONS_GHC -Wno-type-defaults #-} -{-# OPTIONS -fno-warn-type-defaults #-}--{- |-Module      : NITTA.LuaFrontend-Description : Lua frontend prototype-Copyright   : (c) Aleksandr Penskoi, 2019-License     : BSD3-Maintainer  : aleksandr.penskoi@gmail.com-Stability   : experimental--} module NITTA.LuaFrontend (     lua2functions,     FrontendResult (..),     TraceVar (..),++    -- * Internal+    LuaAlgBuilder (..),+    LuaStatement (..),+    LuaValueVersion (..),+    findStartupFunction,+    getLuaBlockFromSources,+    processStatement, ) where -import Control.Monad.Identity import Control.Monad.State-import Data.Bifunctor import qualified Data.HashMap.Strict as HM-import Data.List (find, group, sort)+import Data.Hashable import qualified Data.Map.Strict as M import Data.Maybe import Data.String import Data.String.ToString-import qualified Data.String.Utils as S-import Data.Text (Text, pack, unpack) import qualified Data.Text as T import Language.Lua import NITTA.Intermediate.DataFlow import qualified NITTA.Intermediate.Functions as F-import NITTA.Utils (modify'_)+import NITTA.Utils.Base import Text.Printf +getUniqueLuaVariableName LuaValueVersion{luaValueVersionName, luaValueVersionIsConstant = True} luaValueAccessCount = "!" <> luaValueVersionName <> "#" <> showText luaValueAccessCount+getUniqueLuaVariableName LuaValueVersion{luaValueVersionName, luaValueVersionAssignCount} luaValueAccessCount+    | T.head luaValueVersionName == '_' = luaValueVersionName+    | otherwise = luaValueVersionName <> "^" <> showText luaValueVersionAssignCount <> "#" <> showText luaValueAccessCount++data LuaStatement x = LuaStatement

https://github.com/ryukzak/nitta/issues/185

ArturGogiyan

comment created time in 2 months

PullRequestReviewEvent

push eventryukzak/nitta

Aleksandr Penskoi

commit sha 54e785e8fbac700292794f25a9255ab939817a1f

Add hlint rules to force NITTA.Utils.Base

view details

Aleksandr Penskoi

commit sha 73bcc4be6fc722d19685b6b4bf057df29e07c177

Fix new hlint suggestions

view details

Aleksandr Penskoi

commit sha 28ba0dc39dc247aebc2d2e68a3e3f6cccc6b985f

Add hlint rules with qualified names.

view details

Artur Gogiyan

commit sha 0c5a20706db1bf3b9ad1302ff180349b89341265

Merge pull request #184 from ryukzak/hlint-rule Hlint rule for NITTA.Utils.Base

view details

ArturGogiyan

commit sha b242bd2a1ac15dec72992a29fd5d3815b66028ad

Merge remote-tracking branch 'origin/master' into LuaFrontend_new

view details

ArturGogiyan

commit sha 0b91c8335f8d802e3b8161609e86ca7250060af5

formatting

view details

push time in 2 months

delete branch ryukzak/nitta

delete branch : hlint-rule

delete time in 2 months

push eventryukzak/nitta

Aleksandr Penskoi

commit sha 54e785e8fbac700292794f25a9255ab939817a1f

Add hlint rules to force NITTA.Utils.Base

view details

Aleksandr Penskoi

commit sha 73bcc4be6fc722d19685b6b4bf057df29e07c177

Fix new hlint suggestions

view details

Aleksandr Penskoi

commit sha 28ba0dc39dc247aebc2d2e68a3e3f6cccc6b985f

Add hlint rules with qualified names.

view details

Artur Gogiyan

commit sha 0c5a20706db1bf3b9ad1302ff180349b89341265

Merge pull request #184 from ryukzak/hlint-rule Hlint rule for NITTA.Utils.Base

view details

push time in 2 months

PR merged ryukzak/nitta

Hlint rule for NITTA.Utils.Base duplicate enhancement hs
+37 -7

0 comment

5 changed files

ryukzak

pr closed time in 2 months

PullRequestReviewEvent

push eventryukzak/nitta

ArturGogiyan

commit sha f8a3082fd7df537bf63af634df91239bef9f21ff

hashWithSalt implementation fix

view details

ArturGogiyan

commit sha 1dad83c75516c32d7c9d5c6e3839d5b96f0a25f9

code beautifying

view details

push time in 2 months

Pull request review commentryukzak/nitta

new LuaFrontend implementation

 Copyright   : (c) Aleksandr Penskoi, 2019 License     : BSD3 Maintainer  : aleksandr.penskoi@gmail.com Stability   : experimental++This module analyzes an abstract syntax tree of the Lua language source code, provided by Language.Lua module,+and stores it into a NITTA's data flow graph.++Supported Lua costructions are:+ - simple math operators (addition, subtraction, multiplication and division);+ - variable assignments;+ - bitwise left and right shifts;+ - recursive calls. -} module NITTA.LuaFrontend (     lua2functions,     FrontendResult (..),     TraceVar (..),++    -- * Internal+    LuaAlgBuilder (..),+    LuaStatement (..),+    LuaValueInstance (..),+    findStartupFunction,+    getLuaBlockFromSources,+    processStatement, ) where -import Control.Monad.Identity import Control.Monad.State-import Data.Bifunctor import qualified Data.HashMap.Strict as HM-import Data.List (find, group, sort)+import Data.Hashable import qualified Data.Map.Strict as M import Data.Maybe import Data.String import Data.String.ToString-import qualified Data.String.Utils as S-import Data.Text (Text, pack, unpack) import qualified Data.Text as T import Language.Lua import NITTA.Intermediate.DataFlow import qualified NITTA.Intermediate.Functions as F-import NITTA.Utils (modify'_)+import NITTA.Utils.Base import Text.Printf +getUniqueLuaVariableName LuaValueInstance{luaValueInstanceName, luaValueInstanceIsConstant = True} luaValueAccessCount = "!" <> luaValueInstanceName <> "#" <> showText luaValueAccessCount+getUniqueLuaVariableName LuaValueInstance{luaValueInstanceName, luaValueInstanceAssignCount} luaValueAccessCount+    | T.head luaValueInstanceName == '_' = luaValueInstanceName+    | otherwise = luaValueInstanceName <> "^" <> showText luaValueInstanceAssignCount <> "#" <> showText luaValueAccessCount

because it has 1 additional argument - accessCount. LuaValueInstance has no such field.

ArturGogiyan

comment created time in 2 months

PullRequestReviewEvent

delete branch ryukzak/nitta

delete branch : gogiyan_util_branch

delete time in 2 months

Pull request review commentryukzak/nitta

new LuaFrontend implementation

 Copyright   : (c) Aleksandr Penskoi, 2019 License     : BSD3 Maintainer  : aleksandr.penskoi@gmail.com Stability   : experimental++This module analyzes an abstract syntax tree of the Lua language source code, provided by Language.Lua module,+and stores it into a NITTA's data flow graph.++Supported Lua costructions are:+ - simple math operators (addition, subtraction, multiplication and division);+ - variable assignments;+ - bitwise left and right shifts;+ - recursive calls. -} module NITTA.LuaFrontend (     lua2functions,     FrontendResult (..),     TraceVar (..),++    -- * Internal+    LuaAlgBuilder (..),+    LuaStatement (..),+    LuaValueInstance (..),+    findStartupFunction,+    getLuaBlockFromSources,+    processStatement, ) where -import Control.Monad.Identity import Control.Monad.State-import Data.Bifunctor import qualified Data.HashMap.Strict as HM-import Data.List (find, group, sort)+import Data.Hashable import qualified Data.Map.Strict as M import Data.Maybe import Data.String import Data.String.ToString-import qualified Data.String.Utils as S-import Data.Text (Text, pack, unpack) import qualified Data.Text as T import Language.Lua import NITTA.Intermediate.DataFlow import qualified NITTA.Intermediate.Functions as F-import NITTA.Utils (modify'_)+import NITTA.Utils.Base import Text.Printf +getUniqueLuaVariableName LuaValueInstance{luaValueInstanceName, luaValueInstanceIsConstant = True} luaValueAccessCount = "!" <> luaValueInstanceName <> "#" <> showText luaValueAccessCount+getUniqueLuaVariableName LuaValueInstance{luaValueInstanceName, luaValueInstanceAssignCount} luaValueAccessCount+    | T.head luaValueInstanceName == '_' = luaValueInstanceName+    | otherwise = luaValueInstanceName <> "^" <> showText luaValueInstanceAssignCount <> "#" <> showText luaValueAccessCount++data LuaStatement x = LuaStatement+    { fIn :: [T.Text]+    , fOut :: [LuaValueInstance]+    , fName :: T.Text+    , fValues :: [x]+    , fInt :: [Int]+    }+    deriving (Show, Eq)++-- | Stores information about a particular version of a variable. The version of a variable changes after assigning a new value to it.+data LuaValueInstance = LuaValueInstance+    { luaValueInstanceName :: T.Text+    , luaValueInstanceAssignCount :: Int+    , luaValueInstanceIsConstant :: Bool+    }+    deriving (Show, Eq)+ data FrontendResult v x = FrontendResult     { frDataFlow :: DataFlowGraph v x     , frTrace :: [TraceVar]     , frPrettyLog :: [HM.HashMap v x] -> [HM.HashMap String String]     } -data TraceVar = TraceVar {tvFmt, tvVar :: Text}+data TraceVar = TraceVar {tvFmt, tvVar :: T.Text}     deriving (Show) -defaultFmt = "%.3f"---- |List contains IO Function names to be printed by default.-listFuncIO = ["send", "recieve"]--prettyLog traceVars hms = map prettyHM hms-    where-        prettyHM hm = HM.fromList $ map (fromMaybe undefined) $ filter isJust $ map prettyX $ HM.toList hm-        prettyX (v0, x) = do-            -- variables names end on #0, #1..., so we trim this suffix-            let v = takeWhile (/= '#') $ toString v0-            fmt <- v2fmt M.!? v-            Just (toString v, printx (T.unpack fmt) x)-        v2fmt = M.fromList $ map (\(TraceVar fmt v) -> (toString v, fmt)) traceVars-        printx p x-            | 'f' `elem` p = printf p (fromRational (toRational x) :: Double)-            | 's' `elem` p = printf p $ show x-            | otherwise = printf p x+instance Hashable LuaValueInstance where+    hashWithSalt i LuaValueInstance{luaValueInstanceName, luaValueInstanceAssignCount, luaValueInstanceIsConstant} =+        ( (hashWithSalt i luaValueInstanceName * 31)+            + hashWithSalt i luaValueInstanceAssignCount * 31+        )+            + hashWithSalt i luaValueInstanceIsConstant * 31

31 is a prime number, if we use it as a multiplication coefficient it gives more smooth distribution of a hashCode. I have found it here, several years ago https://github.com/muhdkhokhar/test/blob/master/Joshua%20Bloch%20-%20Effective%20Java%20(3rd)%20-%202018.pdf (page 52)

but yes, I had some troubles here with brackets, fixed

ArturGogiyan

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentryukzak/nitta

new LuaFrontend implementation

 module NITTA.LuaFrontend.Tests (     tests, ) where -import Control.Exception (ErrorCall, catch)+import Control.Monad.State import Data.FileEmbed (embedStringFile)+import qualified Data.HashMap.Strict as HM import Data.String.Interpolate+import Data.Text as T+import qualified Language.Lua as Lua import NITTA.Intermediate.Functions import NITTA.Intermediate.Types import NITTA.LuaFrontend import NITTA.LuaFrontend.Tests.Providers import Test.Tasty (TestTree, testGroup)-import Test.Tasty.ExpectedFailure import Test.Tasty.HUnit import Test.Tasty.TH -case_lua_constant_declatation =+case_find_startup_function_several_args =     let src =             [__i|-                function sum(a)+                function sum(a, b)                     local t = 2                     local r = -1-                    sum(a + t + r)+                    sum(b + t + r, a)                 end-                sum(0)+                sum(1, 2)             |]-        dfg =-            [ add "a#0" "t#0" ["tmp_1#0"]-            , add "tmp_1#0" "r#0" ["tmp_0#0"]-            , loop 0 "tmp_0#0" ["a#0"]-            , constant (-1) ["r#0"]-            , constant 2 ["t#0"] :: F String Int+        (actualName, Lua.FunCall (Lua.NormalFunCall _ (Lua.Args actualArgValue)), Lua.FunAssign _ (Lua.FunBody actualArg _ _)) = findStartupFunction (getLuaBlockFromSources src)+        expectedValues = ("sum", [Lua.Name "a", Lua.Name "b"], [Lua.Number Lua.IntNum "1", Lua.Number Lua.IntNum "2"])+     in (actualName, actualArg, actualArgValue) @?= expectedValues++case_find_startup_function_no_args =+    let src =+            [__i|+                function sum()+                    t = receive()+                    t = t + 1+                    send(t)+                    sum()+                end+                sum()+            |]+        (actualName, Lua.FunCall (Lua.NormalFunCall _ (Lua.Args actualArgValue)), Lua.FunAssign _ (Lua.FunBody actualArg _ _)) = findStartupFunction (getLuaBlockFromSources src)+        expectedValues = ("sum", [], [])+     in (actualName, actualArg, actualArgValue) @?= expectedValues++-- |local a = 2+case_process_local_assignment_statement =+    let assignment = Lua.LocalAssign [Lua.Name "a"] (Just [Lua.Number Lua.IntNum "2"])+        expected = HM.fromList [("a", LuaValueInstance{luaValueInstanceName = "a", luaValueInstanceAssignCount = 0, luaValueInstanceIsConstant = False})]+        (_, LuaAlgBuilder{algLatestLuaValueInstance}) = runState (processStatement "_" assignment) defaultAlgBuilder+     in algLatestLuaValueInstance @?= expected++-- |a = 2+case_process_assignment_statement =+    let assignment = Lua.Assign [Lua.VarName (Lua.Name "a")] [Lua.Number Lua.IntNum "2"]+        expected = HM.fromList [("a", LuaValueInstance{luaValueInstanceName = "a", luaValueInstanceAssignCount = 0, luaValueInstanceIsConstant = False})]+        (_, LuaAlgBuilder{algLatestLuaValueInstance}) = runState (processStatement "_" assignment) defaultAlgBuilder+     in algLatestLuaValueInstance @?= expected++--case_process_multiple_assignments_statement =+--    let assignment = Assign [VarName (Name $  "a"), VarName (Name $  "b")] [Number IntNum $  "2", Number FloatNum $  "2.5"]+--        expected =+--            Map.fromList+--                [ ( "a", LuaValueInstance{luaValueInstanceName =  "a", luaValueInstanceAssignCount = 0, luaValueInstanceIsConstant = False})+--                , ( "b", LuaValueInstance{luaValueInstanceName =  "b", luaValueInstanceAssignCount = 0, luaValueInstanceIsConstant = False})+--                ]+--        (_str :: String, AlgBuilder{algLatestLuaValueInstance}) = runState (processStatement ( "_") assignment) defaultAlgBuilder+--     in algLatestLuaValueInstance @?= expected

yes, this test case was checked here https://github.com/ryukzak/nitta/blob/LuaFrontend_new/test/NITTA/LuaFrontend/Tests.hs#L269.

ArturGogiyan

comment created time in 2 months

PullRequestReviewEvent

push eventryukzak/nitta

ArturGogiyan

commit sha 18b38d500bfdb73fa7bc374801057b3cc03bd85f

dead code removed

view details

ArturGogiyan

commit sha ab22a6f988c92da548d35d4791b20b6e8eefb9bd

LuaValueInstance fields renamed to lvi prefix

view details

push time in 2 months

more