Guest User

GC Readcommands (X-HDL conversion)

a guest
Jul 1st, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. always @(DIHSTRB or DIDIR or DIRSTB or Cover_s or IO_READ or cmd)
  2. begin : readcommands
  3.    reg[3:0] i;
  4.    reg latch;
  5.    // <<X-HDL>> : Warning - VHDL and Verilog handle variable initialization differently
  6.    //             The following statement probably requires hand modification.
  7.    i = 0;
  8. // <<X-HDL>> : Warning - VHDL and Verilog handle variable initialization differently
  9. //             The following statement probably requires hand modification.
  10. latch = 1'b0;
  11. if (DIRSTB == 1'b0)
  12. begin
  13.    cmd[0] <= 8'h00 ;
  14.    i = 0;
  15. end
  16. else if (DIHSTRB == 1'b1)
  17. begin
  18.    if (DIDIR == 1'b0)
  19.    begin
  20.       cmd[i] <= DID ;
  21.       if (i < 12)
  22.       begin
  23.          i = i + 1;
  24.       end
  25.    end
  26.    else
  27.    begin
  28.       i = 0;
  29.    end
  30. end
  31. if (DIRSTB == 1'b0)
  32. begin
  33.    LBA_offset <= {32{1'b0}} ;
  34.    latch = 1'b0;
  35. end
  36. else if ({cmd[0], cmd[1], cmd[2], cmd[3]} == 32'hAABBCCDD)
  37. begin
  38.    if (DIDIR == 1'b1 & latch == 1'b0)
  39.    begin
  40.       LBA_offset <= {cmd[8], cmd[9], cmd[10], cmd[11]} ;
  41.       latch = 1'b1;
  42.    end
  43. end
  44. if (DIDIR == 1'b1)
  45. begin
  46.    if (Cover_s == 1'b0)
  47.    begin
  48.       DIERRB <= 1'b1 ;
  49.    end
  50.    else
  51.    begin
  52.       if (cmd[0] == 8'hE0)
  53.       begin
  54.          DIERRB <= 1'b1 ;
  55.       end
  56.       else
  57.       begin
  58.          DIERRB <= 1'b0 ;
  59.          end
  60.       end
  61.    end
  62.    else
  63.    begin
  64.       DIERRB <= 1'b1 ;
  65.    end
  66.    if (DIDIR == 1'b0 & i < 10)
  67.    begin
  68.       DIDSTRB <= 1'b0 ;
  69.    end
  70.    else
  71.    begin
  72.       DIDSTRB <= IO_READ ;
  73.    end
  74. end
Advertisement
Add Comment
Please, Sign In to add comment