// Verilated -*- C++ -*-
// DESCRIPTION: Verilator output: Design implementation internals
// See Vj1a.h for the primary calling header

#include "Vj1a.h"
#include "Vj1a__Syms.h"

//==========

VL_CTOR_IMP(Vj1a) {
    Vj1a__Syms* __restrict vlSymsp = __VlSymsp = new Vj1a__Syms(this, name());
    Vj1a* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
    // Reset internal values
    
    // Reset structure values
    _ctor_var_reset();
}

void Vj1a::__Vconfigure(Vj1a__Syms* vlSymsp, bool first) {
    if (false && first) {}  // Prevent unused
    this->__VlSymsp = vlSymsp;
    if (false && this->__VlSymsp) {}  // Prevent unused
    Verilated::timeunit(-12);
    Verilated::timeprecision(-12);
}

Vj1a::~Vj1a() {
    VL_DO_CLEAR(delete __VlSymsp, __VlSymsp = NULL);
}

void Vj1a::_initial__TOP__1(Vj1a__Syms* __restrict vlSymsp) {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vj1a::_initial__TOP__1\n"); );
    Vj1a* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
    // Variables
    WData/*159:0*/ __Vtemp1[5];
    // Body
    vlTOPp->v__DOT___j1__DOT__notreboot = 0U;
    vlTOPp->v__DOT__interrupt = 0U;
    __Vtemp1[0U] = 0x2e686578U;
    __Vtemp1[1U] = 0x6d616765U;
    __Vtemp1[2U] = 0x69636569U;
    __Vtemp1[3U] = 0x696c642fU;
    __Vtemp1[4U] = 0x6275U;
    VL_READMEM_N(true, 16, 8192, 0, VL_CVT_PACK_STR_NW(5, __Vtemp1)
                 , vlTOPp->v__DOT___j1__DOT__mem, 0
                 , ~0ULL);
}

