S32K312 DTCM在代码中使用示例

news2024/11/24 18:37:48

        TCM是一种被直接集成在CPU芯片中的高速缓存,TCM又分为ITCM(Instruction TCM)和DTCM(Data TCM)。ITCM是用来存储代码段的,DTCM是用来存储数据的。

        为什么要使用DTCM来存储数据?1)频繁存取的数据,放到DTCM中以节省存取时间;2)存放到DTCM的数据,不会占用RAM的空间。

        在S32 Design Studio for S32 Platform 3.4的IDE中,如何编写代码,能够成功使用这个空间,示例代码:

/*==================================================================================================
*   Project              : RTD AUTOSAR 4.4
*   Platform             : CORTEXM
*   Peripheral           : S32K3XX
*   Dependencies         : none
*
*   Autosar Version      : 4.4.0
*   Autosar Revision     : ASR_REL_4_4_REV_0000
*   Autosar Conf.Variant :
*   SW Version           : 2.0.1
*   Build Version        : S32K3_RTD_2_0_1_D2207_ASR_REL_4_4_REV_0000_20220707
*
*   (c) Copyright 2020 - 2021 NXP Semiconductors
*   All Rights Reserved.
*
*   NXP Confidential. This software is owned or controlled by NXP and may only be
*   used strictly in accordance with the applicable license terms. By expressly
*   accepting such terms or by downloading, installing, activating and/or otherwise
*   using the software, you are agreeing that you have read, and that you agree to
*   comply with and are bound by, such license terms. If you do not agree to be
*   bound by the applicable license terms, then you may not retain, install,
*   activate or otherwise use the software.
==================================================================================================*/

/**
*   @file main.c
*
*   @addtogroup main_module main module documentation
*   @{
*/

/* Including necessary configuration files. */
#include "Mcal.h"

volatile int exit_code = 0;
/* User includes */

void TestDelay(uint32 delay);
void __attribute__ ((section(".itcm0_code"))) Test_function_in_ITCM(void);


void TestDelay(uint32 delay)
{
    static volatile uint32 DelayTimer = 0;
    while(DelayTimer<delay)
    {
        DelayTimer++;
    }
    DelayTimer=0;
}

void __attribute__ ((section(".itcm0_code"))) Test_function_in_ITCM(void)
{
	TestDelay(4800000);
}

uint32_t __attribute__ ((section(".dtcm0_data"))) myDtcm0Data[1024] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
uint32_t __attribute__ ((section(".dtcm0_data"))) myDtcm0Data1[1024] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

/*!
  \brief The main function for the project.
  \details The startup initialization sequence is the following:
 * - startup asm routine
 * - main()
*/
int main(void)
{
    /* Write your code here */
	uint8 count = 0U;
	for(count = 0; count < 10; count++)
	{
//		Test_function_in_ITCM();
//		Test_function_in_ITCM();
		myDtcm0Data[count] = myDtcm0Data1[count] + 10;
	}
    for(;;)
    {
        if(exit_code != 0)
        {
            break;
        }
    }
    return exit_code;
}

/** @} */

当然,上面的只是一部分示例代码,如果不进行其他文件的配置,是不能成功使用的。需要编辑2个配置文件,分别是startup_cm7.s和linker_flash_s32k344.ld,这两个配置文件配置正确,就可以正常使用DTCM了。

linker_flash_s32k344.ld文件编辑注意事项如图红框所示:

linker_flash_s32k344.ld原始文件供参考:

