'embeded'에 해당되는 글 1512건

  1. 2023.08.31 missed: not vectorized: relevant stmt not supported:
  2. 2023.08.23 aarch64 vector register
  3. 2023.08.09 arm vsub operator
  4. 2023.08.07 ARM NEON SLP
  5. 2023.07.28 잘가 tms320 ㅠㅠ
  6. 2023.07.24 라즈베리 파이 openOCD jtag?
  7. 2023.07.22 ftdi jtag
  8. 2023.07.21 cortex a9 ptm
  9. 2023.07.21 xilinx zynq jtag 2
  10. 2023.07.19 stm32 reset 없이 JTAG 붙이기
embeded/i.mx 8m plus2023. 8. 31. 10:33

cortex-a53 에서 neon 으로 실수 나누기를 하는데

이상하게 적용이 안되서 확인중

 

소스는 아래 한줄인데 stdev_val은 앞서 단계에서 계산한 변수라 그런가

scope 문제로 인해서 안될 것 같진 않은데

int tempval = (int)((value - abs_avg) / (int)stdev_val);

 

아무튼 에러는 아래와 같이. 332 라인은 for() 337은 위의 소스인데

modules/m7_adc.c:332:27: missed: couldn't vectorize loop
modules/m7_adc.c:337:11: missed: not vectorized: relevant stmt not supported: tempval_168 = _73 / stdev_val_162;

 

얘 되고

int tempval = (int)((double)(value - abs_avg) / (double)stdev_val);

 

얘도 된다.

int tempval = (int)((value - abs_avg) / (double)stdev_val);

 

나누기 연산에서 피 연산자가 int 형이면 안되고, double 형이면 된다라..

아래 문서를 참조해도 딱히 divide 연산자에 대한 이야기는 없고

cortex-a53이라면.. cortex-a9도 아니고.. hardware divider가 없을리도 없을 것 같은데.

아무튼.. 의외의 점이라면 예제코드 중에 곱셈은 있어도 나눗셈은 없다. (에이 설마..)

