#!/usr/bin/env python from arch_classes import * ####################################################################################### # file : arch_info.py # date : june 2018 # author : Alain Greiner # # This file describes the architecture for ALMOS-MKH. ####################################################################################### # This file defines a specific instance of the "tsar_generic_leti" architecture. # It is used to generate the "hard_config.h" file, # used to configure the hardware architecture, and the "arch_info.bin" file, used by # the ALMOS-MK bootloader. # # The constructor prototype format is imposed by the genarch.py application, # and should not be modified. # The default argument values are for the TSARLET 16 cores prototype. # # The "tsar_generic_leti" architecture includes 5 external peripherals located # in cluster[x_size-1][y_size-1]: TTY, IOC, FBF, NIC, PIC. # The upper row (y = y_size-1) does not contain processors or memory. # The "tsar_generic_leti" does not use the IOB component. # It does not use an external ROM, as the preloader code is (pre)loaded # at address 0x0, in the physical memory of cluster[0][0]. # # Two backup peripherals one (one TXT_TTY and one IOC_BDV) are connected # on local interconnect in cluster 0. # # The "constructor" parameters (defined in Makefile) are: # - x_size : number of clusters in a row (from 1 to 16) # - y_size : number of clusters in a column (from 1 to 16) # - nb_cores : number of cores per cluster (from 1 to 4) # - nb_ttys : number of TTY channels (from 1 to 8) # - nb_nics : number of NIC channels (from 1 to 2) # - fbf_width : frame_buffer width = frame_buffer heigth # - ioc_type : can be 'IOC_BDV','IOC_HBA','IOC_SDC','IOC_RDK' # # The others hardware parameters are defined below : # - x_width : number of bits for x coordinate # - y_width : number of bits for y coordinate # - p_width : number of bits for local core index # - paddr_width : number of bits for physical address # - irq_per_proc : number of input IRQs per processor # - io_cxy : IO_cluster identifier # - boot_cxy : boot_cluster identifier # - cache_line : number of bytes in cache line (64 for tsar) # - devices_max : max number of internal devices per cluster ##################################################################################### ######################## def arch( x_size = 2, y_size = 3, nb_cores = 4, nb_ttys = 3, nb__nics = 1, fbf_width = 128, ioc_type = 'IOC_BDV'): ### architecture constants p_width = 2 x_width = 4 y_width = 4 paddr_width = 40 irq_per_proc = 4 # NetBSD constraint io_cxy = ((x_size-1)< 1) and (y_size <= (1 << y_width)) ) assert( (nb_ttys >= 1) and (nb_ttys <= 8) ) assert( (nb_nics >= 1) and (nb_nics <= 2) ) assert( ioc_type in ['IOC_BDV','IOC_HBA','IOC_SDC','IOC_SPI','IOC_RDK'] ) assert( ((boot_cxy >> y_width) < x_size) and ((boot_cxy & ((1<