/*==================================================================================================
*   Project              : RTD AUTOSAR 4.4
*   Platform             : CORTEXM
*   Peripheral           : 
*   Dependencies         : none
*
*   Autosar Version      : 4.4.0
*   Autosar Revision     : ASR_REL_4_4_REV_0000
*   Autosar Conf.Variant :
*   SW Version           : 2.0.1
*   Build Version        : S32K3_RTD_2_0_1_D2207_ASR_REL_4_4_REV_0000_20220707
*
*   (c) Copyright 2020 - 2022 NXP Semiconductors
*   All Rights Reserved.
*
*   NXP Confidential. This software is owned or controlled by NXP and may only be
*   used strictly in accordance with the applicable license terms. By expressly
*   accepting such terms or by downloading, installing, activating and/or otherwise
*   using the software, you are agreeing that you have read, and that you agree to
*   comply with and are bound by, such license terms. If you do not agree to be
*   bound by the applicable license terms, then you may not retain, install,
*   activate or otherwise use the software.
==================================================================================================*/
/*
* GCC Linker Command File:
* 0x00400000    0x001F3FFF  2047999 Program Flash (last 64K sBAF)
* 0x10000000    0x1003FFFF  262144  Data Flash (last 32K HSE_NVM)
* 0x20400000    0x20408000  32768   Standby RAM_0 (32K)
* 0x20400000    0x20417FFF  98304   SRAM_0 (96KB)
* Last 48 KB of SRAM_1 reserved by HSE Firmware
* Last 176 KB of CODE_FLASH_3 reserved by HSE Firmware
* Last 128 KB of DATA_FLASH reserved by HSE Firmware (not supported in this linker file)
*/
HEAP_SIZE  = DEFINED(__heap_size__)  ? __heap_size__  : 0x00002000;

ENTRY(Reset_Handler)

MEMORY 
{         
    int_flash               : ORIGIN = 0x00400000, LENGTH = 0x001D4000    /* 2048K - 176K (sBAF + HSE)*/
    int_itcm                : ORIGIN = 0x00000000, LENGTH = 0x00008000    /* 32K */
    int_dtcm                : ORIGIN = 0x20000000, LENGTH = 0x00010000    /* 64K */
    int_sram                : ORIGIN = 0x20400000, LENGTH = 0x00006F00    /* 27 KB */
    int_sram_fls_rsv        : ORIGIN = 0x20406F00, LENGTH = 0x00000100    
    int_sram_stack_c0       : ORIGIN = 0x20407000, LENGTH = 0x00001000    
    int_sram_no_cacheable   : ORIGIN = 0x20408000, LENGTH = 0x00007F00    /* 32kb , needs to include int_results  */
    int_sram_results        : ORIGIN = 0x2040FF00, LENGTH = 0x00000100    
    int_sram_shareable      : ORIGIN = 0x20410000, LENGTH = 0x00008000    /* 32KB */
    ram_rsvd2               : ORIGIN = 0x20418000, LENGTH = 0             /* End of SRAM */
}


