Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void datapatchFetch(int clock, int clockA, int IorD, int IRWrite, int PCSrc, int ALUControl, int AluSrcA, int AluSrcB, int PCen, int Reset, int CODIGO)
- {
- Adr = Mux_2_1(Pc,0,IorD);
- Instr = Registrador(clock,clockA,Reset,IRWrite,CODIGO);
- SrcA = Mux_2_1(Pc,0,AluSrcA);
- aluSrcB[0]=AluSrcB>>0&1;
- aluSrcB[1]=AluSrcB>>1&1;
- SrcB = Mux_4_1(0,4,2,3,aluSrcB);
- aluResult = SomaSub(SrcA,SrcB,0,ALUControl);
- AlUOut = Mux_2_1(aluResult,0,PCSrc);
- PcN = RegistradorPC(clock,clockA,Reset,PCen,AlUOut);
- Pc = RegistradorPC(clock,clockA,Reset,PCen,PcN);
- LABEL("Fetch");
- AFFECT(inttostr(cur_vect), "pc", inttostr(Pc));
- AFFECT(inttostr(cur_vect), "clk", inttostr(clock));
- AFFECT(inttostr(cur_vect), "rst", inttostr(Reset));
- AFFECT(inttostr(cur_vect), "pcN", inttoHstr(PcN));
- AFFECT(inttostr(cur_vect), "SrcA", inttoHstr(SrcA));
- AFFECT(inttostr(cur_vect), "SrcB", inttoHstr(SrcB));
- AFFECT(inttostr(cur_vect), "Adr", inttoHstr(Adr));
- AFFECT(inttostr(cur_vect), "Instr", inttoHstr(Instr));
- AFFECT(inttostr(cur_vect), "ALUResult", inttoHstr(aluResult));
- clka = clk;
- clk = !clka;
- cur_vect++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement