data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v
None: at end of input
1: b'%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:21: Cannot find include file: common.h\n`include "common.h" \n         ^~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new,data/full_repos/permissive/191476706/common.h\n             data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new,data/full_repos/permissive/191476706/common.h.v\n             data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new,data/full_repos/permissive/191476706/common.h.sv\n             common.h\n             common.h.v\n             common.h.sv\n             obj_dir/common.h\n             obj_dir/common.h.v\n             obj_dir/common.h.sv\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:51: Define or directive not defined: \'`NUM_FWD_STATE\'\nparameter NUM_FWD_STATE = `NUM_FWD_STATE;\n                          ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:51: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter NUM_FWD_STATE = `NUM_FWD_STATE;\n                                        ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:53: Define or directive not defined: \'`STATE_FWD_IDLE\'\nparameter STATE_FWD_IDLE                = `STATE_FWD_IDLE;\n                                          ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:53: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_IDLE                = `STATE_FWD_IDLE;\n                                                         ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:54: Define or directive not defined: \'`STATE_FWD_INIT\'\nparameter STATE_FWD_INIT                = `STATE_FWD_INIT;\n                                          ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:54: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_INIT                = `STATE_FWD_INIT;\n                                                         ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:55: Define or directive not defined: \'`STATE_FWD_ATTENTION\'\nparameter STATE_FWD_ATTENTION           = `STATE_FWD_ATTENTION;\n                                          ^~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:55: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_ATTENTION           = `STATE_FWD_ATTENTION;\n                                                              ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:56: Define or directive not defined: \'`STATE_FWD_WEIGHTED_SUM\'\nparameter STATE_FWD_WEIGHTED_SUM        = `STATE_FWD_WEIGHTED_SUM;\n                                          ^~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:56: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_WEIGHTED_SUM        = `STATE_FWD_WEIGHTED_SUM;\n                                                                 ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:57: Define or directive not defined: \'`STATE_FWD_SUM_U_Q\'\nparameter STATE_FWD_SUM_U_Q             = `STATE_FWD_SUM_U_Q;\n                                          ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:57: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_SUM_U_Q             = `STATE_FWD_SUM_U_Q;\n                                                            ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:58: Define or directive not defined: \'`STATE_FWD_FULLY_CONNECTED\'\nparameter STATE_FWD_FULLY_CONNECTED     = `STATE_FWD_FULLY_CONNECTED;\n                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:58: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_FULLY_CONNECTED     = `STATE_FWD_FULLY_CONNECTED;\n                                                                    ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:59: Define or directive not defined: \'`STATE_FWD_SOFT_MAX\'\nparameter STATE_FWD_SOFT_MAX            = `STATE_FWD_SOFT_MAX;\n                                          ^~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:59: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_SOFT_MAX            = `STATE_FWD_SOFT_MAX;\n                                                             ^\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:60: Define or directive not defined: \'`STATE_FWD_END\'\nparameter STATE_FWD_END_FWD             = `STATE_FWD_END;\n                                          ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/191476706/MemN2N.srcs/sources_1/new/memory_network_fwd_path_controller.v:60: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nparameter STATE_FWD_END_FWD             = `STATE_FWD_END;\n                                                        ^\n%Error: Exiting due to 19 error(s)\n'
module memory_network_fwd_path_controller
(

    clk,

    rst_n,

    en_fwd_path,
    done_fwd_path_attention,
    done_fwd_path_weighted_sum,
    done_fwd_path_fc,
    done_fwd_path_sum_u_q,
    done_fwd_path_fc_w_sm,
    done_fwd_path_soft_max,
    done_fwd_path_count_hop,



    en_fwd_path_attention,
    en_fwd_path_weighted_sum,
    en_fwd_path_sum_u_q,
    en_fwd_path_fc_w_sm,
    en_fwd_path_soft_max,
    en_fwd_path_end,
    en_fwd_path_count_hop
);


