개소리 왈왈/독서2018. 1. 28. 22:31

분노조절이 잘 안되서 책보는데.. 

읽는 책이 아닌 실천해야만 하는 책이라 이래저래 대충읽고 반납 ㅠㅠ

아무튼 분노 조절을 위해서, 일단은 좀더 지연시키고

조금은 타인에게 해결을 떠넘길 필요는 있나보다

내가 너무 껴안으려는게 문제일지도..


아이에게 화가 나는건 참 나쁜 부모인것 같긴한데

아내에게 체벌이나 혼내는 것을 넘김으로서

난 단순히(?) 사고치는걸 꼰지름으로서 화를 좀 피하는 방법 정도로 일단은 타협을 해야 할 듯


그리고 분석을 해보니..

아이가 울거나 사고 칠때 화가 나는 이유가

통제 불가능과, 혼내야 한다와 화를 내서는 안된다의 모순에서 벌어지는 

상태 개선이나 상황 통제의 불가능에서 오는 스트레스 인 것으로 생각된다.


첫 애가 장난이던 화가 나서던 나에게 싸다구를 날리면

걍 정신줄 끊어지듯 화가 나는데, 조금씩 끓어 오르면 어떻게 제어가 가능할텐데

그러한 시간간격을 스스로 만들어야 하는게 일단 관건이고

화가 나더라도 화를 식히고 환기할 동안 아내에게 아이를 혼내도록 위임함으로서

직접적인 분노가 아이에게 전달되지 않도록 하는 정도가 현재로서는 최선일 것 같다.


둘째가 울어 제끼기를 그치지 않으면 또 화가 나는데

어떻게 해야 할지 모르겠다라는 체념과 어떻게든 아내가 좀 쉬도록 내가 이아이를

책임지고 돌봐야만 한다라는 충돌에서 오는 심리적 스트레스? 아직 100일도 안된 애니까

감내를 해야 한다고 하지만, 그럼에도 불구하고 안고 있는데 귀에다 대고 울어대면

귀를 드릴로 뚫어 버리는 느낌이라 또 정신줄 팅~ 하고 그러니 이거 참.. 아빠로서는 실격일지도..

아무튼 니가 울던가 말던가 하고 좀 던질 용기(?)도 필요한거 같은데

아내왈 "두 시간 동안 냅둬봤는데 지치지도 않고 울어서 내가 졌어" 라고... ㅠㅠ

내가 봐주더라도 울면 걍 넘겨야지 어쩌겠어 ㅠㅠ



