2017年8月27日 星期日

SVE:new set of vector instructions for ARMV8

SVE introduce new set of register
• 32 Z registers, z0, z1, . . . , z31;

Data register multiple of 128 bits up to 2048 bits, support 8-bit bytes, 16-bit halfwords, 32-bit words or 64-bit doublewords.

• 16 P registers, p0, p1, . . . , p15;

Predicate registers hold one bit for each byte available.

• 1 FFR register.

Special predicate register that differs from regular predicate registers by way of being used
implicitly by some dedicated instructions, called first faulting loads.


SVE is more flexible and efficient than the neon instruction . Target on the multi vector computation such as: machine learning and the graphic .



Ref:
     1.A sneak peek into SVE and VLA programming
     2.ARMv8-A SVE technology Hot Chips v12
     3.The ARM Scalable Vector Extension
     4.SIMD Programmingwith Larrabee
     5.Using SVE intrinsics directly in your C code

2017年7月16日 星期日

Competitive Programmer’s Handbook Note.

1.g++ compiler provide __int128_t type 128 bits interger

2.Because the precision errors it's better use subtraction and compare with a small number like(1e-9) than use == to indicate two floating point numbers is equal.

3.page 16 book list

4.Computers and Intractability: A Guide to the Theory of NP-Completeness

5.Kadane’s algorithm.

6.Chapter 7 DP

2017年6月11日 星期日

NANO100:Using data flash without the external 12M HZ crystal.

The data flash start address is set by register so it need a reset after update the address, but in default it will use  the external 12M HZ crystal.It's need to modify the CFOSC .



Modify the \SampleCode\StdDriver\FMC_RW set_data_flash_base() function



Ref:
     Nano100 Series Technical Reference Manual

NANO100:Enable printf use Nu-Link to send massage

1.Add #define DEBUG_ENABLE_SEMIHOST in Library\StdDriver\src\retarget.c .
 

2.Start Keil C IDE debug session and enable the View\Serial Windows\UART #1.


3. Now you can see the printf massage in Keil C IDE.

Ref:
   2. Semihosting

2017年6月7日 星期三

Octave: Modulation Sine Wave use PWM generate look up table for MCU DAC.

Input the target sample frequency ,sample bits and sample frequency.Generate the duty of PWM(percentage).
Code:
Avoid the negative part cause normally MCU didn't have negative voltage output ability.







Ref:
    1.http://bugworkshop.blogspot.tw/2011/04/blog-post_12.html

2017年5月26日 星期五

NANO100: MCU Sine wave generator - using MCU DAC(Look up table with adjustable amplitude)

1.Generate sample point use octave.

2.Create look up table.use const to store look up table in ROM for less latency.

3.Scale to real data function (for 12 bits DAC the max value is 4096)

2017年5月11日 星期四

nrf52 : Add CMSIS_DSP package in Keil 5

1.Open Manage Run-Time Environment and check the DSP














2.Include arm_math.h
  and  path in your project:Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1\CMSIS\Include

3.Add symbol ARM_MATH_CM4 since nrf52832 use Cortex M4F






4.Simple matrix multiplication code

Ref:
    1. CMSIS DSP Software Library







Linux driver: How to enable dynamic debug at booting time for built-in driver.

 Dynamic debug is useful for debug driver, and can be enable by: 1. Mount debug fs #>mount -t debugfs none /sys/kernel/debug 2. Enable dy...