Did some visual cleaning up

This commit is contained in:
2022-05-04 11:46:51 +02:00
parent 66cb839f87
commit 231357624f
2 changed files with 100 additions and 89 deletions

View File

@ -129,80 +129,52 @@ viewCu model =
( instrRegInst, instrRegAddr ) = seperateInstructionsEntry model.pc.instructionReg
in
div [ class "section", class "cu" ]
[ drawArrow Top Up UA_InstructionReg2AddressBus "InstR -> AddrB"
, drawArrow Top Up UA_ProgrammCounter2AddressBus "ProgCounter -> AddrB"
--, div [ class "arrow", class "up", class "top"]
-- [ div [ class "button" ]
-- [ Html.a [ onClick (PM_ManualStep ActInstructionReg2AddressBus)] [ text "InstR -> AddrB" ]]
-- , div [] []
-- ]
--, div [ class "arrow", class "up", class "top", class "arrow2"]
-- [ div [ class "button" ]
-- [ Html.a [ onClick (PM_ManualStep ActProgrammCounter2AddressBus)] [ text "ProgCounter -> AddrB" ]]
-- , div [] []
-- ]
[ drawArrow Top Up UA_CU_InstructionReg2AddressBus "InstR -> AddrB"
, drawArrow Top Up UA_CU_ProgrammCounter2AddressBus "ProgCounter -> AddrB"
, h1 [ class "header" ] [ text "Control Unit" ]
, p []
[ div [class "input-row"]
[ Html.label [ HAttr.for "cu-progcounter" ] [ text "Programm Counter:" ]
, div [ class "input-group" ]
[ button
[ onClick <| PM_ManualStep UA_InstructionReg2ProgrammCounter ]
[ text "InstRA -> " ]
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-progcounter"
, value (addLeadingZero model.pc.programmCounter 3)
, onInput PM_F_CuProgCounterEdit
] []
]
]
, div [class "input-row"]
[ Html.label [ HAttr.for "cu-instrReg" ] [ text "Instruction Register:" ]
, div []
[ Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-instrReg"
, class "instruction"
, value (addLeadingZero instrRegInst 3)
, onInput PM_F_CuInstrRegEditInstr
] []
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-instrReg"
, class "address"
, value (addLeadingZero instrRegAddr 5)
, onInput PM_F_CuInstrRegEditAddr
] []
]
]
, div [class "input-row"]
[ Html.label [ HAttr.for "cu-uCounter" ] [ text "µCode Counter:" ]
, div [ class "input-group" ]
[ button
[ onClick <| PM_ManualStep UA_InstructionReg2UCounter ]
[ text "IntrRI ->" ]
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-uCounter"
, value (addLeadingZero model.pc.uCounter 4)
, onInput PM_F_CuUCounterEdit
] []
]
]
, div [ class "action-area" ]
[ -- Programm Counter
Html.label [ HAttr.for "cu-progcounter" ] [ text "Programm Counter:" ]
, button
[ onClick <| PM_ManualStep UA_CU_InstructionReg2ProgrammCounter ]
[ text "InstRA -> " ]
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-progcounter"
, value (addLeadingZero model.pc.programmCounter 3)
, onInput PM_F_CuProgCounterEdit
] []
-- IR
, Html.label [HAttr.for "cu-instrReg" ] [ text "Instruction Register:" ]
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-instrReg"
, class "instruction"
, value (addLeadingZero instrRegInst 3)
, onInput PM_F_CuInstrRegEditInstr
] []
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-instrReg"
, class "address"
, value (addLeadingZero instrRegAddr 5)
, onInput PM_F_CuInstrRegEditAddr
] []
-- µCounter
, Html.label [ HAttr.for "cu-uCounter" ] [ text "µCode Counter:" ]
, button
[ onClick <| PM_ManualStep UA_CU_InstructionReg2UCounter ]
[ text "IntrRI ->" ]
, Html.input
[ HAttr.type_ "number"
, HAttr.id "cu-uCounter"
, value (addLeadingZero model.pc.uCounter 4)
, onInput PM_F_CuUCounterEdit
] []
]
, div [ class "scroller" ]
[ viewCuUCode model
]
--, div [ class "arrow", class "up"]
-- [ div [ class "button" ]
-- [ Html.a [ onClick (MsgManualStep ActDataBus2InstructionReg) ] [ text "DB -> InstR" ]]
-- , div [] []
-- ]
, drawArrow Bottom Up UA_DataBus2InstructionReg "DB -> InstR"
]
@ -282,7 +254,7 @@ viewAlu : PC_Model -> Html PC_Msg
viewAlu model =
div [ class "section", class "alu" ]
[ h1 [ class "header" ] [ text "ALU" ]
, p []
, p []
[ Html.label [ HAttr.for "alu-accumulator" ] [ text "Accumulator:" ]
, Html.input
[ HAttr.type_ "number"
@ -291,22 +263,29 @@ viewAlu model =
, onInput PM_F_AluEdit
] []
]
, p []
[ button [ onClick <| PM_ManualStep UA_AccumulatorIncrement ] [ text "Acc ++" ]
, button [ onClick <| PM_ManualStep UA_AccumulatorDecrement ] [ text "Acc --" ]
, div []
[ Html.span [] [ text "General µActions" ]
, Html.br [] []
, div [ class "button-group-alu__2-elements" ]
[ button [ onClick <| PM_ManualStep UA_ALU_AccumulatorIncrement ] [ text "Acc ++" ]
, button [ onClick <| PM_ManualStep UA_ALU_AccumulatorDecrement ] [ text "Acc --" ]
]
]
, drawArrow Bottom Up UA_DataBus2Accumulator "DB -> ALU"
, drawArrow Bottom Down UA_Accumulator2DataBus "ALU -> DB"
--, div [ class "arrow", class "up"]
-- [ div [ class "button" ]
-- [ Html.a [ onClick (MsgManualStep ActDataBus2Accumulator)] [ text "DB -> ALU" ]]
-- , div [] []
-- ]
--, div [ class "arrow", class "down"]
-- [ div [ class "button" ]
-- [ Html.a [ onClick (MsgManualStep ActAccumulator2DataBus)] [ text "ALU -> DB" ]]
-- , div [] []
-- ]
, div []
[ Html.span [] [ text "µActions from DataBus" ]
, div [ class "button-group-alu__2-elements" ]
[ button [ onClick <| PM_ManualStep UA_ALU_AccumulatorShiftLeftByDataBus ] [ text "LeftShift"]
, button [ onClick <| PM_ManualStep UA_ALU_AccumulatorShiftRightByDataBus ] [ text "RightShift" ]
]
, div [ class "button-group-alu__4-elements" ]
[ button [ onClick <| PM_ManualStep UA_ALU_AccumulatorAddByDataBus ] [ text "+" ]
, button [ onClick <| PM_ManualStep UA_ALU_AccumulatorSubtractByDataBus ] [ text "-" ]
, button [ onClick <| PM_ManualStep UA_ALU_AccumulatorMultiplyByDataBus ] [ text "*" ]
, button [ onClick <| PM_ManualStep UA_ALU_AccumulatorDivideByDataBus ] [ text "/" ]
]
]
, drawArrow Bottom Up UA_DataBus2Accumulator "DB -> ALU"
, drawArrow Bottom Down UA_ALU_Accumulator2DataBus "ALU -> DB"
]
-- #####################################################################