SECTIONS
{
    
    .flash :
    {
    	KEEP(*(.boot_header))
        . = ALIGN(4096);
        __text_start = .;
        __interrupts_rom_start = .;
        KEEP(*(.intc_vector))    
        . = ALIGN(4);
        __interrupts_rom_end = .;
        KEEP(*(.core_loop)) 
        . = ALIGN(4);
        *(.startup) 
        . = ALIGN(4);
        *(.systeminit) 
        . = ALIGN(4);
        *(.text.startup) 
        . = ALIGN(4);
        *(.text)
        *(.text*) 
        . = ALIGN(4);
        *(.mcal_text) 
        . = ALIGN(4);
        *(.acmcu_code_rom)
        . = ALIGN(4);
        __acfls_code_rom_start = .;
        *(.acfls_code_rom) 
        . = ALIGN(4);
        __acfls_code_rom_end = .;
        KEEP(*(.init))
        . = ALIGN(4);
        KEEP(*(.fini)) 
         
        . = ALIGN(4);
        *(.rodata)  
        *(.rodata*)  
        . = ALIGN(4);
        *(.mcal_const_cfg)  
        . = ALIGN(4);
        *(.mcal_const)  
        . = ALIGN(4);
        __init_table = .;
        KEEP(*(.init_table))  
        . = ALIGN(4);
        __zero_table = .;
        KEEP(*(.zero_table))
    } > int_flash

    . = ALIGN(4);
    __text_end = .;
    __sram_data_rom = __text_end;
    
    .sram_data : AT(__sram_data_rom)
    {
        . = ALIGN(4);
        __sram_data_begin__ = .;
        . = ALIGN(4);
        *(.ramcode)    
        . = ALIGN(4);
        *(.data)  
        *(.data*)
        . = ALIGN(4);
        *(.mcal_data)
        . = ALIGN(4);
        __sram_data_end__ = .;
    } > int_sram

    __sram_data_rom_end = __sram_data_rom + (__sram_data_end__ - __sram_data_begin__);
    .sram_bss (NOLOAD) :
    {
        . = ALIGN(16);
        __sram_bss_start = .;
        *(.bss)
        *(.bss*)
        . = ALIGN(16);
        *(.mcal_bss)
        . = ALIGN(4);
        __sram_bss_end = .;
    } > int_sram
    /* heap section */        
    .heap (NOLOAD):
    {
    	. += ALIGN(4);
	    _end = .;
	    end = .;
        _heap_start = .;
        . += HEAP_SIZE;
        _heap_end = .;
    } > int_sram
    
    
    .acfls_code_ram :
    {
        acfls_code_ram_start  = .;
        *(.acfls_code_ram)
        acfls_code_ram_stop   = .;
    } > int_sram_fls_rsv

    __non_cacheable_data_rom = __sram_data_rom_end;

    .non_cacheable_data : AT(__non_cacheable_data_rom)
    {
        . = ALIGN(4);
        __non_cacheable_data_start__ = .;
        . = ALIGN(4096);
        __interrupts_ram_start = .;
        . += __interrupts_rom_end - __interrupts_rom_start;    
        . = ALIGN(4);
        __interrupts_ram_end = .;
        *(.mcal_data_no_cacheable)        
        . = ALIGN(4);
        *(.mcal_const_no_cacheable)      
        . = ALIGN(4);
        HSE_LOOP_ADDR = .;
        LONG(0x0);
        __non_cacheable_data_end__ = .;  
    } > int_sram_no_cacheable

	int_results (NOLOAD):
	{
		. = ALIGN(4);
        KEEP(*(.int_results))  
        . += 0x100;
	} > int_sram_results
    
    __non_cacheable_data_rom_end = __non_cacheable_data_rom + (__non_cacheable_data_end__ - __non_cacheable_data_start__);

    .non_cacheable_bss (NOLOAD) :
    {  
        . = ALIGN(16);
        __non_cacheable_bss_start = .;
        *(.mcal_bss_no_cacheable)      
        . = ALIGN(4);
        __non_cacheable_bss_end = .;       
    } > int_sram_no_cacheable
    
    __shareable_data_rom = __non_cacheable_data_rom_end;

    .shareable_data : AT(__shareable_data_rom)
    {
        . = ALIGN(4);
        __shareable_data_start__ = .;
        KEEP(*(.mcal_shared_data)) 
        . = ALIGN(4);
        __shareable_data_end__ = .;  
    } > int_sram_shareable

    __shareable_data_rom_end = __shareable_data_rom + (__shareable_data_end__ - __shareable_data_start__);

    .shareable_bss (NOLOAD) :
    {  
        . = ALIGN(16);
        __shareable_bss_start = .;
        *(.mcal_shared_bss)      
        . = ALIGN(4);
        __shareable_bss_end = .;       
    } > int_sram_shareable
    
    __itcm0_code_rom = __shareable_data_rom_end;

    .itcm0_code : AT(__itcm0_code_rom)
    {
        . = ALIGN(4);
        __itcm0_code_start__ = .;
        KEEP(*(.itcm0_code)) 
        . = ALIGN(4);
        __itcm0_code_end__ = .;  
    } > int_itcm

    __itcm0_code_rom_end = __itcm0_code_rom + (__itcm0_code_end__ - __itcm0_code_start__);
    
    __dtcm0_data_rom = __itcm0_code_rom_end;

    .dtcm0_data : AT(__dtcm0_data_rom)
    {
        . = ALIGN(4);
        __dtcm0_data_start__ = .;
        KEEP(*(.dtcm0_data)) 
        . = ALIGN(4);
        __dtcm0_data_end__ = .;  
    } > int_dtcm

    __dtcm0_data_rom_end = __dtcm0_data_rom + (__dtcm0_data_end__ - __dtcm0_data_start__);

    __Stack_end_c0           = ORIGIN(int_sram_stack_c0);
    __Stack_start_c0         = ORIGIN(int_sram_stack_c0) + LENGTH(int_sram_stack_c0);
    __Stack_end_c1           = 0;
    __Stack_start_c1         = 0;

    __INT_SRAM_START         = ORIGIN(int_sram);
    __INT_SRAM_END           = ORIGIN(ram_rsvd2);
    
    __INT_ITCM_START         = ORIGIN(int_itcm);
    __INT_ITCM_END           = ORIGIN(int_itcm) + LENGTH(int_itcm);
    
    __INT_DTCM_START         = ORIGIN(int_dtcm);
    __INT_DTCM_END           = ORIGIN(int_dtcm) + LENGTH(int_dtcm);
    
    __RAM_SHAREABLE_START    = ORIGIN(int_sram_shareable);
    __RAM_SHAREABLE_END      = ORIGIN(ram_rsvd2)-1;
    __RAM_SHAREABLE_SIZE     = 0xF;
    __ROM_SHAREABLE_START    = __shareable_data_rom;
    __ROM_SHAREABLE_END      = __shareable_data_rom_end;
    __RAM_NO_CACHEABLE_START = ORIGIN(int_sram_no_cacheable);
    __RAM_NO_CACHEABLE_END   = ORIGIN(int_sram_shareable)-1;
    __RAM_NO_CACHEABLE_SIZE  = 0xF;  /* 32kbyte in power of 2 */
    __ROM_NO_CACHEABLE_START = __non_cacheable_data_rom;
    __ROM_NO_CACHEABLE_END   = __non_cacheable_data_rom_end;
    __RAM_CACHEABLE_START    = ORIGIN(int_sram);
    __RAM_CACHEABLE_END      = ORIGIN(int_sram_no_cacheable)-1;
    __RAM_CACHEABLE_SIZE     = 0xF;  /* 32kbyte in power of 2 */
    __ROM_CACHEABLE_START    = __sram_data_rom;
    __ROM_CACHEABLE_END      = __sram_data_rom_end;
    __ROM_CODE_START         = ORIGIN(int_flash);
    __ROM_DATA_START         = 0x10000000;
    __RAM_ITCM0_CODE_START   = __itcm0_code_start__;
    __ROM_ITCM0_CODE_START   = __itcm0_code_rom;
    __ROM_ITCM0_CODE_END     = __itcm0_code_rom_end;
    __RAM_DTCM0_DATA_START   = __dtcm0_data_start__;
    __ROM_DTCM0_DATA_START   = __dtcm0_data_rom;
    __ROM_DTCM0_DATA_END     = __dtcm0_data_rom_end;
    
    __BSS_SRAM_START         = __sram_bss_start;
    __BSS_SRAM_END           = __sram_bss_end;
    __BSS_SRAM_SIZE          = __sram_bss_end - __sram_bss_start;
    
    __BSS_SRAM_NC_START      = __non_cacheable_bss_start;
    __BSS_SRAM_NC_SIZE       = __non_cacheable_bss_end - __non_cacheable_bss_start;
    __BSS_SRAM_NC_END        = __non_cacheable_bss_end;

    __BSS_SRAM_SH_START      = __shareable_bss_start;
    __BSS_SRAM_SH_SIZE       = __shareable_bss_end - __shareable_bss_start;
    __BSS_SRAM_SH_END        = __shareable_bss_end;

    __RAM_INTERRUPT_START    = __interrupts_ram_start;
    __ROM_INTERRUPT_START    = __interrupts_rom_start;
    __ROM_INTERRUPT_END      = __interrupts_rom_end;

    __INIT_TABLE             = __init_table;
    __ZERO_TABLE             = __zero_table;
    
    __RAM_INIT               = 1;
    __ITCM_INIT              = 1;
    __DTCM_INIT              = 1;
    
    Fls_ACEraseRomStart         = __acfls_code_rom_start;
    Fls_ACEraseRomEnd           = __acfls_code_rom_end;
    Fls_ACEraseSize             = (__acfls_code_rom_end - __acfls_code_rom_start) / 4; /* Copy 4 bytes at a time*/

    Fls_ACWriteRomStart         = __acfls_code_rom_start;
    Fls_ACWriteRomEnd           = __acfls_code_rom_end;
    Fls_ACWriteSize             = (__acfls_code_rom_end - __acfls_code_rom_start) / 4; /* Copy 4 bytes at a time*/
    
    _ERASE_FUNC_ADDRESS_        = ADDR(.acfls_code_ram);
    _WRITE_FUNC_ADDRESS_        = ADDR(.acfls_code_ram);
    
    __ENTRY_VTABLE              = __ROM_INTERRUPT_START;
	
    __CORE0_VTOR             = __interrupts_rom_start;
    __CORE1_VTOR             = __interrupts_rom_start;

}