parameter NUM_FWD_STATE = `NUM_FWD_STATE;

parameter STATE_FWD_IDLE                = `STATE_FWD_IDLE;
parameter STATE_FWD_INIT                = `STATE_FWD_INIT;
parameter STATE_FWD_ATTENTION           = `STATE_FWD_ATTENTION;
parameter STATE_FWD_WEIGHTED_SUM        = `STATE_FWD_WEIGHTED_SUM;
parameter STATE_FWD_SUM_U_Q             = `STATE_FWD_SUM_U_Q;
parameter STATE_FWD_FULLY_CONNECTED     = `STATE_FWD_FULLY_CONNECTED;
parameter STATE_FWD_SOFT_MAX            = `STATE_FWD_SOFT_MAX;
parameter STATE_FWD_END_FWD             = `STATE_FWD_END;


input wire clk;
input wire rst_n;
input wire en_fwd_path;
input wire done_fwd_path_attention;
input wire done_fwd_path_weighted_sum;
input wire done_fwd_path_fc;
input wire done_fwd_path_sum_u_q;
input wire done_fwd_path_fc_w_sm;
input wire done_fwd_path_soft_max;
input wire done_fwd_path_count_hop;


output reg en_fwd_path_attention;
output reg en_fwd_path_weighted_sum;
output reg en_fwd_path_sum_u_q;
output reg en_fwd_path_fc_w_sm;
output reg en_fwd_path_soft_max;
output reg en_fwd_path_end;
output reg en_fwd_path_count_hop;



reg [NUM_FWD_STATE-1:0] state;
reg [NUM_FWD_STATE-1:0] state_next;

reg _en_fwd_path_attention;
reg _en_fwd_path_weighted_sum;
reg _en_fwd_path_sum_u_q;
reg _en_fwd_path_fc_w_sm;
reg _en_fwd_path_soft_max;
reg _en_fwd_path_end;

reg count;
reg _count;

reg _en_fwd_path_count_hop;

reg flag_done_fwd_path_weighted_sum;
reg flag_done_fwd_path_fc;



always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        state <= STATE_FWD_IDLE;
    else
        if(en_fwd_path==1'b0)
            state <= STATE_FWD_IDLE;
        else
            state <= state_next;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_attention <= 1'b0;
    else
        en_fwd_path_attention <= _en_fwd_path_attention;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_weighted_sum <= 1'b0;
    else
        en_fwd_path_weighted_sum <= _en_fwd_path_weighted_sum;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_sum_u_q <= 1'b0;
    else
        en_fwd_path_sum_u_q <= _en_fwd_path_sum_u_q;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_fc_w_sm <= 1'b0;
    else
        en_fwd_path_fc_w_sm <= _en_fwd_path_fc_w_sm;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_soft_max <= 1'b0;
    else
        en_fwd_path_soft_max <= _en_fwd_path_soft_max;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_end <= 1'b0;
    else
        en_fwd_path_end <= _en_fwd_path_end;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        count <= 1'b0;
    else
        count <= _count;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_count_hop <= 1'b0;
    else
        en_fwd_path_count_hop <= _en_fwd_path_count_hop;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        flag_done_fwd_path_weighted_sum = 1'b0;
    else
        if(state==STATE_FWD_SUM_U_Q)
            flag_done_fwd_path_weighted_sum = 1'b0;
        else
            if(flag_done_fwd_path_weighted_sum == 1'b0)
                flag_done_fwd_path_weighted_sum = done_fwd_path_weighted_sum;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        flag_done_fwd_path_fc = 1'b0;
    else
        if(state==STATE_FWD_SUM_U_Q)
            flag_done_fwd_path_fc = 1'b0;
        else
            if(flag_done_fwd_path_fc == 1'b0)
                flag_done_fwd_path_fc = done_fwd_path_fc;
end


always@(*)
begin
    state_next = state;
    _en_fwd_path_attention = 1'b0;
    _en_fwd_path_weighted_sum = 1'b0;
    _en_fwd_path_sum_u_q = 1'b0;
    _en_fwd_path_fc_w_sm = 1'b0;
    _en_fwd_path_soft_max = 1'b0;
    _en_fwd_path_end = 1'b0;
    _count = 1'b1;
    _en_fwd_path_count_hop = 1'b0;

    case(state)
        STATE_FWD_IDLE :
        begin
            state_next = STATE_FWD_INIT;
            _count = 1'b0;
        end
        STATE_FWD_INIT :
        begin
            if(en_fwd_path==1'b1)
            begin
                state_next = STATE_FWD_ATTENTION;
                _count = 1'b0;
            end
        end
        STATE_FWD_ATTENTION :
        begin
            if(done_fwd_path_attention==1'b1)
            begin
                state_next = STATE_FWD_WEIGHTED_SUM;
                _count = 1'b0;
            end

            if(count==1'b0)
            begin
                _en_fwd_path_attention = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_WEIGHTED_SUM :
        begin

            if(flag_done_fwd_path_weighted_sum==1'b1 && flag_done_fwd_path_fc==1'b1)
            begin
                state_next = STATE_FWD_SUM_U_Q;
                _count = 1'b0;
            end

            if(count==1'b0)
            begin
                _en_fwd_path_weighted_sum = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_SUM_U_Q :
        begin
            if(done_fwd_path_sum_u_q==1'b1)
            begin
                if(done_fwd_path_count_hop==1'b1)
                begin
                    state_next = STATE_FWD_FULLY_CONNECTED;
                end
                else
                begin
                    state_next = STATE_FWD_ATTENTION;
                    _en_fwd_path_count_hop = 1'b1;
                end
                _count = 1'b0;
            end
            
            if(count==1'b0)
            begin
                _en_fwd_path_sum_u_q = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_FULLY_CONNECTED :
        begin
            if(done_fwd_path_fc_w_sm==1'b1)
            begin

                state_next = STATE_FWD_END_FWD;
                _count = 1'b0;
            end
            
            if(count==1'b0)
            begin
                _en_fwd_path_fc_w_sm = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_SOFT_MAX :
        begin
            if(done_fwd_path_soft_max==1'b1)
            begin
                state_next = STATE_FWD_END_FWD;
                _count = 1'b0;
            end;
            
            if(count==1'b0)
            begin
                _en_fwd_path_soft_max = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_END_FWD :
        begin
            state_next = STATE_FWD_IDLE;

            if(count==1'b0)
            begin
                _en_fwd_path_end = 1'b1;
                _count = 1'b1;
            end
        end
        default :
        begin
            state_next = STATE_FWD_IDLE;
            _count = 1'b1;
        end
    endcase
end


`ifdef DEBUG



