Mike Moore / Mbed 2 deprecated Embedded_RTOS_Project

Dependencies:   C12832_lcd USBDevice mbed-rtos mbed mmSPI-2 watchdog

Fork of USB_device_project by Mike Moore

Revision:
7:d1aca9ccbab8
Parent:
3:659ffc90b59e
--- a/mmRTL/reg_16.txt	Sun Sep 01 03:19:59 2013 +0000
+++ b/mmRTL/reg_16.txt	Sun Sep 01 03:48:07 2013 +0000
@@ -1,71 +1,72 @@
 /*----------------------------------copyright---------------------------------*/
-//  licensed for personal and academic use.
-//  commercial use must be approved by the account-holder of
-//  gated.clock@gmail.com
+//      licensed for personal and academic use.
+//      commercial use must be approved by the account-holder of
+//      gated.clock@gmail.com
 /*-----------------------------------module-----------------------------------*/
-    module reg_16
+        module reg_16
         (
-         oParallel,             // parallel-output data.
-         iParallel1,                // parallel-input  data.
-         iParallel0,                // parallel-input  data.
-     iSel,                  // select the parallel input.
-     oSerial,               // serial-output data.
-     iSerial,               // serial-input data.
-     iLoadEnable,               // parallel-load-enable.
-     iShiftEnable,              // serial-shift-enable.
-     iResetN,               // synchronous reset*.
-     iClk                   // module clock.
+         oParallel,                             // parallel-output data.
+         iParallel1,                            // parallel-input  data.
+         iParallel0,                            // parallel-input  data.
+         iSel,                                  // select the parallel input.
+         oSerial,                               // serial-output data.
+         iSerial,                               // serial-input data.
+         iLoadEnable,                           // parallel-load-enable.
+         iShiftEnable,                          // serial-shift-enable.
+         iResetN,                               // synchronous reset*.
+         iClk                                   // module clock.
         );
 /*--------------------------------description-----------------------------------
-    a 16-bit parallel shift-register with 2 selectable input buses.
+        a 16-bit parallel shift-register with 2 selectable input buses.
 -------------------------------------notes--------------------------------------
-    shifting is LSB->MSB.
+        shifting is LSB->MSB.
 ------------------------------------defines-----------------------------------*/
 /*-----------------------------------ports------------------------------------*/
-    output  [15:0]  oParallel;      // parallel-output data.
-    input   [15:0]  iParallel1;     // parallel-input  data.
-    input   [15:0]  iParallel0;     // parallel-input  data.
-    input           iSel;           // select the parallel input.
-    output          oSerial;        // serial-output data.
-    input           iSerial;        // serial-input data.
-    input           iLoadEnable;        // parallel-load-enable.
-    input           iShiftEnable;       // serial-shift-enable.
-    input           iResetN;        // synchronous reset*.
-    input           iClk;           // module clock.
+        output  [15:0]  oParallel;              // parallel-output data.
+        input   [15:0]  iParallel1;             // parallel-input  data.
+        input   [15:0]  iParallel0;             // parallel-input  data.
+        input           iSel;                   // select the parallel input.
+        output          oSerial;                // serial-output data.
+        input           iSerial;                // serial-input data.
+        input           iLoadEnable;            // parallel-load-enable.
+        input           iShiftEnable;           // serial-shift-enable.
+        input           iResetN;                // synchronous reset*.
+        input           iClk;                   // module clock.
 /*-----------------------------------wires------------------------------------*/
-    wire    [15:0]  oParallel;      // parallel-output data.
-    wire    [15:0]  iParallel1;     // parallel-input  data.
-    wire    [15:0]  iParallel0;     // parallel-input  data.
-    wire            iSel;           // select the parallel input.
-    wire    [15:0]  wParallelIn;        // select the parallel input.
-    wire            oSerial;        // serial-output data.
-    wire            iSerial;        // serial-input data.
-    wire            iLoadEnable;        // parallel-load-enable.
-    wire            iShiftEnable;       // serial-shift-enable.
-    wire            iResetN;        // synchronous reset*.
-    wire            iClk;           // module clock.
+        wire    [15:0]  oParallel;              // parallel-output data.
+        wire    [15:0]  iParallel1;             // parallel-input  data.
+        wire    [15:0]  iParallel0;             // parallel-input  data.
+        wire            iSel;                   // select the parallel input.
+        wire    [15:0]  wParallelIn;            // select the parallel input.
+        wire            oSerial;                // serial-output data.
+        wire            iSerial;                // serial-input data.
+        wire            iLoadEnable;            // parallel-load-enable.
+        wire            iShiftEnable;           // serial-shift-enable.
+        wire            iResetN;                // synchronous reset*.
+        wire            iClk;                   // module clock.
 /*---------------------------------registers----------------------------------*/
-        reg     [15:0]  rRegister;      // the register.
+        reg     [15:0]  rRegister;              // the register.
 /*---------------------------------variables----------------------------------*/
 /*---------------------------------parameters---------------------------------*/
 /*-----------------------------------clocks-----------------------------------*/
 /*---------------------------------instances----------------------------------*/
-    mux16x2 U0_mux16x2          // data-input selection.
+        mux16x2 U0_mux16x2                      // data-input selection.
         (
-     .iDin1(iParallel1),
-     .iDin0(iParallel0),
-     .iSel (iSel),
-     .oDout(wParallelIn)
+         .iDin1(iParallel1),
+         .iDin0(iParallel0),
+         .iSel (iSel),
+         .oDout(wParallelIn)
         );
 /*-----------------------------------logic------------------------------------*/
-    always @ (posedge iClk or negedge iResetN)
-    begin
-           if (!iResetN)     rRegister <= 16'h0000;
-      else if (iLoadEnable)  rRegister <= wParallelIn;
-      else if (iShiftEnable) rRegister <= {rRegister[14:0], iSerial};
-      else                   rRegister <= rRegister;
-    end
+        always @ (posedge iClk or negedge iResetN)
+        begin
+               if (!iResetN)     rRegister <= 16'h0000;
+          else if (iLoadEnable)  rRegister <= wParallelIn;
+          else if (iShiftEnable) rRegister <= {rRegister[14:0], iSerial};
+          else                   rRegister <= rRegister;
+        end
 
-    assign oParallel = rRegister;       // propagate parallel-out.
-    assign oSerial   = rRegister[15];   // propagate serial-out.
+        assign oParallel = rRegister;           // propagate parallel-out.
+        assign oSerial   = rRegister[15];       // propagate serial-out.
 /*-------------------------------*/endmodule/*--------------------------------*/
+