void Vj1a::_settle__TOP__4(Vj1a__Syms* __restrict vlSymsp) {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vj1a::_settle__TOP__4\n"); );
    Vj1a* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
    // Body
    vlTOPp->v__DOT__ticks_plus_1 = (0x1ffffU & ((IData)(1U) 
                                                + (IData)(vlTOPp->v__DOT__ticks)));
    vlTOPp->uart_w = (0xffU & vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]);
    vlTOPp->v__DOT___j1__DOT__minus = (0x1ffffU & ((IData)(1U) 
                                                   + 
                                                   ((0x10000U 
                                                     | (0xffffU 
                                                        & (~ (IData)(vlTOPp->v__DOT___j1__DOT__st0)))) 
                                                    + 
                                                    (0xffffU 
                                                     & vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]))));
    vlTOPp->v__DOT___j1__DOT__umstar = ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                        * (0xffffU 
                                           & vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]));
    vlTOPp->v__DOT___j1__DOT__interrupt = ((IData)(vlTOPp->v__DOT__interrupt) 
                                           & (IData)(vlTOPp->v__DOT___j1__DOT__pc));
    vlTOPp->v__DOT___j1__DOT__pc_plus_2 = (0xffffU 
                                           & (((IData)(vlTOPp->v__DOT___j1__DOT__pc) 
                                               + (2U 
                                                  & ((~ (IData)(vlTOPp->v__DOT___j1__DOT__interrupt)) 
                                                     << 1U))) 
                                              | ((IData)(vlTOPp->v__DOT___j1__DOT__interrupt) 
                                                 << 0xfU)));
    vlTOPp->v__DOT___j1__DOT__fetch = (1U & (((IData)(vlTOPp->v__DOT___j1__DOT__pc) 
                                              >> 0xeU) 
                                             & (~ (IData)(vlTOPp->v__DOT___j1__DOT__interrupt))));
    vlTOPp->v__DOT___j1__DOT__insn = ((IData)(vlTOPp->v__DOT___j1__DOT__interrupt)
                                       ? 0x5fffU : (IData)(vlTOPp->v__DOT___j1__DOT__insn_from_memory));
    vlTOPp->v__DOT___j1__DOT__rspI = ((8U == (8U & 
                                              (((IData)(vlTOPp->v__DOT___j1__DOT__fetch) 
                                                << 3U) 
                                               | (7U 
                                                  & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                     >> 0xdU)))))
                                       ? 3U : ((2U 
                                                == 
                                                (((IData)(vlTOPp->v__DOT___j1__DOT__fetch) 
                                                  << 3U) 
                                                 | (7U 
                                                    & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                       >> 0xdU))))
                                                ? 1U
                                                : (
                                                   (3U 
                                                    == 
                                                    (((IData)(vlTOPp->v__DOT___j1__DOT__fetch) 
                                                      << 3U) 
                                                     | (7U 
                                                        & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                           >> 0xdU))))
                                                    ? 
                                                   (3U 
                                                    & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                       >> 2U))
                                                    : 0U)));
    vlTOPp->v__DOT___j1__DOT__rspN = (0x1fU & ((IData)(vlTOPp->v__DOT___j1__DOT__rsp) 
                                               + ((0x10U 
                                                   & ((IData)(vlTOPp->v__DOT___j1__DOT__rspI) 
                                                      << 3U)) 
                                                  | ((8U 
                                                      & ((IData)(vlTOPp->v__DOT___j1__DOT__rspI) 
                                                         << 2U)) 
                                                     | ((4U 
                                                         & ((IData)(vlTOPp->v__DOT___j1__DOT__rspI) 
                                                            << 1U)) 
                                                        | (IData)(vlTOPp->v__DOT___j1__DOT__rspI))))));
    vlTOPp->v__DOT___j1__DOT__dspI = ((IData)(vlTOPp->v__DOT___j1__DOT__fetch)
                                       ? 1U : ((0x8000U 
                                                & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                ? 1U
                                                : (3U 
                                                   & ((0x4000U 
                                                       & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                       ? 
                                                      ((0x2000U 
                                                        & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                        ? (IData)(vlTOPp->v__DOT___j1__DOT__insn)
                                                        : 0U)
                                                       : 
                                                      ((0x2000U 
                                                        & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                        ? 3U
                                                        : 0U)))));
    vlTOPp->v__DOT___j1__DOT__dspN = (0x1fU & ((IData)(vlTOPp->v__DOT___j1__DOT__dsp) 
                                               + ((0x10U 
                                                   & ((IData)(vlTOPp->v__DOT___j1__DOT__dspI) 
                                                      << 3U)) 
                                                  | ((8U 
                                                      & ((IData)(vlTOPp->v__DOT___j1__DOT__dspI) 
                                                         << 2U)) 
                                                     | ((4U 
                                                         & ((IData)(vlTOPp->v__DOT___j1__DOT__dspI) 
                                                            << 1U)) 
                                                        | (IData)(vlTOPp->v__DOT___j1__DOT__dspI))))));
    vlTOPp->v__DOT___j1__DOT__is_alu = (((IData)(vlTOPp->v__DOT___j1__DOT__notreboot) 
                                         & (~ (IData)(vlTOPp->v__DOT___j1__DOT__fetch))) 
                                        & (3U == (7U 
                                                  & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                     >> 0xdU))));
    vlTOPp->v__DOT___j1__DOT__rstkD = ((0x2000U & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                        ? (IData)(vlTOPp->v__DOT___j1__DOT__st0)
                                        : (IData)(vlTOPp->v__DOT___j1__DOT__pc_plus_2));
    vlTOPp->v__DOT___j1__DOT__st0N = (0xffffU & ((IData)(vlTOPp->v__DOT___j1__DOT__fetch)
                                                  ? (IData)(vlTOPp->v__DOT___j1__DOT__insn)
                                                  : 
                                                 ((0x8000U 
                                                   & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                   ? 
                                                  (0x7fffU 
                                                   & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                   : 
                                                  ((0x4000U 
                                                    & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                    ? 
                                                   ((0x2000U 
                                                     & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                     ? 
                                                    ((0x1000U 
                                                      & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                      ? 
                                                     ((0x800U 
                                                       & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                       ? 
                                                      ((0x400U 
                                                        & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                        ? (IData)(vlTOPp->v__DOT___j1__DOT__st0)
                                                        : 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? (IData)(vlTOPp->v__DOT___j1__DOT__st0)
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? (IData)(vlTOPp->v__DOT___j1__DOT__st0)
                                                          : 
                                                         ((vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[1U] 
                                                           << 0x10U) 
                                                          | (vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U] 
                                                             >> 0x10U)))))
                                                       : 
                                                      ((0x400U 
                                                        & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                        ? 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                          - (IData)(1U))
                                                          : 
                                                         ((IData)(1U) 
                                                          + (IData)(vlTOPp->v__DOT___j1__DOT__st0)))
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         (vlTOPp->v__DOT___j1__DOT__umstar 
                                                          >> 0x10U)
                                                          : vlTOPp->v__DOT___j1__DOT__umstar))
                                                        : 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? (IData)(vlTOPp->v__DOT___j1__DOT__rsp)
                                                          : 
                                                         ((0xfU 
                                                           >= (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                           ? 
                                                          VL_SHIFTRS_III(16,16,16, 
                                                                         (0xffffU 
                                                                          & vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]), (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                           : 
                                                          (- 
                                                           (1U 
                                                            & (vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U] 
                                                               >> 0xfU)))))
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         ((0xfU 
                                                           >= (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                           ? 
                                                          ((0xffffU 
                                                            & vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]) 
                                                           >> (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                           : 0U)
                                                          : 
                                                         ((0xfU 
                                                           >= (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                           ? 
                                                          (vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U] 
                                                           << (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                           : 0U)))))
                                                      : 
                                                     ((0x800U 
                                                       & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                       ? 
                                                      ((0x400U 
                                                        & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                        ? 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         (- (IData)(
                                                                    (1U 
                                                                     & (vlTOPp->v__DOT___j1__DOT__minus 
                                                                        >> 0x10U))))
                                                          : (IData)(vlTOPp->v__DOT___j1__DOT__dsp))
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         ((((((((((2U 
                                                                   & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                   ? (IData)(vlTOPp->v__DOT__porta_out)
                                                                   : 0U) 
                                                                 | ((4U 
                                                                     & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                     ? (IData)(vlTOPp->v__DOT__porta_dir)
                                                                     : 0U)) 
                                                                | ((0x20U 
                                                                    & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                    ? (IData)(vlTOPp->v__DOT__portb_out)
                                                                    : 0U)) 
                                                               | ((0x40U 
                                                                   & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                   ? (IData)(vlTOPp->v__DOT__portb_dir)
                                                                   : 0U)) 
                                                              | ((0x200U 
                                                                  & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                  ? (IData)(vlTOPp->v__DOT__portc_out)
                                                                  : 0U)) 
                                                             | ((0x400U 
                                                                 & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                 ? (IData)(vlTOPp->v__DOT__portc_dir)
                                                                 : 0U)) 
                                                            | ((0x1000U 
                                                                & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                                ? (IData)(vlTOPp->uart0_data)
                                                                : 0U)) 
                                                           | ((0x2000U 
                                                               & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                               ? 
                                                              (((IData)(vlTOPp->uart0_valid) 
                                                                << 1U) 
                                                               | (1U 
                                                                  & (~ (IData)(vlTOPp->uart0_busy))))
                                                               : 0U)) 
                                                          | ((0x4000U 
                                                              & (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                              ? (IData)(vlTOPp->v__DOT__ticks)
                                                              : 0U))
                                                          : vlTOPp->v__DOT___j1__DOT__minus))
                                                        : 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         vlTOPp->v__DOT___j1__DOT__rstack__DOT__stack[0U]
                                                          : 
                                                         (0xfffeU 
                                                          & ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                             << 1U)))
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         ((0x8000U 
                                                           & (IData)(vlTOPp->v__DOT___j1__DOT__st0)) 
                                                          | (0x7fffU 
                                                             & ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                                >> 1U)))
                                                          : 
                                                         (- (IData)(
                                                                    (1U 
                                                                     & ((1U 
                                                                         & (((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                                             >> 0xfU) 
                                                                            ^ 
                                                                            (vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U] 
                                                                             >> 0xfU)))
                                                                         ? 
                                                                        (vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U] 
                                                                         >> 0xfU)
                                                                         : 
                                                                        (vlTOPp->v__DOT___j1__DOT__minus 
                                                                         >> 0x10U))))))))
                                                       : 
                                                      ((0x400U 
                                                        & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                        ? 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         (- (IData)(
                                                                    (0U 
                                                                     == 
                                                                     (0xffffU 
                                                                      & vlTOPp->v__DOT___j1__DOT__minus))))
                                                          : 
                                                         (~ (IData)(vlTOPp->v__DOT___j1__DOT__st0)))
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                          ^ 
                                                          vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U])
                                                          : 
                                                         ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                          | vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U])))
                                                        : 
                                                       ((0x200U 
                                                         & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                         ? 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                          & vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U])
                                                          : 
                                                         ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                                                          + 
                                                          vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]))
                                                         : 
                                                        ((0x100U 
                                                          & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                          ? 
                                                         vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]
                                                          : (IData)(vlTOPp->v__DOT___j1__DOT__st0))))))
                                                     : (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                    : 
                                                   ((0x2000U 
                                                     & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                     ? 
                                                    vlTOPp->v__DOT___j1__DOT__dstack__DOT__stack[0U]
                                                     : (IData)(vlTOPp->v__DOT___j1__DOT__st0))))));
    vlTOPp->v__DOT__io_wr = ((IData)(vlTOPp->v__DOT___j1__DOT__is_alu) 
                             & (4U == (7U & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                             >> 4U))));
    vlTOPp->v__DOT___j1__DOT__eint = ((IData)(vlTOPp->v__DOT___j1__DOT__is_alu) 
                                      & (7U == (7U 
                                                & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                   >> 4U))));
    vlTOPp->v__DOT___j1__DOT__dint = ((IData)(vlTOPp->v__DOT___j1__DOT__is_alu) 
                                      & (6U == (7U 
                                                & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                   >> 4U))));
    vlTOPp->uart0_rd = (((IData)(vlTOPp->v__DOT___j1__DOT__is_alu) 
                         & (5U == (7U & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                         >> 4U)))) 
                        & ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                           >> 0xcU));
    vlTOPp->uart0_wr = ((IData)(vlTOPp->v__DOT__io_wr) 
                        & ((IData)(vlTOPp->v__DOT___j1__DOT__st0) 
                           >> 0xcU));
    vlTOPp->v__DOT___j1__DOT__interrupt_enableN = (1U 
                                                   & (((IData)(vlTOPp->v__DOT___j1__DOT__pc) 
                                                       | (IData)(vlTOPp->v__DOT___j1__DOT__eint)) 
                                                      & (~ 
                                                         ((IData)(vlTOPp->v__DOT___j1__DOT__dint) 
                                                          | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt)))));
    vlTOPp->v__DOT___j1__DOT__interrupt_enableN_return 
        = (1U & ((((vlTOPp->v__DOT___j1__DOT__rstack__DOT__stack[0U] 
                    >> 0xfU) | (IData)(vlTOPp->v__DOT___j1__DOT__pc)) 
                  | (IData)(vlTOPp->v__DOT___j1__DOT__eint)) 
                 & (~ ((IData)(vlTOPp->v__DOT___j1__DOT__dint) 
                       | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt)))));
    vlTOPp->v__DOT___j1__DOT__pcN = ((IData)(vlTOPp->v__DOT___j1__DOT__notreboot)
                                      ? ((IData)(vlTOPp->v__DOT___j1__DOT__fetch)
                                          ? ((0x7ffeU 
                                              & vlTOPp->v__DOT___j1__DOT__rstack__DOT__stack[0U]) 
                                             | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN_return))
                                          : ((0x8000U 
                                              & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                              ? ((0xfffeU 
                                                  & (IData)(vlTOPp->v__DOT___j1__DOT__pc_plus_2)) 
                                                 | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN))
                                              : ((0x4000U 
                                                  & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                  ? 
                                                 ((0x2000U 
                                                   & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                   ? 
                                                  ((0x80U 
                                                    & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                    ? 
                                                   ((0x7ffeU 
                                                     & vlTOPp->v__DOT___j1__DOT__rstack__DOT__stack[0U]) 
                                                    | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN_return))
                                                    : 
                                                   ((0xfffeU 
                                                     & (IData)(vlTOPp->v__DOT___j1__DOT__pc_plus_2)) 
                                                    | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN)))
                                                   : 
                                                  ((0x3ffeU 
                                                    & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                       << 1U)) 
                                                   | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN)))
                                                  : 
                                                 ((0x2000U 
                                                   & (IData)(vlTOPp->v__DOT___j1__DOT__insn))
                                                   ? 
                                                  ((0U 
                                                    != (IData)(vlTOPp->v__DOT___j1__DOT__st0))
                                                    ? 
                                                   ((0xfffeU 
                                                     & (IData)(vlTOPp->v__DOT___j1__DOT__pc_plus_2)) 
                                                    | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN))
                                                    : 
                                                   ((0x3ffeU 
                                                     & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                        << 1U)) 
                                                    | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN)))
                                                   : 
                                                  ((0x3ffeU 
                                                    & ((IData)(vlTOPp->v__DOT___j1__DOT__insn) 
                                                       << 1U)) 
                                                   | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN))))))
                                      : ((IData)(vlTOPp->v__DOT___j1__DOT__fetch)
                                          ? ((0xfffeU 
                                              & (IData)(vlTOPp->v__DOT___j1__DOT__pc_plus_2)) 
                                             | (IData)(vlTOPp->v__DOT___j1__DOT__interrupt_enableN))
                                          : 0U));
}

