'잡동사니'에 해당되는 글 13954건
- 2023.05.13 낮잠 기절
- 2023.05.12 xilinx vivado uart ip
- 2023.05.12 xilinx bram uram
- 2023.05.11 go 포맷터
- 2023.05.11 c에서 rust 호출하기
- 2023.05.11 rust 실행파일
- 2023.05.11 rust if문
- 2023.05.10 rust rustup doc
- 2023.05.09 rust cargo new를 통한 프로젝트 생성
- 2023.05.09 rust 와 main.rs
uart로 검색하니 uart 16550과 uartlite라는 녀석이 나온다.
둘 다 라이센스가 included 인데.. free도 있고 무슨 차이이려나?

uartlite는 baudrate와 parity를 HDL 로 설정해야 하고(런타임 변경 불가)

[링크 : https://www.xilinx.com/products/intellectual-property/axi_uartlite.html]
uart 16550은 런타임에 변경이 가능한 ip이다.
보기에는 freeze 하나만 더 추가되는 느낌이긴한데.. S_AXI 쪽이 많이 차이나려나?

[링크 : https://www.xilinx.com/products/intellectual-property/axi_uart16550.html]
'embeded > FPGA - XILINX' 카테고리의 다른 글
| zynq w/o ps (0) | 2023.06.30 |
|---|---|
| xilinx uartlite on zynq (0) | 2023.05.16 |
| xilinx bram uram (0) | 2023.05.12 |
| xilinx - partial bitstream (0) | 2023.04.24 |
| vivado 설치 하려고 했더니. (0) | 2023.01.08 |
BRAM(Block RAM)
URAM(Ultra RAM) - ultraScale+ 이상 제품군용
[링크 : https://wikidocs.net/86996]
block memory generator 라는 IP를 이용해서 BRAM을 할당하도록 하여 사용
(즉, HDL 레벨에서 특정 BRAM을 쓰도록 할 순 없는 것으로 예상)
'embeded > FPGA - XILINX' 카테고리의 다른 글
| xilinx uartlite on zynq (0) | 2023.05.16 |
|---|---|
| xilinx vivado uart ip (0) | 2023.05.12 |
| xilinx - partial bitstream (0) | 2023.04.24 |
| vivado 설치 하려고 했더니. (0) | 2023.01.08 |
| 흐음.. 끌리네? (0) | 2022.11.02 |
go 에는 자체적으로 포맷터가 들어있다.
획일화 되서 나쁘다고 해야하나.. 좋다고 해야하나.. 참 미묘~
| To format your code, you can use the gofmt tool directly: gofmt -w yourcode.go Or you can use the “go fmt” command: go fmt path/to/your/package |
[링크 : https://go.dev/blog/gofmt]
'Programming > golang' 카테고리의 다른 글
| golang uds (0) | 2023.05.16 |
|---|---|
| golang mutex (sync) (0) | 2023.05.16 |
| golang echo directory listing (0) | 2023.05.08 |
| golang websocket binary (0) | 2023.03.28 |
| golang 크로스 컴파일 GOARM GOARCH (0) | 2023.02.03 |
no_mangle을 설정하면 c에서 사용가능한 함수로 빌드 되는 듯.
| Every function in your Rust-ffi API needs to have a corresponding header function. #[no_mangle] pub extern "C" fn rust_function() {} would then become void rust_function(); |
[링크 : https://docs.rust-embedded.org/book/interoperability/rust-with-c.html]
[링크 : https://dev.to/dandyvica/how-to-call-rust-functions-from-c-on-linux-h37]
mangle.. mangle이면 cpp이랑 좀 더 용이하게 붙을 느낌인데..?
| $ readelf -a main | grep demangle 387: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 393: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 394: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 395: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 400: 000000000002fc20 320 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v010H 401: 000000000002fd60 152 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v06Pa 402: 000000000002fe00 181 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v06Pa 403: 000000000002fec0 202 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v06Pa 404: 000000000002ff90 85 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v06Pa 405: 000000000002fff0 471 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v06Pa 406: 00000000000301d0 79 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 407: 0000000000030220 411 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 408: 00000000000303c0 411 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 409: 0000000000032a00 1868 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 410: 0000000000030560 396 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 411: 0000000000031c00 1282 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 412: 00000000000306f0 354 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 413: 0000000000030860 241 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 414: 0000000000030960 748 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 415: 0000000000032800 509 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 416: 0000000000030c50 514 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 417: 0000000000032110 1138 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 418: 0000000000030e60 152 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 419: 0000000000030f00 159 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 420: 0000000000030fa0 666 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 421: 0000000000031240 147 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 422: 0000000000031af0 260 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 423: 00000000000312e0 164 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 424: 0000000000032590 610 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 425: 0000000000033150 487 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 426: 0000000000033340 720 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 427: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 429: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 430: 0000000000000000 0 FILE LOCAL DEFAULT ABS rustc_demangle.9c38528e-c 492: 000000000002f460 635 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v08de 624: 0000000000033620 802 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle6legac 654: 0000000000031390 1878 FUNC LOCAL DEFAULT 14 _ZN14rustc_demangle2v07Pr 758: 000000000002ea40 395 FUNC GLOBAL DEFAULT 14 _ZN63_$LT$rustc_demangle. 848: 000000000002e330 1695 FUNC GLOBAL DEFAULT 14 _ZN14rustc_demangle8deman 956: 0000000000033950 2970 FUNC GLOBAL DEFAULT 14 _ZN71_$LT$rustc_demangle. 1021: 000000000002f6e0 1332 FUNC GLOBAL DEFAULT 14 _ZN64_$LT$rustc_demangle. 1090: 000000000002ea30 9 FUNC GLOBAL DEFAULT 14 _ZN14rustc_demangle8Deman 1278: 000000000002e9d0 82 FUNC GLOBAL DEFAULT 14 _ZN14rustc_demangle12try_ 1303: 000000000002ebd0 21 FUNC GLOBAL DEFAULT 14 _ZN71_$LT$rustc_demangle. |
'Programming > rust' 카테고리의 다른 글
| rust 소유권 (0) | 2023.05.25 |
|---|---|
| rust was (0) | 2023.05.20 |
| rust 실행파일 (0) | 2023.05.11 |
| rust if문 (0) | 2023.05.11 |
| rust rustup doc (0) | 2023.05.10 |
dynamic link 이고
| $ file * main: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=989d3d9b6419e9e16be59fe589ddda8c631c30f0, with debug_info, not stripped main.rs: C source, ASCII text |
링크 된걸 보면 c 프로그램과 별 차이가 없긴 한데
| $ ldd main linux-vdso.so.1 (0x00007ffe605de000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007efd04cd8000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007efd04ad0000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efd048b1000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007efd046ad000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efd042bc000) /lib64/ld-linux-x86-64.so.2 (0x00007efd05142000) |
실행 파일 크기가 미친듯이 크다.
golang 처럼 rust 라이브러리 자체는 static으로 link 한건가?
| $ ls -alh 합계 12M drwxrwxr-x 2 user user 4.0K 5월 11 10:06 . drwxrwxr-x 24 user user 4.0K 5월 11 10:05 .. -rwxrwxr-x 1 user user 12M 5월 11 10:06 main -rw-rw-r-- 1 user user 148 5월 11 10:06 main.rs |
'Programming > rust' 카테고리의 다른 글
| rust was (0) | 2023.05.20 |
|---|---|
| c에서 rust 호출하기 (0) | 2023.05.11 |
| rust if문 (0) | 2023.05.11 |
| rust rustup doc (0) | 2023.05.10 |
| rust cargo new를 통한 프로젝트 생성 (0) | 2023.05.09 |
golang과 비슷한데
그럼에도 불구하고 최소한 condition 부분의 괄호를 경로를 띄우지 error는 아니고
중괄호 위치는 마음대로 설정할 수 있다.
| $ cat main.rs fn main() { let number = 3; if (number < 5) { println!("condition was true"); } else { println!("condition was false"); } } |
| $ rustc main.rs warning: unnecessary parentheses around `if` condition --> main.rs:5:6 | 5 | if (number < 5) | ^ ^ | = note: `#[warn(unused_parens)]` on by default help: remove these parentheses | 5 - if (number < 5) 5 + if number < 5 | warning: 1 warning emitted |
[링크 : https://doc.rust-lang.org/book/ch03-05-control-flow.html]
'Programming > rust' 카테고리의 다른 글
| c에서 rust 호출하기 (0) | 2023.05.11 |
|---|---|
| rust 실행파일 (0) | 2023.05.11 |
| rust rustup doc (0) | 2023.05.10 |
| rust cargo new를 통한 프로젝트 생성 (0) | 2023.05.09 |
| rust 와 main.rs (0) | 2023.05.09 |
도움말 문서 보여줌
| Welcome to an overview of the documentation provided by the Rust project. This page contains links to various helpful references, most of which are available offline (if opened with rustup doc). |
'Programming > rust' 카테고리의 다른 글
| rust 실행파일 (0) | 2023.05.11 |
|---|---|
| rust if문 (0) | 2023.05.11 |
| rust cargo new를 통한 프로젝트 생성 (0) | 2023.05.09 |
| rust 와 main.rs (0) | 2023.05.09 |
| rust 문서 다운로드하기(cargo) (0) | 2023.05.09 |
msvc 설치하고 하니 정상적으로 잘 빌드 된다.
| C:\Users\user\Desktop\study\rust\hello_cargo>cargo build Compiling hello_cargo v0.1.0 (C:\Users\free\Desktop\study\rust\hello_cargo) Finished dev [unoptimized + debuginfo] target(s) in 1.04s |
---
에라이.. 역시 윈도우는 취미/개발용이 아니라 엔터테인먼트 용이었나!? (뜬금없이 분노중)
| C:\Users\user\Desktop\study\rust>cargo new hello_cargo Created binary (application) `hello_cargo` package C:\Users\user\Desktop\study\rust\hello_cargo> cd hello_cargo C:\Users\user\Desktop\study\rust\hello_cargo>cargo build Compiling hello_cargo v0.1.0 (C:\Users\free\Desktop\study\rust\hello_cargo) error: linker `link.exe` not found | = note: program not found note: the msvc targets depend on the msvc linker but `link.exe` was not found note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option. note: VS Code is a different product, and is not sufficient. error: could not compile `hello_cargo` due to previous error |
[링크 : https://doc.rust-lang.org/book/ch01-03-hello-cargo.html]
cargo.toml 내용은 평범한(?) ini 스타일이네
| [package] name = "hello_cargo" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] |
.gitignore 파일은 /target 인걸 봐서는 /src 에는 소스 /target에는 바이너리가 생성되는 구조인듯
| /target |
'Programming > rust' 카테고리의 다른 글
| rust if문 (0) | 2023.05.11 |
|---|---|
| rust rustup doc (0) | 2023.05.10 |
| rust 와 main.rs (0) | 2023.05.09 |
| rust 문서 다운로드하기(cargo) (0) | 2023.05.09 |
| rust in windows (0) | 2023.05.09 |
러스트니까 확장자가 rs인가..
함수는 fn 키워드로 구분하는 듯.
| C:\Users\user\Desktop\study\rust>type main.rs fn main() { println!("Hello, world!"); } |
처음해보려는데 머가 잘 못 깔린걸까.. -_-
| C:\Users\user\Desktop\study\rust>rustc main.rs error: linker `link.exe` not found | = note: program not found note: the msvc targets depend on the msvc linker but `link.exe` was not found note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option. note: VS Code is a different product, and is not sufficient. error: aborting due to previous error |
먼가 열심히 object 파일은 생성하는데 linker가 없어서 실행파일을 만드는건 실패한 듯.
| C:\Users\user\Desktop\study\rust>dir C 드라이브의 볼륨에는 이름이 없습니다. 볼륨 일련 번호: 38F7-6D98 C:\Users\user\Desktop\study\rust 디렉터리 2023-05-09 오후 01:18 <DIR> . 2023-05-09 오후 01:18 <DIR> .. 2023-05-09 오후 01:18 1,224 main.398lq81sg45tyvtc.rcgu.o 2023-05-09 오후 01:18 508 main.main.b8591b61-cgu.0.rcgu.o 2023-05-09 오후 01:18 1,870 main.main.b8591b61-cgu.1.rcgu.o 2023-05-09 오후 01:18 1,651 main.main.b8591b61-cgu.2.rcgu.o 2023-05-09 오후 01:18 802 main.main.b8591b61-cgu.3.rcgu.o 2023-05-09 오후 01:18 2,396 main.main.b8591b61-cgu.4.rcgu.o 2023-05-09 오후 01:18 1,708 main.main.b8591b61-cgu.5.rcgu.o 2023-05-09 오후 01:18 46 main.rs 8개 파일 10,205 바이트 2개 디렉터리 127,890,599,936 바이트 남음 |
+
msvc 설치하고 나서 rustc 해서 빌드하니 아래와 같이 익숙한(!) pdb와 exe가 나온다.
| C:\Users\user\Desktop\study\rust>rustc main.rs C:\Users\user\Desktop\study\rust>dir C 드라이브의 볼륨에는 이름이 없습니다. 볼륨 일련 번호: 38F7-6D98 C:\Users\user\Desktop\study\rust 디렉터리 2023-05-09 오후 11:37 <DIR> . 2023-05-09 오후 11:37 <DIR> .. 2023-05-09 오후 01:29 <DIR> hello_cargo 2023-05-09 오후 11:37 163,840 main.exe 2023-05-09 오후 11:37 1,355,776 main.pdb 2023-05-09 오후 01:18 46 main.rs 2023-05-09 오후 01:34 16,904,109 The Rust Programming Language.pdf 4개 파일 18,423,771 바이트 3개 디렉터리 121,282,232,320 바이트 남음 |
'Programming > rust' 카테고리의 다른 글
| rust if문 (0) | 2023.05.11 |
|---|---|
| rust rustup doc (0) | 2023.05.10 |
| rust cargo new를 통한 프로젝트 생성 (0) | 2023.05.09 |
| rust 문서 다운로드하기(cargo) (0) | 2023.05.09 |
| rust in windows (0) | 2023.05.09 |
