action_decoder.v 5.13 KB
Newer Older
1 2
/*******************************************************************************
 * Module: action_decoder
3 4
 * Date:2016-03-12  
 * Author: auto-generated file, see ahci_fsm_sequence_old.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18
 * Description: Decode sequencer code to 1-hot actions
 *******************************************************************************/

`timescale 1ns/1ps

module action_decoder (
    input        clk,
    input        enable,
    input [10:0] data,
    output reg   PXSERR_DIAG_X,
    output reg   SIRQ_DHR,
    output reg   SIRQ_DP,
    output reg   SIRQ_DS,
    output reg   SIRQ_IF,
19
    output reg   SIRQ_INF,
20 21 22 23 24 25 26 27 28 29
    output reg   SIRQ_PS,
    output reg   SIRQ_SDB,
    output reg   SIRQ_TFE,
    output reg   SIRQ_UF,
    output reg   PFSM_STARTED,
    output reg   PCMD_CR_CLEAR,
    output reg   PCMD_CR_SET,
    output reg   PXCI0_CLEAR,
    output reg   PXSSTS_DET_1,
    output reg   SSTS_DET_OFFLINE,
30
    output reg   SCTL_DET_CLEAR,
31
    output reg   HBA_RST_DONE,
32 33 34 35 36 37 38 39 40 41 42
    output reg   SET_UPDATE_SIG,
    output reg   UPDATE_SIG,
    output reg   UPDATE_ERR_STS,
    output reg   UPDATE_PIO,
    output reg   UPDATE_PRDBC,
    output reg   CLEAR_BSY_DRQ,
    output reg   CLEAR_BSY_SET_DRQ,
    output reg   SET_BSY,
    output reg   SET_STS_7F,
    output reg   SET_STS_80,
    output reg   XFER_CNTR_CLEAR,
43 44
    output reg   DECR_DWCR,
    output reg   DECR_DWCW,
45 46 47 48 49 50 51 52 53
    output reg   FIS_FIRST_FLUSH,
    output reg   CLEAR_CMD_TO_ISSUE,
    output reg   DMA_ABORT,
    output reg   DMA_PRD_IRQ_CLEAR,
    output reg   XMIT_COMRESET,
    output reg   SEND_SYNC_ESC,
    output reg   SET_OFFLINE,
    output reg   R_OK,
    output reg   R_ERR,
54
    output reg   EN_COMINIT,
55 56 57 58 59 60 61 62 63 64 65 66 67
    output reg   FETCH_CMD,
    output reg   ATAPI_XMIT,
    output reg   CFIS_XMIT,
    output reg   DX_XMIT,
    output reg   GET_DATA_FIS,
    output reg   GET_DSFIS,
    output reg   GET_IGNORE,
    output reg   GET_PSFIS,
    output reg   GET_RFIS,
    output reg   GET_SDBFIS,
    output reg   GET_UFIS);

    always @(posedge clk) begin
68 69 70 71 72
        PXSERR_DIAG_X <=      enable && data[ 1] && data[ 0];
        SIRQ_DHR <=           enable && data[ 2] && data[ 0];
        SIRQ_DP <=            enable && data[ 3] && data[ 0];
        SIRQ_DS <=            enable && data[ 4] && data[ 0];
        SIRQ_IF <=            enable && data[ 5] && data[ 0];
73 74 75 76 77 78 79 80 81 82 83 84
        SIRQ_INF <=           enable && data[ 6] && data[ 0];
        SIRQ_PS <=            enable && data[ 7] && data[ 0];
        SIRQ_SDB <=           enable && data[ 8] && data[ 0];
        SIRQ_TFE <=           enable && data[ 9] && data[ 0];
        SIRQ_UF <=            enable && data[10] && data[ 0];
        PFSM_STARTED <=       enable && data[ 2] && data[ 1];
        PCMD_CR_CLEAR <=      enable && data[ 3] && data[ 1];
        PCMD_CR_SET <=        enable && data[ 4] && data[ 1];
        PXCI0_CLEAR <=        enable && data[ 5] && data[ 1];
        PXSSTS_DET_1 <=       enable && data[ 6] && data[ 1];
        SSTS_DET_OFFLINE <=   enable && data[ 7] && data[ 1];
        SCTL_DET_CLEAR <=     enable && data[ 8] && data[ 1];
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
        HBA_RST_DONE <=       enable && data[ 9] && data[ 1];
        SET_UPDATE_SIG <=     enable && data[10] && data[ 1];
        UPDATE_SIG <=         enable && data[ 3] && data[ 2];
        UPDATE_ERR_STS <=     enable && data[ 4] && data[ 2];
        UPDATE_PIO <=         enable && data[ 5] && data[ 2];
        UPDATE_PRDBC <=       enable && data[ 6] && data[ 2];
        CLEAR_BSY_DRQ <=      enable && data[ 7] && data[ 2];
        CLEAR_BSY_SET_DRQ <=  enable && data[ 8] && data[ 2];
        SET_BSY <=            enable && data[ 9] && data[ 2];
        SET_STS_7F <=         enable && data[10] && data[ 2];
        SET_STS_80 <=         enable && data[ 4] && data[ 3];
        XFER_CNTR_CLEAR <=    enable && data[ 5] && data[ 3];
        DECR_DWCR <=          enable && data[ 6] && data[ 3];
        DECR_DWCW <=          enable && data[ 7] && data[ 3];
        FIS_FIRST_FLUSH <=    enable && data[ 8] && data[ 3];
        CLEAR_CMD_TO_ISSUE <= enable && data[ 9] && data[ 3];
        DMA_ABORT <=          enable && data[10] && data[ 3];
        DMA_PRD_IRQ_CLEAR <=  enable && data[ 5] && data[ 4];
        XMIT_COMRESET <=      enable && data[ 6] && data[ 4];
        SEND_SYNC_ESC <=      enable && data[ 7] && data[ 4];
        SET_OFFLINE <=        enable && data[ 8] && data[ 4];
        R_OK <=               enable && data[ 9] && data[ 4];
        R_ERR <=              enable && data[10] && data[ 4];
108 109 110 111 112 113 114 115 116 117 118 119
        EN_COMINIT <=         enable && data[ 6] && data[ 5];
        FETCH_CMD <=          enable && data[ 7] && data[ 5];
        ATAPI_XMIT <=         enable && data[ 8] && data[ 5];
        CFIS_XMIT <=          enable && data[ 9] && data[ 5];
        DX_XMIT <=            enable && data[10] && data[ 5];
        GET_DATA_FIS <=       enable && data[ 7] && data[ 6];
        GET_DSFIS <=          enable && data[ 8] && data[ 6];
        GET_IGNORE <=         enable && data[ 9] && data[ 6];
        GET_PSFIS <=          enable && data[10] && data[ 6];
        GET_RFIS <=           enable && data[ 8] && data[ 7];
        GET_SDBFIS <=         enable && data[ 9] && data[ 7];
        GET_UFIS <=           enable && data[10] && data[ 7];
120 121
    end
endmodule