`endif



endmodule
module memory_network_fwd_path_controller
(

    clk,

    rst_n,

    en_fwd_path,
    done_fwd_path_attention,
    done_fwd_path_weighted_sum,
    done_fwd_path_fc,
    done_fwd_path_sum_u_q,
    done_fwd_path_fc_w_sm,
    done_fwd_path_soft_max,
    done_fwd_path_count_hop,



    en_fwd_path_attention,
    en_fwd_path_weighted_sum,
    en_fwd_path_sum_u_q,
    en_fwd_path_fc_w_sm,
    en_fwd_path_soft_max,
    en_fwd_path_end,
    en_fwd_path_count_hop
);



parameter NUM_FWD_STATE = `NUM_FWD_STATE;

parameter STATE_FWD_IDLE                = `STATE_FWD_IDLE;
parameter STATE_FWD_INIT                = `STATE_FWD_INIT;
parameter STATE_FWD_ATTENTION           = `STATE_FWD_ATTENTION;
parameter STATE_FWD_WEIGHTED_SUM        = `STATE_FWD_WEIGHTED_SUM;
parameter STATE_FWD_SUM_U_Q             = `STATE_FWD_SUM_U_Q;
parameter STATE_FWD_FULLY_CONNECTED     = `STATE_FWD_FULLY_CONNECTED;
parameter STATE_FWD_SOFT_MAX            = `STATE_FWD_SOFT_MAX;
parameter STATE_FWD_END_FWD             = `STATE_FWD_END;


input wire clk;
input wire rst_n;
input wire en_fwd_path;
input wire done_fwd_path_attention;
input wire done_fwd_path_weighted_sum;
input wire done_fwd_path_fc;
input wire done_fwd_path_sum_u_q;
input wire done_fwd_path_fc_w_sm;
input wire done_fwd_path_soft_max;
input wire done_fwd_path_count_hop;


output reg en_fwd_path_attention;
output reg en_fwd_path_weighted_sum;
output reg en_fwd_path_sum_u_q;
output reg en_fwd_path_fc_w_sm;
output reg en_fwd_path_soft_max;
output reg en_fwd_path_end;
output reg en_fwd_path_count_hop;



reg [NUM_FWD_STATE-1:0] state;
reg [NUM_FWD_STATE-1:0] state_next;

reg _en_fwd_path_attention;
reg _en_fwd_path_weighted_sum;
reg _en_fwd_path_sum_u_q;
reg _en_fwd_path_fc_w_sm;
reg _en_fwd_path_soft_max;
reg _en_fwd_path_end;

reg count;
reg _count;

reg _en_fwd_path_count_hop;

reg flag_done_fwd_path_weighted_sum;
reg flag_done_fwd_path_fc;



