OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [taskmgr/] [app.s] - Rev 303

Go to most recent revision | Compare with Previous | Blame | View Log

; Copyright (c)2022 Jeremy Seth Henry
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;     * Redistributions of source code must retain the above copyright
;       notice, this list of conditions and the following disclaimer.
;     * Redistributions in binary form must reproduce the above copyright
;       notice, this list of conditions and the following disclaimer in the
;       documentation and/or other materials provided with the distribution,
;       where applicable (as part of a user interface, debugging port, etc.)
;
; THIS SOFTWARE IS PROVIDED BY JEREMY SETH HENRY ``AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL JEREMY SETH HENRY BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
;------------------------------------------------------------------------------
; Sample Task Manager application
;
; Revision History
; Author          Date     Change
;---------------- -------- ---------------------------------------------------
; Seth Henry      7/15/22  Initial Release
;-----------------------------------------------------------------------------
 
;------------------------------------------------------------------------------
; This application requires the following build parameters in the Open8 CPU
;  core to function correctly:
;
; Allow_Stack_Address_Move => true  RSP may relocate/retrieve the SP->R1:R0
; Enable_Auto_Increment    => true  Indexed load/store instructions can use
;                                    auto-increment feature when Rn is odd
;                                    (or Rn++ is specified).
; BRK_Implements_WAI       => true  BRK is interpreted as a WAI
; Enable_NMI               => true  Interrupt 0 is not maskable
; Sequential_Interrupts    => true  ISRs are NOT interruptable
; RTI_Ignores_GP_Flags     => true  RTI restores only lower 4 ALU flags
; Supervisor_Mode          => true  I-bit is restrictive
; Unsigned_Index_Offsets   => true  LDO/SDO treat offset as UNSIGNED
; Rotate_Ignores_Carry     => true  Rotate instrs do not use the carry
; Default_Int_Mask         => x"00" CPU starts with only the NMI active
;
; Further note - NOP is mapped to BRK in the assembler. Do NOT use NOP with
;  the BRK_Implements_WAI enabled, as the NOP will instead trigger WAI.
;------------------------------------------------------------------------------
 
;------------------------------------------------------------------------------
; BNI is used as a BRA (branch always) in user-mode code, since the I-bit
;  should never be set. There are checks in each task's main loop that verify
;  that this bit is cleared, and will panic the system otherwise.
; Similarily, in code running in the supervisor context, the I bit should
;  always be set, potentially allowing BRI to be used as a BRA. Note that this
;  isn't inherently safe, as ISR's are allowed to clear the I bit themselves
;  while user-mode code can't affect the I-bit.
;------------------------------------------------------------------------------
 
;------------------------------------------------------------------------------
; Include block - add all of the other source files here
;
; Note that the order of included files is important due to the way the
;  assembler works. Any constant which is used to derive another constant must
;  be defined first. The exception is creating pointer tables, which occurs on
;  a later pass.
;------------------------------------------------------------------------------
 
.INCLUDE "sys_hw_map.s"      ; System Memory Map (HDL <> ASSY)
.INCLUDE "sys_const.s"       ; System-Wide Constants
.INCLUDE "sys_version.s"     ; System software version
 
.INCLUDE "taskmgr_config.s"  ; Task manager cconfiguration constants
 
.INCLUDE "taskmgr_const.s"   ; Main task scheduler constants
 
.INCLUDE "task_0_const.s"    ; Task 0 Constants & Macros
.INCLUDE "task_1_const.s"    ; Task 1 Constants & Macros
 
.INCLUDE "taskmgr_func.s"    ; Main task scheduler & ISR code
 
.INCLUDE "task_0_func.s"     ; Task 0 Executable
.INCLUDE "task_1_func.s"     ; Task 1 Executable
 
;------------------------------------------------------------------------------

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.