Cortex-M0プロセッサから自作してLチカをやってみた

29
Interface Device Laboratory, Kanazawa University http://ifdl.jp/ Cortex-M0 プププププププププププ L ププププププププ プププ ププププ 一() @akita11

Transcript of Cortex-M0プロセッサから自作してLチカをやってみた

CortexM0 L

Cortex-M0L@akita11

Interface Device Laboratory, Kanazawa University http://ifdl.jp/

(980004)(0004)9500: Pb:Sn=60:40LSI

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

mbedL

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

http://deviceplus.jp/people/eagle-eye/

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

LSIMoore

ref: http://www.intel.com/jp/intel/museum/processor/index.htm1.5/G.Moore1965[1]C.Mead[1] G.E.Moore, "Cramming more components onto integrated circuits," IEEE Solid-State Circuit Newsletter, Vol.11, No.5, pp.33-35, 1965.

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

DEC VAX(1976)1MIPS

Cray-1 (1978)100MIPS

MIPSMillion Instruction Per Second

20000MIPS10MIPS100MIPS20MIPS20000MIPS109MFLOPS

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

CPU

Atmel ATtiny

ARMUbiquitousIoT /IoE / CPS / M2MIoT = Internet of ThingsIoE = Internet of EverythingCPS = Cyber Physical SystemM2M = Machine to Machine

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

LEDL

100(555)4150

while(1){ a = 1; sleep(1); a = 0; sleep(1);}PC

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

JISCJIS

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

FPGALSILSITAT

11

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

LSI

https://www.youtube.com/watch?v=A188CYfuKQ0http://www.nicovideo.jp/watch/sm23660093

CMOS 0.18um 5Al2.5mm x 2.5mmRingOSC x 1001T-FF (Div)

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

LLSITOKIOwwwwwwwwww

ICFusionPCB

(FPGA)FPGAFPGALSIFPGAw

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

CADCAD: 1000NDAHowWhy/WhatIoTTrillion Sensor

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

ICMEMSLowPower15

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

LSI: MakeLSI:CADVDEC100SW

http://ifdl.jp/make_lsi

Wgex

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

MakeLSI: 201578201678201589@2201611132IPGithubLinuxIP

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

LSIKinectFPGA

LSI

Depth

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

DIYARM Cortex-M0 DesignStartOKCortex-M0HDL

2016/12/24Interface Device Laboratory, Kanazawa University http://ifdl.jp/

Cortex-M0L 0: 23a0 movs r3, #160 ; 0xa0 2: 05db lsls r3, r3, #23 4: 4c0b ldr r4, [pc, #44] 6: 4f0c ldr r7, [pc, #48] 8: 2201 movs r2, #1 a: 601a str r2, [r3, #0] c: 2500 movs r5, #0 e: 6025 str r5, [r4, #0]10: 2600 movs r6, #012: 3601 adds r6, #114: 42be cmp r6, r716: d1fc bne.n 12 18: 3501 adds r5, #11a: 2dff cmp r5, #255 ; 0xff1c: d1f7 bne.n e 1e: 2200 movs r2, #020: 601a str r2, [r3, #0]22: 25ff movs r5, #255 ; 0xff24: 2600 movs r6, #026: 3601 adds r6, #128: 42be cmp r6, r72a: d1fc bne.n 26 2c: 3d01 subs r5, #12e: 2d00 cmp r5, #030: d1f8 bne.n 24 32: e7e9 b.n 8 34: 5000000438: 0000270f#define GPIO 0x50000000#define PWMDUTY 0x50000001#define WAIT 10000 // 3,000,000=0.3s / 256 -> 10,000

void main(){ volatile unsigned int w; volatile unsigned int d;

while(1){ *(volatile unsigned int *)GPIO = 0x0001; for (d = 0; d < 256; d++){ *(volatile unsigned int *)PWMDUTY = d; for (w = 0; w < WAIT; w++); } *(volatile unsigned int *)GPIO = 0x0000; for (d = 255; d >= 0; d--){ *(volatile unsigned int *)PWMDUTY = d; for (w = 0; w < WAIT; w++); } }}

arm-gcc/gasVerilogHDLmodule imem(clk, addr, data2); input clk; input [31:0] addr; output [31:0] data2; reg [31:0] data, data2; // 0x00000000 - 0x1fffffff : code (0x00000000-0x000000c0: int.vec.) // code memory: little-endian (LSB=1st byte / MSB=2nd byte) wire [31:0] addr2; assign addr2 = {addr[31:2], 2'b00}; always @(addr2) begin case (addr2) 32'h00000000 : data