startup_cm7.s文件修改注意事项如图红框所示:

最后,通过debug单步调试,可以看到myDtcm0Data数组中已经有初始化值了,从0到10。而且myDtcm0Data的地址是0x20001000,在ld文件对应的地址范围内。

myDtcm0Data1的数据也有初始化值了,从0到10。myDtcm0Data1的地址是0x20000000,在ld文件对应的地址范围内。

到此,就可以成功使用DTCM了。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1163043.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

APP攻防--签名组件权限

前言 上文说到了反编译的方式&#xff0c;这期就深入到APP内部&#xff0c;即客户端安全。 安装包签名 在Android操作系统中&#xff0c;每个应用程序&#xff08;APP&#xff09;安装包&#xff08;APK&#xff09;都必须经过数字签名&#xff0c;以确保应用的完整性和来源…

【从删库到跑路】详解MySQL数据库的视图以及相关操作

&#x1f38a;专栏【MySQL】 &#x1f354;喜欢的诗句&#xff1a;更喜岷山千里雪 三军过后尽开颜。 &#x1f386;音乐分享【如愿】 &#x1f970;欢迎并且感谢大家指出小吉的问题 文章目录 &#x1f384;视图介绍&#x1f384;视图特点&#x1f33a;基本操作⭐创建视图⭐查询…

