Compare commits
No commits in common. "452056f71c12660d520e7930002dc5657b8f9741" and "5a28a554a1a5a9c31f74338cf80c9519f9a5cb47" have entirely different histories.
452056f71c
...
5a28a554a1
@ -17,6 +17,5 @@ type Msg
|
|||||||
| UseHierarchy (Maybe CacheModelHierarchy)
|
| UseHierarchy (Maybe CacheModelHierarchy)
|
||||||
| Access (List Int)
|
| Access (List Int)
|
||||||
| ChangeAccessInput String
|
| ChangeAccessInput String
|
||||||
| AccessViewCancel
|
|
||||||
| AccessViewForward
|
| AccessViewForward
|
||||||
| AccessViewBack
|
| AccessViewBack
|
||||||
|
@ -60,14 +60,6 @@ updateAccess li m =
|
|||||||
in
|
in
|
||||||
(newModel, cmd)
|
(newModel, cmd)
|
||||||
|
|
||||||
updateAccessViewCancel : Model -> (Model, Cmd Msg)
|
|
||||||
updateAccessViewCancel m =
|
|
||||||
let
|
|
||||||
newModel = { m | accessView = Nothing }
|
|
||||||
cmd = Cmd.none
|
|
||||||
in
|
|
||||||
(newModel, cmd)
|
|
||||||
|
|
||||||
updateAccessViewForward : Model -> (Model, Cmd Msg)
|
updateAccessViewForward : Model -> (Model, Cmd Msg)
|
||||||
updateAccessViewForward m =
|
updateAccessViewForward m =
|
||||||
let
|
let
|
||||||
|
@ -22,9 +22,6 @@ disabledButton attrs = button (attrs ++ [ disabled True ])
|
|||||||
dangerButton : String -> Msg -> Html Msg
|
dangerButton : String -> Msg -> Html Msg
|
||||||
dangerButton s m = button [ onClick m, class "btn-danger" ] s
|
dangerButton s m = button [ onClick m, class "btn-danger" ] s
|
||||||
|
|
||||||
infoButton : String -> Msg -> Html Msg
|
|
||||||
infoButton s m = button [ onClick m, class "btn-info" ] s
|
|
||||||
|
|
||||||
primaryButton : String -> Msg -> Html Msg
|
primaryButton : String -> Msg -> Html Msg
|
||||||
primaryButton s m = button [ onClick m, class "btn-primary" ] s
|
primaryButton s m = button [ onClick m, class "btn-primary" ] s
|
||||||
|
|
||||||
@ -42,10 +39,7 @@ resultButton = maybeButton << Result.toMaybe
|
|||||||
|
|
||||||
-- Button wrapper (button group)
|
-- Button wrapper (button group)
|
||||||
buttonWrapper : List (Html Msg) -> Html Msg
|
buttonWrapper : List (Html Msg) -> Html Msg
|
||||||
buttonWrapper = div [ classList [("btn-group", True), ("mb-3", True), ("mr-3", True) ] ]
|
buttonWrapper = div [ classList [("btn-group", True), ("mb-3", True) ] ]
|
||||||
|
|
||||||
buttonToolbar : List (List (Html Msg)) -> Html Msg
|
|
||||||
buttonToolbar ll = div [ class "btn-toolbar" ] <| List.map buttonWrapper ll
|
|
||||||
|
|
||||||
-- Input with a label
|
-- Input with a label
|
||||||
labeledInput : String -> String -> (String -> Msg) -> Html Msg
|
labeledInput : String -> String -> (String -> Msg) -> Html Msg
|
||||||
@ -108,8 +102,8 @@ viewRawCacheModelHierarchy rcmh =
|
|||||||
Ok _ -> viewError True ""
|
Ok _ -> viewError True ""
|
||||||
Err e -> viewError False e
|
Err e -> viewError False e
|
||||||
|
|
||||||
newButton = infoButton "Add level" CreateRawModel
|
newButton = primaryButton "Add level" CreateRawModel
|
||||||
useButton = resultButton checkedResult [ class "btn-info" ] "Start simulation" (UseHierarchy << Just)
|
useButton = resultButton checkedResult [ class "btn-primary" ] "Start simulation" (UseHierarchy << Just)
|
||||||
in
|
in
|
||||||
div []
|
div []
|
||||||
[ h2 [] [ text "Cache hierarchy" ]
|
[ h2 [] [ text "Cache hierarchy" ]
|
||||||
@ -169,9 +163,9 @@ viewAccessView m av =
|
|||||||
div []
|
div []
|
||||||
[ h2 [] [ text "Access Simulation" ]
|
[ h2 [] [ text "Access Simulation" ]
|
||||||
, p [] [ text ("Simulating access of address " ++ String.fromInt av.blockAddr) ]
|
, p [] [ text ("Simulating access of address " ++ String.fromInt av.blockAddr) ]
|
||||||
, buttonToolbar
|
, buttonWrapper
|
||||||
[ [ infoButton "Back" AccessViewBack, infoButton "Forward" AccessViewForward ]
|
[ primaryButton "Back" AccessViewBack
|
||||||
, [ dangerButton "Stop" AccessViewCancel ]
|
, primaryButton "Forward" AccessViewForward
|
||||||
]
|
]
|
||||||
, h3 [] [ text "Access event log" ]
|
, h3 [] [ text "Access event log" ]
|
||||||
, viewAccessLog av
|
, viewAccessLog av
|
||||||
@ -222,12 +216,12 @@ viewAccessInput m =
|
|||||||
case parseResult of
|
case parseResult of
|
||||||
Ok is -> if is == [] then Err "Please enter at least one number." else Ok is
|
Ok is -> if is == [] then Err "Please enter at least one number." else Ok is
|
||||||
Err e -> Err <| parseErrorToString e
|
Err e -> Err <| parseErrorToString e
|
||||||
accessButton = resultButton checkedResult [ class "btn-info" ] "Access address" Access
|
accessButton = resultButton checkedResult [ class "btn-primary" ] "Access address" Access
|
||||||
errorHtml =
|
errorHtml =
|
||||||
case checkedResult of
|
case checkedResult of
|
||||||
Ok _ -> viewError True ""
|
Ok _ -> viewError True ""
|
||||||
Err e -> viewError False e
|
Err e -> viewError False e
|
||||||
editHierarchyButton = button [ onClick (UseHierarchy Nothing), class "btn-dark" ] "Edit hierarchy"
|
editHierarchyButton = secondaryButton "Edit hierarchy" (UseHierarchy Nothing)
|
||||||
in
|
in
|
||||||
div []
|
div []
|
||||||
[ h2 [] [ text "Run access simulation" ]
|
[ h2 [] [ text "Run access simulation" ]
|
||||||
|
@ -35,7 +35,6 @@ update msg m =
|
|||||||
UseHierarchy cmh -> updateUseHierarchy cmh m
|
UseHierarchy cmh -> updateUseHierarchy cmh m
|
||||||
Access i -> updateAccess i m
|
Access i -> updateAccess i m
|
||||||
ChangeAccessInput s -> ({ m | accessInput = s }, Cmd.none)
|
ChangeAccessInput s -> ({ m | accessInput = s }, Cmd.none)
|
||||||
AccessViewCancel -> updateAccessViewCancel m
|
|
||||||
AccessViewForward -> updateAccessViewForward m
|
AccessViewForward -> updateAccessViewForward m
|
||||||
AccessViewBack -> updateAccessViewBack m
|
AccessViewBack -> updateAccessViewBack m
|
||||||
|
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
.btn-group {
|
.btn-group {
|
||||||
width: min-content;
|
width: min-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn:focus {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user