Advertisement
AbraaoAllysson

DataPatch

Jun 16th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.35 KB | None | 0 0
  1. void datapatchFetch(int clock, int clockA, int IorD, int IRWrite, int PCSrc, int ALUControl, int AluSrcA, int AluSrcB, int PCen, int Reset, int CODIGO)
  2. {  
  3.  
  4.  
  5.         Adr = Mux_2_1(Pc,0,IorD);
  6.         Instr = Registrador(clock,clockA,Reset,IRWrite,CODIGO);
  7.         SrcA = Mux_2_1(Pc,0,AluSrcA);
  8.         aluSrcB[0]=AluSrcB>>0&1;
  9.         aluSrcB[1]=AluSrcB>>1&1;
  10.         SrcB = Mux_4_1(0,4,2,3,aluSrcB);
  11.         aluResult = SomaSub(SrcA,SrcB,0,ALUControl);
  12.         AlUOut = Mux_2_1(aluResult,0,PCSrc);
  13.         PcN = RegistradorPC(clock,clockA,Reset,PCen,AlUOut);
  14.          Pc = RegistradorPC(clock,clockA,Reset,PCen,PcN);
  15.     LABEL("Fetch");
  16.  
  17.        AFFECT(inttostr(cur_vect), "pc",         inttostr(Pc));
  18.            AFFECT(inttostr(cur_vect), "clk",         inttostr(clock));
  19.             AFFECT(inttostr(cur_vect), "rst",         inttostr(Reset));
  20.             AFFECT(inttostr(cur_vect), "pcN",         inttoHstr(PcN));
  21.             AFFECT(inttostr(cur_vect), "SrcA",         inttoHstr(SrcA));
  22.             AFFECT(inttostr(cur_vect), "SrcB",         inttoHstr(SrcB));
  23.             AFFECT(inttostr(cur_vect), "Adr",         inttoHstr(Adr));
  24.             AFFECT(inttostr(cur_vect), "Instr",         inttoHstr(Instr));
  25.             AFFECT(inttostr(cur_vect), "ALUResult",         inttoHstr(aluResult));
  26.     clka = clk;
  27.     clk = !clka;    
  28.     cur_vect++;
  29.    
  30.    
  31.      
  32.        
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement