public void writeback(WritebackArgs args) { if (args.locked == false) { if(args.wb == 2) { registerPC = args.temp; } if (registerWB != -1) registerACC = args.temp; if (args.wb == 1) { memory[(short)args.temp] = registerACC; } } }
public void stepPipeline(FetchArgs fetchArgs,DecodeArgs decodeArgs,ExecuteArgs executeArgs, WritebackArgs writebackArgs) { Thread f = new Thread(() => fetch(fetchArgs)); Thread d = new Thread(() => decode(decodeArgs)); Thread e = new Thread(() => execute(executeArgs)); Thread w = new Thread(() => writeback(writebackArgs)); f.Start(); d.Start(); e.Start(); w.Start(); f.Join(); d.Join(); e.Join(); w.Join(); }