void Vj1a::_eval_initial(Vj1a__Syms* __restrict vlSymsp) {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vj1a::_eval_initial\n"); );
    Vj1a* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
    // Body
    vlTOPp->_initial__TOP__1(vlSymsp);
    vlTOPp->__Vclklast__TOP__clk = vlTOPp->clk;
    vlTOPp->__Vclklast__TOP__resetq = vlTOPp->resetq;
}

void Vj1a::final() {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vj1a::final\n"); );
    // Variables
    Vj1a__Syms* __restrict vlSymsp = this->__VlSymsp;
    Vj1a* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
}

void Vj1a::_eval_settle(Vj1a__Syms* __restrict vlSymsp) {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vj1a::_eval_settle\n"); );
    Vj1a* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
    // Body
    vlTOPp->_settle__TOP__4(vlSymsp);
}

void Vj1a::_ctor_var_reset() {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vj1a::_ctor_var_reset\n"); );
    // Body
    clk = VL_RAND_RESET_I(1);
    resetq = VL_RAND_RESET_I(1);
    uart0_wr = VL_RAND_RESET_I(1);
    uart0_rd = VL_RAND_RESET_I(1);
    uart_w = VL_RAND_RESET_I(8);
    uart0_busy = VL_RAND_RESET_I(1);
    uart0_valid = VL_RAND_RESET_I(1);
    uart0_data = VL_RAND_RESET_I(8);
    v__DOT__io_wr = VL_RAND_RESET_I(1);
    v__DOT__interrupt = VL_RAND_RESET_I(1);
    v__DOT__ticks = VL_RAND_RESET_I(16);
    v__DOT__ticks_plus_1 = VL_RAND_RESET_I(17);
    v__DOT__porta_dir = VL_RAND_RESET_I(16);
    v__DOT__porta_out = VL_RAND_RESET_I(16);
    v__DOT__portb_dir = VL_RAND_RESET_I(16);
    v__DOT__portb_out = VL_RAND_RESET_I(16);
    v__DOT__portc_dir = VL_RAND_RESET_I(16);
    v__DOT__portc_out = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__insn_from_memory = VL_RAND_RESET_I(16);
    { int __Vi0=0; for (; __Vi0<8192; ++__Vi0) {
            v__DOT___j1__DOT__mem[__Vi0] = VL_RAND_RESET_I(16);
    }}
    v__DOT___j1__DOT__rsp = VL_RAND_RESET_I(5);
    v__DOT___j1__DOT__rspN = VL_RAND_RESET_I(5);
    v__DOT___j1__DOT__dsp = VL_RAND_RESET_I(5);
    v__DOT___j1__DOT__dspN = VL_RAND_RESET_I(5);
    v__DOT___j1__DOT__st0 = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__st0N = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__pc = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__pcN = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__interrupt = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__insn = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__pc_plus_2 = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__fetch = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__rstkD = VL_RAND_RESET_I(16);
    v__DOT___j1__DOT__notreboot = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__dspI = VL_RAND_RESET_I(2);
    v__DOT___j1__DOT__rspI = VL_RAND_RESET_I(2);
    v__DOT___j1__DOT__minus = VL_RAND_RESET_I(17);
    v__DOT___j1__DOT__umstar = VL_RAND_RESET_I(32);
    v__DOT___j1__DOT__is_alu = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__eint = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__dint = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__interrupt_enableN = VL_RAND_RESET_I(1);
    v__DOT___j1__DOT__interrupt_enableN_return = VL_RAND_RESET_I(1);
    VL_RAND_RESET_W(512, v__DOT___j1__DOT__rstack__DOT__stack);
    VL_RAND_RESET_W(512, v__DOT___j1__DOT__dstack__DOT__stack);
}