[링크 : http://www.kyobobook.co.kr/product/detailViewKor.laf?barcode=9788958320807]


[링크 : http://www.kyobobook.co.kr/product/detailViewKor.laf?barcode=9788965021490]

Posted by 구차니
개소리 왈왈/컴퓨터2018. 1. 28. 22:10

NAS 하드 중에 오래된 녀석(2T) SMART 정보에 문제는 없으나

먼가 미묘하게 버벅대는 현상이 발생...

징조가 보인다.. 급 지출 예상 ㅠㅠ



에어컨 HEPA 필터 물비린내 나고 필터 색도 많이 누래져서

가을 황사 대비한다고 샀나 그런데. 짧고 굵게 오는 바람에 빠르게 필터가 소비된듯..

일단 금액상의 문제로 필터 전체 교체는 무리고 반만 사고

다음달에 또 나머지 사고 그래야 할 듯 ㅠㅠ

예상은 했으나 예상보다 빠른 지출 ㅠㅠ




하다하다 드디어 빡쳐서 아내의 엄명

공유기 바꾸자!

U+ 에서 제공한 공유기 쓰는데 먼가 갈수록 느려지네

iptime A604 중고로 택포 1.3만에 구매예약중

어쩌다 보니... 802.11ac로 가긴 가네..

조만간 배선공사도 추가 ㅠㅠ


+

산다고 하고 다시 검색해보니

A604 이녀석 애매하네 ㅋㅋ 일단 무선 커버리지 문제로 사는거니 별 불만은 없겠지만

802.11ac 800MB 링크 가능한 녀석인데 외부 인터페이스는 죄다 100Mbps ㅋㅋ

[링크 : http://technote.kr/129]

Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 27. 22:36

elf로 뱉어 내는거 같은데

일단.. Add Hex 하면서 Relative로 0x00 이 기본인거 같긴한데

map 파일에서 Page_0의 시작 주소를 확인하라고 되어있네


The method used to create a .jic file with a Nios® II hardware and software image is as follows.

1. Create a flash file from a .sof file: sof2flash --input=<hwimage>.sof --output=hwimage.flash --epcs --verbose

2. Create a flash file from a ,elf file: elf2flash --input=<elf file>.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose

3. Convert the .flash image into a.hex file: nios2-elf-objcopy --input-target srec --output-target ihex mysw.flash mysw.hex

4. In the Quartus® II software, open File > Convert Programming Files > Set the programming file as JTAG Indirect Configuration File (.jic).


6. Select the correct size EPCS device in the Configuration pull-down

7. Name your output .jic file

8. Click Flash Loader below, and select Add Device on the right hand side

9. Select your FPGA device from the list

10. Click SOF Data, and select Add File, and select your .sof file

11. Click Add Hex data, select Relative addressing, and select your .hex file created above

12. Now push generate. You should verify that the generated .map file has Page_0 at a start address of 0x0, and the hex file at a start address 1 after the end address of Page_0

13. Now in the Quartus II Programmer, select Add File and select your .jic file. Check the Program box next to the .jic file, and push Start 

[링크 : https://www.altera.com/support/support-resources/knowledge-base/solutions/rd10132010_126.html]


The method used to create a .jic file with a Nios® II hardware and software image is as follows.

1.      Create a flash file for the hardware and software image
sof2flash --input=<hwimage>.sof --output=hwimage.flash --epcs --verbose
elf2flash --input=<elf file>.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose

Note: When creating the software flash image, there is no need to add a boot srec (this is located in the EPCS Controller), the --after option ensures the software image starts immediately after the hardware image.

2.      Convert the flash images into Hex files

nios2-elf-objcopy -I srec -O ihex hwimage.flash  hwimage.hex
nios2-elf-objcopy -I srec -O ihex swimage.flash  swimage.hex

3.      When creating your jic file using Quartus® II Convert Programming File tool, add the Flash Loader and both hex files with absolute addressing option selected.

Note: You do not need to add the .sof file to the jic image.  This is because you created a hardware hex image.  Using the hardware hex image ensures the software hex image is at the proper offset in the EPCS. 

[링크 : https://www.altera.com/support/support-resources/knowledge-base/solutions/rd12092009_471.html]


+

[링크 : https://www.altera.com/en_US/pdfs/literature/ug/ug_nios2_flash_programmer.pdf]

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

Nios II / Nios II Classic 차이점  (0) 2018.01.29
elf2flash와 nios2-elf-objcopy 사용하기  (0) 2018.01.29
Nios II 프로그램 빌드..  (0) 2018.01.27
Nios II 명령어 관련 조사  (0) 2018.01.26
nios2 /e /f 별 설정  (0) 2018.01.25
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 27. 12:48

먼가 반갑도고 징글징글 한 eclipse mars.2?

아무튼 얘가 Nios II 용 프로그램을 빌드해주실 분이다.


File - New - Nios II Application and BSP from Template를 하라고 하는데


sopcinfo 파일을 지정하라고 한다.


아놔.. 망할 공백 -_ㅠ 일단 다른데로 저장해서 진행 ㄱㄱ


일단 파일을 지정하고 나면 약간의 시간 후에 cpu 이름이 뜬다.


프로젝트 이름은 대충 일단 쳐넣어 보고


기본 소스는 있으니까(머 printf("Hello from Nios II!\n"); 뿐이지만)

Run 눌러서 빌드+실행!

실행시에는 Nios II Hardware로 하라고 하는데


안되잖아 -ㅁ-?

일단 원인 검색중..

nios2-elf-g++  -T'../hello_world_0_bsp//linker.x' -msys-crt0='../hello_world_0_bsp//obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../hello_world_0_bsp/   -Wl,-Map=hello_world_0.map   -O0 -g -Wall   -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global  -o hello_world_0.elf obj/default/hello_world.o -lm -msys-lib=m

c:/intelfpga_lite/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x18dc0 of hello_world_0.elf section `.bss' is not within region `onchip_memory2_0'

c:/intelfpga_lite/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x18dc0 of hello_world_0.elf section `.bss' is not within region `onchip_memory2_0'

collect2.exe: error: ld returned 1 exit status

make: *** [hello_world_0.elf] Error 1


메모리가 부족해요 부터 이상한 소리들이 많은데 결국 도움 받은 글은 이것 하나네

프로젝트 중 _bsp로 끝나는 것에서 우클릭 Proeprties


Nios II BSP Properties 에서, 조금 기다리면 비활성화 된 내용들이 풀리는데


Reduced device drivers는 필수는 아니고

Optimization level로 필수는 아니지만

Small C library 는 필수로 해주어야 한다고 한다.

[링크 : https://www.alteraforum.com/forum/showthread.php?t=52418]


일단 소스를 변경하고 했는데 PIO_0_BASE로 된건 조금 헤매게 되네..

system.h 에 PIO로 검색해서 나오는 건데, pdf 파일의 버전과 달라서 그런지 생성되는 명칭이 다르다.

/*

 * "Hello World" example.

 *

 * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on

 * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example

 * designs. It runs with or without the MicroC/OS-II RTOS and requires a STDOUT

 * device in your system's hardware.

 * The memory footprint of this hosted application is ~69 kbytes by default

 * using the standard reference design.

 *

 * For a reduced footprint version of this template, and an explanation of how

 * to reduce the memory footprint for a given application, see the

 * "small_hello_world" template.

 *

 */


#include <stdio.h>

#include "system.h"

#include "altera_avalon_pio_regs.h"


int main() {

printf("Hello from Nios II!\n");

int count = 0;

int delay;

while (1) {

IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, count & 0x01);

delay = 0;

while (delay < 1000000) {

delay++;

}

count++;

}

return 0;


Run Configurations 에

Nios II Hardware 에서 Target Connection 오른쪽에 Refresh Connections가 창이 작아서 안보였는데

아무튼 이걸 눌러줘야 프로세서가 뜨고 프로그램이 정상적으로 작동하게 된다.

망할 -_- 자동 탐지 되는줄 알았는데 ㅠㅠ


아무튼 먼가 열심히 빌드하고 먼가 열심히 올리더니


printf()로 출력한거 나오고 LED가 깜박깜박 한다.


이제 남은건.. 바이너리 통합하기?

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

elf2flash와 nios2-elf-objcopy 사용하기  (0) 2018.01.29
Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Nios II 명령어 관련 조사  (0) 2018.01.26
nios2 /e /f 별 설정  (0) 2018.01.25
my first Nios II with DE0-nano  (0) 2018.01.25
Posted by 구차니
Programming/Verilog2018. 1. 26. 16:31

정리 안해놨었나..?

왼쪽과 오른쪽이 혼용되서 쓰이는데

오른쪽은 C언어의 함수처럼, 변수(?)의 순서대로 선언하면 된다.

왼쪽은 구조체 변수 초기화 하는 느낌? 타이핑할 건 늘어나지만 순서대로 안해줘도 되니까

일장일단이 있다.(그래도 난 함수 처럼 순서대로 넣는게 편할 듯)

module dff (clk, d, q);

input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (.d(data), .q(net_1), .clk(clock));
  dff inst_2 (.clk(clock), .d(net_1), .q(q_out));
endmodule

module dff (clk, d, q);

input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (clock, data, net_1);
  dff inst_2 (clock, net_1, q_out);
endmodule


순서대로 할 경우 ,, 으로 값을 넣지 않을수 있는데 이 경우 Hi-Z 로 설정이 된다.

(net 타입이니까 Hi-Z로 된다고 써있는 듯)

example 1

module dff (clk, d, q);
input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (.d(data), .q(net_1), .clk(clock));
  dff inst_2 (.clk(clock), .d(net_1), .q(q_out));
endmodule

In the top module there are two instantiations of the 'dff' module. In both cases port connections are done by name, so the port order is insignificant. The first port is input port 'd', the second is output 'q' and the last is the clock in the 'inst_1'. In the dff module the order of ports is different than either of the two instantiations.

Example 2

module dff (clk, d, q);
input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (clock, data, net_1);
  dff inst_2 (clock, net_1, q_out);
endmodule

Example 3

dff inst_1 (clock, , net_1);

Second port is unconnected and has the value Z because it is of the net type.

Example 4

module my_module (a, b, c);
input a, b;
output c;
  assign c = a & b ;
endmodule
 
module top (a, b, c) ;
input [3:0] a, b;
output [3:0] c;
  my_module inst [3:0] (a, b, c);

endmodule 

[링크 : http://verilog.renerta.com/mobile/source/vrg00027.htm]

[링크 : https://en.wikibooks.org/wiki/Programmable_Logic/Verilog_Module_Structure]

'Programming > Verilog' 카테고리의 다른 글

Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
encrypted Verilog  (0) 2018.02.03
verliog module 선언  (0) 2018.01.25
verilog 모델링 유형  (0) 2018.01.20
verilog Concatenation, Replication operator  (0) 2018.01.19
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 26. 16:08

Nios II 코어 생성하다 보니 명령어별 cycle이 나와서 한번 어떤 명령어 인가 조사를 해보는데..

관건은.. 1 cycle이냐 2 cycle 이냐로 갈리는 Multiply Extended 명령어들!


일단 일반적인 곱셈은

MUL

Multiplies rA times rB and stores the 32 low-order bits of the product to rC. The result is the same whether the operands are treated as signed or unsigned integers.

Operation에 rC <- (rA x rB)31...0 인데.. 32비트 연산이라는 의미 같고


MULXSS

Treating rA and rB as signed integers, mulxss multiplies rA times rB, and stores the 32 high-order bits of the product to rC.

Operation 에서 rC <- ((singed)rA) x ((signed)rB))63..32

32비트를 초과하는 상위 비트에 대해서 계산을 한다는 건가?

아무튼 확장 곱셈 명령으로는 세가지가 있는데 로직을 얼마나 사용할 진 모르겠지만

Big integer 계산하는게 아니라면 2 cycle로 처리가 가능하니 굳이 안하는게 이득일 것으로 보인다.

mulxss multiply extended signed/signed

mulxsu multiply extended signed/unsigned

mulxuu multiply extended unsigned/unsigned 

[링크 : https://www.altera.com/en_US/pdfs/literature/hb/nios2/n2cpu_nii51017.pdf]



+

어라.. Nios II (Classic) Processor 를 선택하니 Nios II/s가 보이네?


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

Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Nios II 프로그램 빌드..  (0) 2018.01.27
nios2 /e /f 별 설정  (0) 2018.01.25
my first Nios II with DE0-nano  (0) 2018.01.25
Quartus 2 Programmer Mode 조사  (0) 2018.01.23
Posted by 구차니
embeded2018. 1. 26. 16:00

아는 프로세서는 없지만.. 8051이 저~~~기 구석에 쳐박히는데

문제는 DMIPS 0.1의 1/10쯤 될까 말까? 혹은 측정 불가라는 수준 아닌가 싶다.

[링크 : http://www.ensilica.com/pdfs/White_Paper_The_right_Microcontroller_for_low-power_apps.pdf]


일단.. Cortex-m3일 것으로 보이는 STM32F4랑 비교하면 gcc-arm/gcc-avr로 약 4배 정도 성능 차이가 발생한다.

(검색해보니 cortex-m4 계열)

STM32F4:            902,       gcc-arm

AVR90USB1286:  237,       gcc-avr 

[링크 : https://www.eevblog.com/forum/microcontrollers/dhrystone-2-1-on-mcus/]



AVR쪽은 데이터시트 상으로 DMIPS 수치가 없다. 일단 MIPS뿐.. 정량적 비교는 무리

AT90USB 1MIPS/1MHz

[링크 : http://ww1.microchip.com/downloads/en/DeviceDoc/doc7707.pdf]



Dhrystone 계산법을 모르겠네.. 첫줄에서 둘째줄로 가는데

반대로 계산해보면 70Mhz 정도 되는 것 같은데 40MHz TSMC process...???

내가 아는 반올림이랑 방법이 다른가?

[링크 : https://www.eembc.org/techlit/datasheets/dhrystone_wp.pdf]



x86과 arm의 DMIPS인데.. 단위가 훅 커지네..

 Raspberry Pi           Linux                   

  ARM  1176      700     3.6.11      847          

  ARM  1176     1000     3.6.11     1226          


  Raspberry Pi 2                                  

  ARM V7A       900      3.18.5     1538          

  ARM v7A      1000      3.18.5     1694          

 gcc 4.8                                        

  ARM V7A       900      3.18.5     1667          

  ARM V7A      1000      3.18.5     1852          


  Raspberry Pi 3, 32 Bit                          

  ARM v8-A53   1200      4.1.19     2201          

  gcc 4.8                                         

  ARM v8-A53   1200      4.1.19     2469          


  Raspberry Pi 3, 64 Bit                          

  OpenSuse                                        

  ARM v8-A53   1200      4.4.36     3536          

  Gentoo                                          

  ARM v8-A53   1200      4.10.0     3475           

[링크 : http://www.roylongbottom.org.uk/dhrystone%20results.htm]


'embeded' 카테고리의 다른 글

udoo 보드  (0) 2018.11.29
아싸~ 득템  (7) 2018.07.16
프로그램 영역(code) 변수 저장하기  (0) 2018.01.15
USB UART - CH340  (2) 2017.10.30
nuvoton cortex-m0 ISD9160 LDROM  (0) 2017.10.17
Posted by 구차니

혹시나 했는데 역시나 있네 -ㅁ-

헤드만 바꾸면 3축 CNC니까

일단 5축 CNC에 FDM 방식 노즐 다는 녀석도 있는 듯


[링크 : https://blog.naver.com/elecraft/221044141820] 자작(?) CNC + 라즈베리 파이

[링크 : http://mak2awish.tistory.com/194]

[링크 : https://blog.naver.com/dev4unet/220916270027]

[링크 : http://yoo7577.tistory.com/450] 위에랑 같은거


[링크 : http://bbs.ruliweb.com/news/board/1003/read/1670766] 5축

Posted by 구차니

솔찍히 말해서 3%를 얻더라도, 거부하면 파헤칠수 없는게 아니냐? 싶어서

비용대비 효용이라던가, 가능성 면에서 낮게 보긴 했는데

내부 분열(?)로 먹튀화 되는게 아닌가 생각이 드네

나쁘게 말하면 고작(?) 150억에 이 큰 사기를 친거 아니냐 싶어지는데

제1차 이사회 개최

2017년 11월 3일 오후 6시, 서울 프레스센터 엠바고홀에서 이사 6명, 집행위원장 및 집행위원 4명, 사무국 1명 등 참석하여 조직 및 사업계획, 예산안 그리고 사무실 마련에 대하여 심의 의결. 

[링크 : http://showmethemoney.or.kr/소개/]


150억 모금한 '플랜다스의 계'.."다스 주식 안 산다"

[링크 : http://v.media.daum.net/v/20180125203002521]


김어준 "'플랜다스의 계'로 모인 150억원, 원하면 전액 환불해야"

[링크 : http://v.media.daum.net/v/20180126092409487]

[링크 : http://showmethemoney.or.kr/참여와-소통/?uid=9787&mod=document&pageid=1] 공지

Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 25. 22:52

Nios 2 core 설정을 하는데

economic과 fast 두 가지가 가능하다.


일단 e는 LE를 최소화 하는 녀석이라 그런지 performance 항목이 참.. 암울하게 나온다.


fast로 설정하면 multiplier 정도는 추가가 되는지 1 클럭이 끝나고 shift와 rotate도 1 클럭에 끝난다.


곱셈 구현을 32bit 멀티플라이어로 선택하면 1클럭에 끝나서 가장 빠르긴 한데


Cyclone 4 E 에서는 32bit multiplier를 구현 할 수 없는지 경고가 뜬다.


아무튼 Auto 보다 Manual로 선택해서 이것저것 넣으면 곱셈 확장 2클럭까지 올라는 가는데

저 명령어들이 얼마나 쓰일려나?



+

nios 2/e는 캐쉬 자체가 지원하지 않는다. 그래서 경고가 하나 줄었던 거군


nios 2/f는 캐쉬 설정이 가능한데

기본값으로 i-cache가 4k d-cache가 2k 라 에러가 발생한다.


i-cache를 4k로 하면 해결될 것 같으나, 메모리 공간이 안 맞대서 일단 2k 2k로 설정하면 해결


Posted by 구차니