Programming/VHDL2017. 12. 11. 20:59

VHDL과 베릴로그를 검색해보니 두개가 그렇게 시기적으로 차이나는 것도 아니지만

언어적 접근 방법의 차이로 인해서 많이 갈라지게 된 듯?

VHDL은 하드웨어 적인 접근이고

Verilog는 프로그래밍 언어적인 접근이라고 하면 되려나?


VHDL

1983 DoD / ieee 1076-1987 / ada, pascal

[링크 : https://en.wikipedia.org/wiki/VHDL]

VHSIC Hardware Description Language

[링크 : https://en.wikipedia.org/wiki/VHSIC]


Verilog

1983~1984 early ,cadence design system / ieee 1364-1995 / c

Verilog is a portmanteau of the words "verification" and "logic"

[링크 : https://en.wikipedia.org/wiki/Verilog]

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

vhdl / verilog 문법관련 링크  (0) 2017.12.26
xilinx vivado HLx / HLS  (0) 2017.12.24
VHDL 문법 공부중 1  (0) 2017.12.10
VHDL 문법 관련  (0) 2017.12.08
VHDL 문법  (0) 2017.12.07
Posted by 구차니
Programming/VHDL2017. 12. 10. 23:45

VHDL 책 보고 정리중.

나중에 verilog도 한번 봐야겠다.


일단 프로그래머 입장에서 보는 차이라고 해야하나?

연산자가 의외로 많이 다르다 -ㅁ-

 C VHDL 

== 

<= 

!= 

/= 


주석(comment)는 한줄짜리만 있고 여러줄 짜리는 없는 듯 하다.

 C

 VHDL 

 //

 -- 


동작적 모델링 - process() - 순차기술문(sequential)

                     case-when

                     signal - 병행기술문(concurrent) (?)

데이터 흐름 모델링 - when-else

                            with-select-when

구조적 모델링 - component

                      port map 


signal은 내부 회로(entity)간의 연결시 사용

architecture design of vhdl_test is

    signal k : std_logic_vector(2 downto 0)

begin

end 


process는 k의 값이 변할때 마다 수행(트리거?)

process(k)

end

begin


case-when c의 switch-case에 비슷한 구성이고

default:는 when others => null에 대응된다.

case k is

      when "000" =>

              out <= 1;

              out2 <= 2;

      when "000" => D <= "00000001";

      when others => null;

end case;


with-select-when은 모든 조건에 대해서 테스트 해야 한다.

(case-when 처럼 when others가 먹히지 않는 듯)

문장의 끝이 아니라 ;가 아닌 ,로 표시됨에 주의

with s select

    y <= i(0) when "00",

    y <= i(1) when "01",

    y <= i(2) when "10",

    y <= i(3) when "11";


if - elsif - else 이며 위의 연산자에서 보았듯 =는 할당(assign)이 아닌 비교(equal) 이다.

조금 익숙하게(?) elseif 정도는 좀 해주지 -_-

if diff = -2 then

;

elsif diff = -1 then

;

else

;

endif;


동기클럭사용

falling 과 rising edge에 대응하는 if문

-- clk : std_logic;

rising_edge(clk)

if(clk'event and clk='1') then 


falling_edge(clk) 


when-else는 일종의 우선순위를 가지고 위에서 부터 비교해서 가장 위의 것이 실행된다.

(머.. if-else랑 무슨 차이가 있으려나?)

architecture ...

begin

       y <= i(0) when S="00" else

               i(1) when S="01" else

               i(2) when S="10" else

               i(3);


[링크 : http://www.hanbit.co.kr/store/books/look.php?p_code=B5175626637]



+

2017.12.27

:= 는 변수에 할당

<= 는 signal에 할당

=> 는 case 문에 대한 건데.. others => 라고 쓰는 부분들이 있어서 찾아 봐야 할 듯..

[링크 : https://stackoverflow.com/questions/7988098/vhdl-difference-between-and]

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

xilinx vivado HLx / HLS  (0) 2017.12.24
VHDL과 verilog  (0) 2017.12.11
VHDL 문법 관련  (0) 2017.12.08
VHDL 문법  (0) 2017.12.07
xilinx fpga with vhdl verilog  (0) 2017.12.02
Posted by 구차니
Programming/VHDL2017. 12. 8. 13:19

음.. 이래서 ieee1164 라고 쓰여진거였나 보군...

1364의 경웅는 verilog 추가이고.. 1164 까지는 VHDL 인 듯



[링크 : http://www.micc.unifi.it/seidenari/wp-content/uploads/2010/01/vhdl.pdf]

[링크 : http://www.ics.uci.edu/~jmoorkan/vhdlref/Synario%20VHDL%20Manual.pdf]

[링크 : http://www.srmuniv.ac.in/ramapuram/sites/ramapuram/files/EC308.pdf]

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

VHDL과 verilog  (0) 2017.12.11
VHDL 문법 공부중 1  (0) 2017.12.10
VHDL 문법  (0) 2017.12.07
xilinx fpga with vhdl verilog  (0) 2017.12.02
FPGA / CPLD 차이..?  (0) 2017.11.09
Posted by 구차니
Programming/WPF2017. 12. 8. 10:18

IE 에서 WPF 프로그램이 돌아간다길래

한번 해보려는데 그냥 복붙으로는 안되는 무언가가 많은 듯..


일단 IE는 11버전을 쓰고 있는데

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

  <!-- Page Content -->

  Hello, Page!

</Page>

[링크 : https://msdn.microsoft.com/ko-kr/library/ms750478(v=vs.110).aspx]


위의 녀석을 복/붙 하면 Hello World 하나만 딱 찍힌다.

먼가 수정을 하거나 Page가 아닌 Window로 시작하는걸 복사해서 해보면

<Window xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' Title='Hello World!'>

<Button>Hello World!</Button>

</Window>

권한오류부터 난리가 나는데

실패한 작업:

Demand

실패한 첫 번째 권한 형식:

System.Security.Permissions.SecurityPermission

실패한 첫 번째 권한:

<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

version="1"

Flags="UnmanagedCode"/>


요청 내용:

<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

version="1"

Flags="UnmanagedCode"/> 

[링크 : http://www.kyobobook.co.kr/product/detailViewKor.laf?barcode=9788956744261] 에센셜 WPF


아무튼. Button 하나만 있는 녀석은 잘되는데 두개 하면

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

<Button>Navigate to Another Page</Button>

<Button>Navigate to Another Page</Button>

</Page> 


별별 희한한 오류가 넘쳐난다. 도대체 무슨 구조인거야 ㅠㅠ

System.Windows.Markup.XamlParseException: 'Page'에 이미 자식이 있으며 'Button'을(를) 추가할 수 없습니다. 'Page'에서는 하나의 자식만 허용됩니다. '5' 줄 '9' 위치입니다.

---> System.InvalidOperationException: 'Page'에 이미 자식이 있으며 'Button'을(를) 추가할 수 없습니다. 'Page'에서는 하나의 자식만 허용됩니다. 


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

WPF 예제  (0) 2020.09.07
uwp winform wpf  (0) 2020.09.04
mfc winform wpf 와 .net framework  (0) 2017.12.02
Posted by 구차니
Programming/VHDL2017. 12. 7. 23:11

뜬금없이 공부중!

일단.. 기본적인 문법은 아래와 같다.

대충 보면.. c++ 이나 begin-end 나오는 VB 같기도 하고..


cortex-m3로 따지면 

entity는 입출력 방향과 드라이버 모드 및 핀의 갯수를 설정하고

architecture 에서 해당 entity의(함수?) 내용을(함수 구현) 기재한다.



VHDL을 이용한 FPGA 디지털 설계 실급부터 응용까지

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


1.2 기본 논리 게이트의 VHDL 설계

library ieee;

use ieee.std_logic_1164.all; entity AndOr_vhdl is port( a,b : in std_logic; and_out, or_out, not_out : out std_logic); end AndOr_whdl; architecture design of AndOr_vhdl is begin and_out <= a and b; or_out <= a or b; not_out <= not a; end design;


+

[링크 : https://www.altera.com/support/support-resources/design-examples/design-software/vhdl.html]


의외로(?) if - else, switch - case 같은 제어는 보이는데 

for,while 루프는 존재하지 않네(너무 C언어 개발자 티내나? -ㅁ-)

[링크 : http://webdocs.cs.ualberta.ca/~amaral/courses/329/labs/VHDL_Reference.html]

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

VHDL 문법 공부중 1  (0) 2017.12.10
VHDL 문법 관련  (0) 2017.12.08
xilinx fpga with vhdl verilog  (0) 2017.12.02
FPGA / CPLD 차이..?  (0) 2017.11.09
CPLD, FPGA  (0) 2009.12.17
Posted by 구차니
Programming/C Win32 MFC2017. 12. 7. 14:41

아.. 정리를 안해놨던가?


LPCSTR - LP Const STRing

LPCTSTR - LP Const Tchar STRing

LPCWSTR - LP Const Wchar STRing

[링크 : http://pelican7.egloos.com/v/1768951]


typedef wchar_t WCHAR;    // wc,   16-bit UNICODE character

typedef WCHAR TCHAR, *PTCHAR;


일단.. 시리얼 통신 할때는 대개 1byte로 통신을 하니까

아무생각 없이.. 인터넷상에서 굴러 다니는 MyComm.cpp를 주워서 쓰면

두개가 혼용되어 있어서 데이터가 이상하게 꼬이는 수가 발생한다.

int Receive(LPSTR inbuf, int len);

BOOL Send(LPCTSTR outbuf, int len); 

[링크 : http://forum.falinux.com/zbxe/index.php?document_srl=572404]


아무튼 되도록이면 둘다 LPCSTR로 쓰는게 상책!

Posted by 구차니
Programming/VHDL2017. 12. 2. 20:55

ISE에서 Vivado로 바뀌었는데

은근 자료는 ISE만 많이 나오네..


아무튼!

vivado에서 Verilog와 VHDL을 작성은 가능한데

그렇다고 해서 라이센스 문제로 HDL 언어로 작성된 라이브러리를

ALTERA나 다른 CPLD/FPGA에 쓰는건 라이센스 문제가 있다 정도?

[링크 : https://forums.xilinx.com/.../Transfer-the-HLS-generated-Verilog-HDL-to-Altera-s-FPGA/td-p/676583]


다르게 보면.. HDL로 작성된걸 altera에서 빌드해서 올리는데 기술적으로는 문제가 없다는 건가?

HDL은 하드웨어 표현 언어니까.. 특정 하드웨어에 종속된 언어가 아닌건가?

[링크 : https://www.xilinx.com/training/courses/designing-with-vhdl.html]

[링크 : https://www.xilinx.com/training/courses/designing-with-verilog.html]

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

VHDL 문법 공부중 1  (0) 2017.12.10
VHDL 문법 관련  (0) 2017.12.08
VHDL 문법  (0) 2017.12.07
FPGA / CPLD 차이..?  (0) 2017.11.09
CPLD, FPGA  (0) 2009.12.17
Posted by 구차니
Programming/WPF2017. 12. 2. 20:48

WPF와 winform의 차이는..

노골적으로 이야기 하면 win32를 C++로 랩핑한게 MFC라면 C#으로 랩핑한게 winform이고

구조가 변경되면서 WPF는 단일 윈도우로 내부적으로 그리는 식으로 변경되었고,

이 변경된 구조는 컨트롤이 개별 윈도우를 지닌 것에서

하나의 윈도우를 지님으로서 2d/3d 통합에서 부터 자유로운 변형이 가능하도록 확장 되었다.


일단 한눈에 반하고 WPF로 갈 이유를 결정적으로 보여준 예제

[링크 : https://www.codeproject.com/KB/books/essential_wpf/01fig22.jpg]

   [링크 : https://www.codeproject.com/.../Excerpt-from-Essential-Windows-Presentation-Founda]


[링크 : http://fun.jjang0u.com/articles/view?db=293&no=5727]

[링크 : http://blog.powerumc.kr/451]

[링크 : https://blog.naver.com/jjoommnn/130033352225]


[링크 : https://ko.m.wikipedia.org/wiki/닷넷_프레임워크]


wpf 요구사항 vs2012 이상 버전

[링크 : https://docs.microsoft.com/.../walkthrough-my-first-wpf-desktop-application]

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

WPF 예제  (0) 2020.09.07
uwp winform wpf  (0) 2020.09.04
WPF XAML on IE  (0) 2017.12.08
Posted by 구차니
Programming/C Win32 MFC2017. 11. 28. 15:52

+

2017.11.29

아래에 껄로 해보니 안되서 다시 검색...

CListBox로 GetDlgItem()으로 받아와서 하니 문제없이 된다.


[링크 : http://www.softwareandfinance.com/Visual_CPP/MFC_CListBox_Multiple_Selection.html]

[링크 : https://msdn.microsoft.com/ko-kr/library/ds24bscf.aspx]

---------

음.. 한번에 뱉어내는 무언가는 없나 보네...


POSITION GetFirstSelectedItemPosition( ) const; 

[링크 : https://msdn.microsoft.com/ko-kr/library/hdxt1akf.aspx]


int GetNextSelectedItem(

   POSITION& pos 

) const; 

[링크 : https://msdn.microsoft.com/ko-kr/library/z1dasx7t.aspx]


[링크 : http://thebase.tistory.com/entry/리스트-컨트롤-선택항목-해당-인덱스-얻기]



+

[링크 : https://msdn.microsoft.com/ko-kr/library/hfshke78.aspx]

'Programming > C Win32 MFC' 카테고리의 다른 글

소스 코드 포맷 적용하기  (0) 2018.01.08
win32 시리얼 통신 LPCTSTR / LPCSTR  (0) 2017.12.07
MFC CSdlierCtrl 에서 SetPos()  (0) 2017.11.28
MFC 자식 다이얼로그를 backward로 보내기  (0) 2017.11.28
MFC CListBox  (0) 2017.11.26
Posted by 구차니
Programming/C Win32 MFC2017. 11. 28. 14:08

대개 슬라이드 컨트롤은 0~max 이런식으로 쓰는데

0대신에

-min ~ +max 범위로 하고

SetPos(0)을 하면 설정되지 않는 문제가 있다.(원인은 모르겠네...)


아무튼 해결은 SetTicFreq(1)을 함으로서 이동을 할 수 있게 해주는거라는데

읽기 귀차니즘으로 원인은 일단 패스.. ㅠㅠ


m_slidervertical.SetBuddy(&m_ChartCtrl, FALSE);

m_slidervertical.SetRange(-10, 10);

slidervertical.SetTicFreq( 1 );

m_slidervertical.SetPos(0); 

[링크 : https://www.codeproject.com/Questions/368298/CSliderCtrl-SetPos-not-correct-when-range-is-set]


SetTicFreq 기본값이 1이라는데 도대체 머가 원인인거야 -ㅁ-?

[링크 : https://msdn.microsoft.com/ko-kr/library/2bzb42aa.aspx]

Posted by 구차니