java--对象在计算机中的执行原理

1.多个对象在计算机中的执行原理 解析&#xff1a;首先是先回扫描(scan)class文件&#xff0c;加载进入方法区&#xff0c;然后在扫描文件内部的main方法&#xff0c;扫描后会在栈内存中创造一个main空间&#xff0c;然后继续扫描第一节创造对象的话&#xff0c;然后就会在方法…

金融帝国实验室(Capitalism Lab)即将隆重推出『出口公司』功能

『金融帝国实验室』&#xff08;Capitalism Lab&#xff09;即将迎来v10.0.00重大版本更新&#xff01; 并将为〔实验性DLC〕引入全新【出口公司】功能。 ————————————— 【出口公司】允许您&#xff1a; >通过出口客户搜索查找全球买家&#xff1b; >建立…

企业如何防止文件泄密

企业如何防止文件泄密 安企神数据防泄密系统下载使用 在互联网飞速发展的时代&#xff0c;数据成为大多数公司的重要组成部分&#xff0c;数据安全则是企业的安身立命之本&#xff0c;管理者应当重视保密措施。企业应当采取一系列措施来防止文件泄密&#xff0c;以确保敏感信…

消息中间件——RabbitMQ(二)各大主流消息中间件综合对比介绍!

前言 消息队列已经逐渐成为企业IT系统内部通信的核心手段。它具有低耦合、可靠投递、广播、流量控制、最终一致性等一系列功能&#xff0c;成为异步RPC的主要手段之一。当今市面上有很多主流的消息中间件&#xff0c;如老牌的ActiveMQ、RabbitMQ&#xff0c;炙手可热的Kafka&a…

Ambari-2.7.4和HDP-3.1.4安装

提示&#xff1a;Ambari-2.7.4和HDP-3.1.4安装 Hadoop集群安装目录 一、所需机器二、系统环境配置2.1准备2.2配置5台主机的SSH免密登录&#xff08;所有机器 &#xff09;2.3同步时钟&#xff0c;开启NTP服务&#xff08;所有机器&#xff09;2.4每台节点里配置FQDN&#xff0c…

10个技巧,确保项目团队按时完成任务

作为项目经理&#xff0c;你的绩效取决于有效的截止日期管理&#xff0c;以便按时交付项目。 然而&#xff0c;我们都知道&#xff0c;项目很少会按计划进行&#xff0c;因此&#xff0c;在时间和截止日期方面&#xff0c;能够驾驭项目中出现的众多不确定因素非常重要。本文将…

指针运算笔试题解析(1)

指针运算笔试题解析 题目一解析 题目二解析 题目三解析 题目四解析 题目五解析 题目一 #include<stdio.h> int main() {int a[5]{1,2,3,4,5};int *p(int*)(&a1);printf("%d %d",*(a1),*(p-1));return 0; } 答案&#xff1a;2 5 解析 int a[5]{1,2,3,4,5…

vscode1.83远程连接失败

