diff --git a/pages/index.js b/pages/index.js index c291c79..0ae3448 100644 --- a/pages/index.js +++ b/pages/index.js @@ -11,15 +11,11 @@ import { useState } from 'react'; import Button from 'react-bootstrap/Button'; export default function Home() { + const [clock, setClock] = useState(0); const [instructionStatus, setInstructionStatus] = useState([]); - const [reorderBuffer, setReorderBuffer] = useState([]); const [reservationStations, setReservationStations] = useState([]); const [registerStatus, setRegisterStatus] = useState([]); - function nextCycle() { - console.log("CLOCK") - } - function issueInstruction() { } @@ -32,6 +28,13 @@ export default function Home() { } + function nextCycle() { + setClock(clock + 1); + issueInstruction(); + executeInstruction(); + writeInstruction(); + } + return ( <> @@ -58,7 +61,8 @@ export default function Home() {

Instruction Status

- + Ciclos: {clock} + @@ -96,7 +100,7 @@ export default function Home() { - {reorderBuffer.map((instr, index) => ( + {instructionStatus.map((instr, index) => (
batata batata