[링크 : https://gcc.gnu.org/projects/tree-ssa/vectorization.html]

'embeded > i.mx 8m plus' 카테고리의 다른 글

sounddevice on arm i.mx8 evk  (0) 2024.05.14
NXP i.mx8mp LF_v6.1.55-2.2.0 테스트  (0) 2023.12.21
nxp i.mx8mp win iot part 2  (0) 2023.05.26
nxp i.mx8mp win iot  (0) 2023.05.26
rpmsg-lite  (0) 2023.03.23
Posted by 구차니
embeded/ARM2023. 8. 23. 18:57

armv7에 비해서 armv8(aarch64)의 simd 통합은 더 강해졌는지

명령어가 사라지고 src와 dst의 레지스터에 vertor와 scalar가 사용된다.

 

예전에 이상하다 싶어서 찾아두기만 한 녀석인데

add 명령은 그대로이고 v0 이라는 vertor 레지스터에 4s, 4개의 32bit 변수형(아마도 signed int?)을

한번에 더하는 계산을 하라고 시킨다.

dst, src1, oper 일테니까 v0.4s = v0.4s + v1.4s 로 보면 될 듯.

 

add     v0.4s, v0.4s, v1.4s

 

2021.06.30 - [embeded/raspberry pi] - aarch, armv8 asimd build (neon)

 

scalar

평범(?)한 Q / D / S / H / B

[링크 : https://developer.arm.com/documentation/den0024/a/ARMv8-Registers/NEON-and-floating-point-registers/Scalar-register-sizes]

 

vector

D가 아마도 double형 같은 64bit(8byte) 변수일텐데

그것 조차도 한번에 2개씩 연산이 가능한 레지스터라니..

[링크 : https://developer.arm.com/documentation/den0024/a/ARMv8-Registers/NEON-and-floating-point-registers/Vector-register-sizes]

'embeded > ARM' 카테고리의 다른 글

arm asm rev  (0) 2023.09.14
cortex-a53  (0) 2023.08.31
arm vsub operator  (0) 2023.08.09
ARM NEON SLP  (0) 2023.08.07
cortex a9 ptm  (0) 2023.07.21
Posted by 구차니
embeded/ARM2023. 8. 9. 13:54

저번에 작성한 프로그램에서 VFP 를 통한 연산가속을 활성화 해봤는데 혹시나 해서, 어떤 명령어를 이용했나 역으로 찾아보는 중

   111a0: f35668e8  vsub.i16 q11, q11, q12
   1120c: f35318a1  vsub.i16 d17, d19, d17
   1172c: f2600de8  vsub.f32 q8, q8, q12
   11730: f2644de8  vsub.f32 q10, q10, q12
   11784: ee377a46  vsub.f32 s14, s14, s12
   117a8: ee755ac6  vsub.f32 s11, s11, s12
   117c0: ee744ac6  vsub.f32 s9, s9, s12
   117d8: ee355a46  vsub.f32 s10, s10, s12
   117f0: ee755ac6  vsub.f32 s11, s11, s12
   1180c: ee744ac6  vsub.f32 s9, s9, s12
   11818: ee355a46  vsub.f32 s10, s10, s12
   11824: ee356ac6  vsub.f32 s12, s11, s12
   11844: f2600de8  vsub.f32 q8, q8, q12
   11848: f2644de8  vsub.f32 q10, q10, q12
   118a8: ee344a67  vsub.f32 s8, s8, s15
   118d4: ee744ae7  vsub.f32 s9, s9, s15
   118ec: ee355a67  vsub.f32 s10, s10, s15
   11908: ee755ae7  vsub.f32 s11, s11, s15
   11918: ee344a67  vsub.f32 s8, s8, s15
   11924: ee744ae7  vsub.f32 s9, s9, s15
   11930: ee355a67  vsub.f32 s10, s10, s15
   1193c: ee757ae7  vsub.f32 s15, s11, s15

역어셈블 해보니 위와 같이 vsub.i16과 같은 neon 으로도 될 것 같은 녀석은 패스하면 vsub.f32 밖에 없다.

 

vsub.f32가 neon 껀지 vfp껀지 궁금해서 찾아보는 중

VSUB (floating-point)
Floating-point subtract.
This instruction can be scalar, vector, or mixed, but VFP vector mode and mixed mode are deprecated.

[링크 : https://developer.arm.com/documentation/dui0489/i/neon-and-vfp-programming/vsub--floating-point-]

 

Instruction Section Instruction set
V{Q}SUB V{Q}SUB, VSUBL and VSUBW NEON
VSUB VSUB VFP

[링크 : https://developer.arm.com/documentation/den0018/a/NEON-and-VFP-Instruction-Summary/List-of-all-NEON-and-VFP-instructions]

 

cortex a9의 NEON MPE는 Advanced SIMD와 VFP 확장을 구현하였지만

IEEE754 연산중 아래의 연산을 하드웨어적으로 제공하지 않는다 인데

round float-point number to nearest integer-valued in floating point number 때문에

gcc 에서 --fast-math 를 켜줘야 VFP 명령이 활성화 되는걸까?

IEEE754 standard compliance
The IEEE754 standard provides a number of implementation choices. The ARM Architecture Reference Manual describes the choices that apply to the Advanced SIMD and VFPv3 architectures.

The Cortex-A9 NEON MPE implements the ARMv7 Advanced SIMD and VFP extensions. It does not provide hardware support for the following IEEE754 operations:

remainder
round floating-point number to nearest integer-valued in floating-point number
binary-to-decimal conversion
decimal-to-binary conversion
direct comparison of single-precision and double-precision values
any extended-precision operations.

[링크 : https://developer.arm.com/documentation/ddi0409/e/programmers-model/ieee754-standard-compliance]

 

+

다시 옵션에 따른 비교를 해보니

어찌 된게 ffast-math 한게 디스어셈블한 부분이 더 길다.. 그런데 왜 빠르지?

for (int i = 0; i < READ_SIZE; i += 2)
   11710: f3f48c46  vdup.32 q12, d6[0]
float diff = data[i] - avg_0;
   11714: f46c434d  vld2.16 {d20-d23}, [ip]!
   11718: f2d00a34  vmovl.s16 q8, d20
   1171c: e151000c  cmp r1, ip
   11720: f2d04a35  vmovl.s16 q10, d21
   11724: f3fb0660  vcvt.f32.s32 q8, q8
   11728: f3fb4664  vcvt.f32.s32 q10, q10
   1172c: f2600de8  vsub.f32 q8, q8, q12
   11730: f2644de8  vsub.f32 q10, q10, q12
std_0 += diff * diff;
   11734: f3400df0  vmul.f32 q8, q8, q8
   11738: f2440df4  vmla.f32 q8, q10, q10
   1173c: f2422de0  vadd.f32 q9, q9, q8
for (int i = 0; i < READ_SIZE; i += 2)
   1177c: e15e000c  cmp lr, ip
float diff = data[i] - avg_0;
   11780: ee072a90  vmov s15, r2
   11784: eef87ae7  vcvt.f32.s32 s15, s15
   11788: ee777ac6  vsub.f32 s15, s15, s12
std_0 += diff * diff;
   1178c: ee077aa7  vmla.f32 s14, s15, s15

 

흐으으으으음.. 어셈은 어려워 -_ㅠ

Instruction Section Instruction set
VMLA VMUL, VMLA, VMLS, VNMUL, VNMLA, and VNMLS VFP
VMLA{L} VMUL{L}, VMLA{L}, and VMLS{L} (by scalar) NEON

[링크 : https://developer.arm.com/documentation/den0018/a/NEON-and-VFP-Instruction-Summary/List-of-all-NEON-and-VFP-instructions]

'embeded > ARM' 카테고리의 다른 글

cortex-a53  (0) 2023.08.31
aarch64 vector register  (0) 2023.08.23
ARM NEON SLP  (0) 2023.08.07
cortex a9 ptm  (0) 2023.07.21
openOCD와 jtag  (0) 2023.07.06
Posted by 구차니
embeded/ARM2023. 8. 7. 19:10

SLP가 먼가 해서 보는데 gcc/gnu 문서 내에서는 없어서

 

word 보다 더 큰 크기의 데이터들에 대해서(super word level) 병렬화(parallelism) 한다는 의미인가?

Superword-Level Parallelism (SLP) vectorizer

[링크 : https://rcor.me/papers/cgo19snslp.pdf]

[링크 : https://llvm.org/docs/Vectorizers.html#slp-vectorizer]

 

Example 20: Basic block SLP with multiple types, loads with different offsets, misaligned load, and not-affine accesses:

void foo (int * __restrict__ dst, short * __restrict__ src,
          int h, int stride, short A, short B)
{
  int i;
  for (i = 0; i < h; i++)
    {
      dst[0] += A*src[0] + B*src[1];
      dst[1] += A*src[1] + B*src[2];
      dst[2] += A*src[2] + B*src[3];
      dst[3] += A*src[3] + B*src[4];
      dst[4] += A*src[4] + B*src[5];
      dst[5] += A*src[5] + B*src[6];
      dst[6] += A*src[6] + B*src[7];
      dst[7] += A*src[7] + B*src[8];
      dst += stride;
      src += stride;
    }
}

[링크 : https://gcc.gnu.org/projects/tree-ssa/vectorization.html#slp]

 

 

'embeded > ARM' 카테고리의 다른 글

aarch64 vector register  (0) 2023.08.23
arm vsub operator  (0) 2023.08.09
cortex a9 ptm  (0) 2023.07.21
openOCD와 jtag  (0) 2023.07.06
cmsis (Common Microcontroller Software Interface Standard)  (0) 2023.02.27
Posted by 구차니
embeded/DSP C2000 Ti2023. 7. 28. 09:30

실수로 5V 짜리에 24V를 넣어버렸다 -_ㅠ

이제 TMS는 다시는 볼일이 없을 느낌 ㅠㅠ

 

 

얘가 망가졌을 것 같은데

[링크 : https://www.ti.com/product/ko-kr/TPS767D301-EP]

 

와.. 1개 1.6만 -_- 수리 포기

[링크 : https://www.mouser.kr/ProductDetail/Texas-Instruments/TPS767D301MPWPREP?qs=kujVBWBDkXIrGr50CbsOmQ%3D%3D]

'embeded > DSP C2000 Ti' 카테고리의 다른 글

CCSv8.3.1 on win10  (2) 2023.07.14
CCS v8.3.1 on ubuntu 22.04  (0) 2023.07.14
spectrum digital XDS510 USB  (0) 2023.07.14
TMS320 소비전력  (0) 2023.07.13
tms320 어렵네...  (4) 2020.04.02
Posted by 구차니
embeded/raspberry pi2023. 7. 24. 10:52

openOCD(ftdi jtag) - rpi 3 jtag 연결

[링크 : https://ahyuo79.blogspot.com/2020/02/openocd-ftdi-jtag.html]

 

빠르다면 빠른 속도.

Part No: FT2232HQ
USB Hi-Speed to Dual Channel Serial UART/FIFO/JTAG/SPI/I2C IC, QFN-64
Hi-speed USB 2.0 Slave to Dual Channel UART / Serial Converter

 Data Rates: 12Mbaud (UART) up to 40MB/s (Sync FIFO)  USB Transfer Modes: Bulk  Interfaces: UART, FIFO, 2 x MPSSE, Fast serial, 8051 MCU emulation, 16 GPIOs  USB Host: No  Packages: 64-pin QFN  Channels: 2  I/O Voltage: 3.3V  USB Class: Vendor  Virtual Com Port: Yes  Operating Temperature: -40°C to +85°C
Standard Price (Easy checkout)
Order Quantity Price per Unit
1 - 9 : USD5.10
10 - 49 : USD4.90
50 - 99 : USD4.80
100 - 249 : USD4.70
250 - 499 : USD4.50
500 - 999 : USD4.25

Key Hardware Features
Single chip USB to dual serial / parallel ports with a variety of configurations.
Entire USB protocol handled on the chip. No USB specific firmware programming required.
USB 2.0 High Speed (480Mbits/second) and Full Speed (12Mbits/second) compatible.
Dual Multi-Protocol Synchronous Serial Engine (MPSSE) to simplify synchronous serial protocol (USB to JTAG, I2C, SPI or bit-bang) design.
Dual independent UART or FIFO ports configurable using MPSSEs.
Independent Baud rate generators.
RS232/RS422/RS485 UART Transfer Data Rate up to 12Mbaud. (RS232 Data Rate limited by external level shifter).
USB to parallel FIFO transfer data rate up to 10Mbyte/sec.
Single channel synchronous FIFO mode for transfers up to 40 Mbytes/sec.
CPU-style FIFO interface mode simplifies CPU interface design.
MCU host bus emulation mode configuration option.
Fast Opto-Isolated serial interface option.
FTDI’s royalty-free Virtual Com Port (VCP) and Direct (D2XX) drivers eliminate the requirement for USB driver development in most cases.
Adjustable receive buffer timeout.
Option for transmit and receive LED drive signals on each channel.
Enhanced bit-bang Mode interface option with RD# and WR# strobes.
FT245B-style FIFO interface option with bidirectional data bus and simple 4 wire handshake interface.
Highly integrated design includes +1.8V LDO regulator for VCORE, integrated POR function and on chip clock multiplier PLL (12MHz – 480MHz).
Asynchronous serial UART interface option with full hardware handshaking and modem interface signals.
Fully assisted hardware or X-On / X-Off software handshaking.
UART Interface supports 7/8 bit data, 1/2 stop bits, and Odd/Even/Mark/Space/No Parity.
Auto-transmit enable control for RS485 serial applications using TXDEN pin.
Operational configuration mode and USB Description strings configurable in external EEPROM over the USB interface.
Configurable I/O drive strength (4,8,12 or 16mA) and slew rate.
Low operating and USB suspend current.
Supports bus powered, self powered and high-power bus powered USB configurations.
UHCI/OHCI/EHCI host controller compatible.
USB Bulk data transfer mode (512 byte packets in Hi-Speed mode).
+1.8V (chip core) and +3.3V I/O interfacing (+5V Tolerant).
Extended -40°C to 85°C industrial operating temperature range.
Compact 64-LD Lead Free LQFP/LQFN package and 56-LD VQFN packages.
+3.3V single supply operating voltage range.

[링크 : https://ftdichip.com/products/ft2232hq/]

 

[링크 : https://ftdichip.com/software-examples/mpsse-projects/ftcjtag-examples/]

[링크 : https://ftdichip.com/software-examples/mpsse-projects/]

 

 

'embeded > raspberry pi' 카테고리의 다른 글

DHT22 도착!  (0) 2023.09.19
bmp280 HW-611  (0) 2023.09.19
rpi bear metal  (0) 2023.07.10
라즈베리 3 전원 off  (0) 2023.07.02
rpi win 10 IoT  (0) 2023.02.02
Posted by 구차니
embeded/FPGA - XILINX2023. 7. 22. 23:05

Xilinx FPGA용 그마나 저렴한 jtag인데 64$

[링크 : https://digilent.com/shop/jtag-hs2-programming-cable/]

 

정품은 270$

[링크 : https://www.xilinx.com/products/boards-and-kits/hw-usb-ii-g.html]

 

아무튼 jtag-hs2를 연결해서 리눅스에서 보면 그냥 시리얼 포트다 (연결되었다 끊어지지만)

$ lsusb -t -v
    |__ Port 2: Dev 3, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 480M
        ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC

$ sudo dmesg
[  924.904844] usb 1-2: new high-speed USB device number 14 using xhci_hcd
[  925.059009] usb 1-2: New USB device found, idVendor=0403, idProduct=6014, bcdDevice= 9.00
[  925.059027] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  925.059034] usb 1-2: Product: Digilent USB Device
[  925.059040] usb 1-2: Manufacturer: Digilent
[  925.059045] usb 1-2: SerialNumber: 0000000000
[  925.066084] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[  925.066178] usb 1-2: Detected FT232H
[  925.067712] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
[  925.104014] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  925.104066] ftdi_sio 1-2:1.0: device disconnected

[링크 : https://www.ftdichip.com/old2020/Products/ICs/FT232H.htm]

 

FT232H 만은 싼데.. EVK 나 이런건 가격이 도대체 몇배가 뛰는거냐.. (억울하면 직접 만들어야?)

1: ₩5,301.6
25: ₩4,802.4
100: ₩4,667.5
250: ₩4,478.7

[링크 : https://www.mouser.kr/c/?marcom=123533426]

 

'embeded > FPGA - XILINX' 카테고리의 다른 글

EBAZ4205 zynq  (0) 2025.03.25
xilinx vdma  (0) 2025.01.16
xilinx zynq jtag  (2) 2023.07.21
zynq 7000 fsbl  (0) 2023.07.12
zynq fsbl  (0) 2023.07.07
Posted by 구차니
embeded/ARM2023. 7. 21. 19:04

PTM은 Program Trace Macrocell의 약자로 말그대로 프로그램을 추적하는 녀석이라

데이터만을 추적하는 기능은 제공하지 않는 듯.

 

CortexA9의 PTM과 같이 데이터 트레이스를 지원하지 않는 환경에서 ITM은 제한적으로나마 데이터 트레이스를 해볼 수 있는 방안을 제공한다

[링크 : https://www.epnc.co.kr/news/articleView.html?idxno=45715]

 

PTM interface
The Cortex-A9 processor optionally implements a Program Trace Macrocell (PTM) interface, that is compliant with the Program Flow Trace (PFT) instruction-only architecture protocol. Waypoints, changes in the program flow or events such as changes in context ID, are output to enable the trace to be correlated with the code image.

[링크 : https://developer.arm.com/documentation/100511/0401/functional-description/about-the-functions/ptm-interface]

 

 

'embeded > ARM' 카테고리의 다른 글

arm vsub operator  (0) 2023.08.09
ARM NEON SLP  (0) 2023.08.07
openOCD와 jtag  (0) 2023.07.06
cmsis (Common Microcontroller Software Interface Standard)  (0) 2023.02.27
i.mx8m plus arm trust zone  (0) 2023.02.24
Posted by 구차니
embeded/FPGA - XILINX2023. 7. 21. 18:02

zynq 에서 PS와 PL 이 어떻게 디버깅 가능하려나 조사중

분위기만 봐서는 PL JTAG을 써도 ARM DAP 쪽으로 chain으로 연결되어 있어서 가능은 할 것 같은데..

 

[링크 : https://www.xilinx.com/content/dam/xilinx/support/documents/user_guides/ug585-Zynq-7000-TRM.pdf#nameddest=xJTAGAndDAPSubsystem]

 

갑자기 나온 PJTAG 얜 또 머냐

[링크 : https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Features?tocId=E4XCBg8P~M_uLRK6uggTiQ]

[링크 : https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/JTAG-Chain-Boot-States]

 

[링크 : https://www.xilinx.com/support/documentation-navigation/design-hubs/dh0055-zynq-7000-debug-hub.html]

 

PJTAG 쓰면 된다는데 이제는 DAP과 TAP이 먼지공부하게 생겼네

Using PJTAG you can access DAP. With Xilinx JTAG you can access both TAP and DAP

[링크 : https://support.xilinx.com/s/question/0D52E00006hps2qSAA/difference-xilinx-jtag-and-arm-pjtag?language=en_US]

'embeded > FPGA - XILINX' 카테고리의 다른 글

xilinx vdma  (0) 2025.01.16
ftdi jtag  (0) 2023.07.22
zynq 7000 fsbl  (0) 2023.07.12
zynq fsbl  (0) 2023.07.07
zynq w/o ps  (0) 2023.06.30
Posted by 구차니
embeded/Cortex-M3 STM2023. 7. 19. 19:19

stm32를 찾아봐야 하나..

gdb 문법은 아닌듯 한데 stm32 전용 구문들이려나?

 

# custom.cfg
source [find interface/stlink-v2-1.cfg]
transport select "hla_swd"

source [find stm32f4x.cfg]

reset_config none

 

 

[링크 : https://www.openstm32.org/forumthread1967]

Posted by 구차니