&#xff08;报错信息忘记截图了 总之卡在vscode-server.tar.gz的下载那里&#xff0c;一直404&#xff0c;删了C:\Users\Administrator\.ssh\known_hosts也不管用 看了一下vscode1.83的commitID为a6606b6ca720bca780c2d3c9d4cc3966ff2eca12&#xff0c;网友说可以通过以下网…

XUnit单元测试(实用项目)——看完不会用你打我

一、简介 xUnit.net 是针对 .NET 的免费、开源单元测试框架&#xff0c;可并行测试、数据驱动测试。测试项目需要同时引用 xUnit和被测试项目&#xff0c;从而对其进行测试。测试编写完成后&#xff0c;用 Test Runner 来测试项目&#xff0c;Test Runner 可以读取测试代码&am…

最新版付费进群源码带自动定位和分销以及分站功能完整版无加密

简介 看到别人发那些不是挂羊头卖狗肉&#xff0c;要么就是发的缺少文件引流的。非常滴恶心 这源码是我付费花钱买的免费分享给大家&#xff0c;功能完整。而且无加密 功能&#xff1a;新建分销会员&#xff0c;设置账号密码&#xff0c;收款方式等 说明&#xff1a; 分站…

opengl基础笔记1

1、opengl运行模式及opengl规范 运行模式&#xff1a;核心模式与立即渲染模式&#xff08;弃用&#xff09; 由于OpenGL的大多数实现都是由显卡厂商编写的&#xff0c;当产生一个bug时通常可以通过升级显卡驱动来解决。这些驱动会包括你的显卡能支持的最新版本的OpenGL&#xf…

算法题:99.恢复二叉搜索树

&#xff08;为不影响大家的观感&#xff0c;完整题目附在了最后&#xff09; 二叉搜索树的定义 二叉搜索树&#xff08;BST&#xff0c;Binary Search Tree&#xff09;&#xff0c;也称二叉排序树或二叉查找树。 二叉搜索树&#xff1a;一棵二叉树&#xff0c;可以为空&…

二叉树题目:在二叉树中增加一行

文章目录 题目标题和出处难度题目描述要求示例数据范围 解法一思路和算法代码复杂度分析 解法二思路和算法代码复杂度分析 题目 标题和出处 标题&#xff1a;在二叉树中增加一行 出处&#xff1a;623. 在二叉树中增加一行 难度 5 级 题目描述 要求 给定一个二叉树的根结…

WiFi模块的环境可持续性:可再生能源、材料创新与碳足迹管理

随着数字化时代的到来&#xff0c;WiFi模块已经成为我们日常生活和工作中不可或缺的一部分。然而&#xff0c;这种便利也伴随着对环境的一定影响。本文将深入研究WiFi模块在环境可持续性方面的挑战和机遇&#xff0c;重点关注可再生能源的应用、材料创新以及碳足迹管理。 1. 可…

NB-IoT水表和LoRa水表有什么区别?

在众多物联网技术中&#xff0c;NB-IoT和LoRa脱颖而出&#xff0c;广泛应用于智能水表的制造。那么&#xff0c;这两种水表究竟有何区别呢&#xff1f;下面&#xff0c;小编来为大家详细的讲下NB-IoT和LoRa这两者的工作原理以及两者的区别之处&#xff0c;一起来看下吧&#xf…

图片路径名动态生成

写成这样也可以 :src"./src/assets/ScreenLeft/btn${isShowLeft ? Show : Hide}.png"为了节省开销&#xff0c;这种小图标&#xff0c;可以用i标签 const imgUrl ref("icon1");<iclass"w-50px h-50px":style"{backgroundImage: url(./…

老师们看过来,成绩发布原来可以这么简单

成绩发布不再让你头大&#xff01;不再需要每次都要手动查找学生成绩&#xff0c;浪费宝贵的休息时间!现在&#xff0c;只需要掌握一些小技巧&#xff0c;就能轻松实现学生自助查询成绩&#xff01; 引入数据库管理软件 可以引入一些数据库管理软件&#xff0c;例如MySQL、Pos…

Scala 泛型编程

1. 泛型 Scala 支持类型参数化&#xff0c;使得我们能够编写泛型程序。 1.1 泛型类 Java 中使用 <> 符号来包含定义的类型参数&#xff0c;Scala 则使用 []。 class Pair[T, S](val first: T, val second: S) {override def toString: String first ":" sec…