always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        state <= STATE_FWD_IDLE;
    else
        if(en_fwd_path==1'b0)
            state <= STATE_FWD_IDLE;
        else
            state <= state_next;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_attention <= 1'b0;
    else
        en_fwd_path_attention <= _en_fwd_path_attention;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_weighted_sum <= 1'b0;
    else
        en_fwd_path_weighted_sum <= _en_fwd_path_weighted_sum;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_sum_u_q <= 1'b0;
    else
        en_fwd_path_sum_u_q <= _en_fwd_path_sum_u_q;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_fc_w_sm <= 1'b0;
    else
        en_fwd_path_fc_w_sm <= _en_fwd_path_fc_w_sm;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_soft_max <= 1'b0;
    else
        en_fwd_path_soft_max <= _en_fwd_path_soft_max;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_end <= 1'b0;
    else
        en_fwd_path_end <= _en_fwd_path_end;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        count <= 1'b0;
    else
        count <= _count;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        en_fwd_path_count_hop <= 1'b0;
    else
        en_fwd_path_count_hop <= _en_fwd_path_count_hop;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        flag_done_fwd_path_weighted_sum = 1'b0;
    else
        if(state==STATE_FWD_SUM_U_Q)
            flag_done_fwd_path_weighted_sum = 1'b0;
        else
            if(flag_done_fwd_path_weighted_sum == 1'b0)
                flag_done_fwd_path_weighted_sum = done_fwd_path_weighted_sum;
end

always@(posedge clk or negedge rst_n)
begin
    if(rst_n==1'b0)
        flag_done_fwd_path_fc = 1'b0;
    else
        if(state==STATE_FWD_SUM_U_Q)
            flag_done_fwd_path_fc = 1'b0;
        else
            if(flag_done_fwd_path_fc == 1'b0)
                flag_done_fwd_path_fc = done_fwd_path_fc;
end


always@(*)
begin
    state_next = state;
    _en_fwd_path_attention = 1'b0;
    _en_fwd_path_weighted_sum = 1'b0;
    _en_fwd_path_sum_u_q = 1'b0;
    _en_fwd_path_fc_w_sm = 1'b0;
    _en_fwd_path_soft_max = 1'b0;
    _en_fwd_path_end = 1'b0;
    _count = 1'b1;
    _en_fwd_path_count_hop = 1'b0;

    case(state)
        STATE_FWD_IDLE :
        begin
            state_next = STATE_FWD_INIT;
            _count = 1'b0;
        end
        STATE_FWD_INIT :
        begin
            if(en_fwd_path==1'b1)
            begin
                state_next = STATE_FWD_ATTENTION;
                _count = 1'b0;
            end
        end
        STATE_FWD_ATTENTION :
        begin
            if(done_fwd_path_attention==1'b1)
            begin
                state_next = STATE_FWD_WEIGHTED_SUM;
                _count = 1'b0;
            end

            if(count==1'b0)
            begin
                _en_fwd_path_attention = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_WEIGHTED_SUM :
        begin

            if(flag_done_fwd_path_weighted_sum==1'b1 && flag_done_fwd_path_fc==1'b1)
            begin
                state_next = STATE_FWD_SUM_U_Q;
                _count = 1'b0;
            end

            if(count==1'b0)
            begin
                _en_fwd_path_weighted_sum = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_SUM_U_Q :
        begin
            if(done_fwd_path_sum_u_q==1'b1)
            begin
                if(done_fwd_path_count_hop==1'b1)
                begin
                    state_next = STATE_FWD_FULLY_CONNECTED;
                end
                else
                begin
                    state_next = STATE_FWD_ATTENTION;
                    _en_fwd_path_count_hop = 1'b1;
                end
                _count = 1'b0;
            end
            
            if(count==1'b0)
            begin
                _en_fwd_path_sum_u_q = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_FULLY_CONNECTED :
        begin
            if(done_fwd_path_fc_w_sm==1'b1)
            begin

                state_next = STATE_FWD_END_FWD;
                _count = 1'b0;
            end
            
            if(count==1'b0)
            begin
                _en_fwd_path_fc_w_sm = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_SOFT_MAX :
        begin
            if(done_fwd_path_soft_max==1'b1)
            begin
                state_next = STATE_FWD_END_FWD;
                _count = 1'b0;
            end;
            
            if(count==1'b0)
            begin
                _en_fwd_path_soft_max = 1'b1;
                _count = 1'b1;
            end
        end
        STATE_FWD_END_FWD :
        begin
            state_next = STATE_FWD_IDLE;

            if(count==1'b0)
            begin
                _en_fwd_path_end = 1'b1;
                _count = 1'b1;
            end
        end
        default :
        begin
            state_next = STATE_FWD_IDLE;
            _count = 1'b1;
        end
    endcase
end


`ifdef DEBUG



`endif



endmodule