Jump to content
  • 0

Verilog


Marcio

Question

14 answers to this question

Recommended Posts

@Marcio,

Rule number one: Hardware design isn't programming.  Hardware designers generate components and designs.  Software designers build functions, objects, and programs.  In a similar manner, you will not be using a compiler when working with hardware.  FPGA design requires synthesis and implementation, not compiling.

Now that we have that out of the way, feel free to take a look at my Verilog tutorial.  Perhaps it might answer some of your questions.  Then feel free to come back when you have an example hardware design that does (or doesn't) work--something you wish to discuss. and I might be able to help you further.

Dan

Link to comment
Share on other sites

16 hours ago, D@n said:

@Marcio ,

Regra número um: o design do hardware não está programado. Os projetistas de hardware geram componentes e projetos. Os designers de software criam funções, objetos e programas. De maneira semelhante, você não utilizará um compilador ao trabalhar com hardware. O design do FPGA requer síntese e implementação, não compilação.

Agora que temos isso fora do caminho, fique à vontade para dar uma olhada no meu tutorial do Verilog . Talvez possa responder a algumas de suas perguntas. Fique à vontade para voltar quando tiver um exemplo de design de hardware que funcione (ou não) - algo que você deseja discutir. e talvez eu possa ajudá-lo ainda mais.

Dan

 

Thank you for the study material. The example I am trying to implement has a 16-bit input and this value will be passed through a serial that supports only 8 bits.

Example:

input [15: 0] a;

output [7: 0] b;

What I mean is that I need to send my serial the input value, but with the 8 bits and then the other 8 bits

Link to comment
Share on other sites

9 minutos atrás, D @ n disse:

São informações suficientes ou suficientes para alterar completamente uma questão, mas ainda não são informações úteis para saber onde posso começar a usar.

Dan

Ok.

Example:

My input value is 16 bits: 0101111011011110

I want you to send my first 8 bits (01011110) to my serial

and then the other 8 bits (11011110)

So that will form my initial 16-bit value (0101111011011110)

Link to comment
Share on other sites

Ahh, okay, now I think I get it.  How to send 16-bits over an 8-bit channel ... You'll need some kind of synchronization, and that'll force you to send 24-bits instead of 16.  I discussed something similar on my blog, here.  In that case, I was trying to send 32-bit value over an 8-bit channel.  I used values I didn't recognize as synchronization (start/end of word) values, non hex values as command values, and then that left my hexadecimal values to send four bits at a time.  It wasn't all that pretty, but it worked.

In another implementation I have, I use 1'bit for synchronization of a 7-bit stream.  I think I used printable ASCII '0'-'9', 'A'-'Z', and 'a'-'z' plus '%' and '@'.  Anything not in the set was a synchronization byte to tell me when to start my mapping.  Hence, if you sent a new line followed by '000000', the code would generate a 36-bit word from it, but if the word was interrupted by a newline, space, or something else it wasn't expecting then it would throw the whole away and start over.  If you'd like to see an example, you can find the character decoding here, and the character to word mapping here.

Dan

Link to comment
Share on other sites

12 minutes ago, D@n said:

Ahh, ok, agora acho que entendi. Como enviar 16 bits por um canal de 8 bits ... Você precisará de algum tipo de sincronização e forçará o envio de 24 bits em vez de 16. Discuti algo semelhante no meu blog, aqui . Nesse caso, eu estava tentando enviar um valor de 32 bits por um canal de 8 bits. Usei valores que não reconheci como valores de sincronização (início / fim da palavra), valores não hexadecimais como valores de comando e, em seguida, deixei meus valores hexadecimais para enviar quatro bits por vez. Não era tão bonito, mas funcionou.

Em outra implementação que tenho, uso 1'bit para sincronização de um fluxo de 7 bits. Acho que usei ASCII imprimível '0' - '9', 'A' - 'Z' e 'a' - 'z' mais '%' e '@'. Qualquer coisa que não esteja no conjunto era um byte de sincronização para me dizer quando iniciar meu mapeamento. Portanto, se você enviasse uma nova linha seguida por '000000', o código geraria uma palavra de 36 bits, mas se a palavra fosse interrompida por uma nova linha, espaço ou outra coisa que ela não esperava, lançaria o todo longe e começar de novo. Se você quiser ver um exemplo, pode encontrar a decodificação de caracteres aqui e o mapeamento de caracteres para palavras aqui .

Dan

 

My initial idea was to make a counter up to the initial 8 bits and store it in a variable and then count the rest and send it to another variable. Am I wrong?

Link to comment
Share on other sites

2 minutes ago, D@n said:

Como isso ajudaria?

Dan

 

Do not know. But that was what I thought to do at the first moment. Then I thought about doing a MUX.

As I told you, I'm starting my studies with Verilog now.

Link to comment
Share on other sites

17 minutes ago, D@n said:

Como você saberá qual byte é o primeiro? Como você transmitirá caracteres não imprimíveis? Qual software você usará para comunicar essas informações com o seu FPGA?

Dan

This is one of my doubts, how to send the exact value, maintaining the order of the bits to form the same initial value

Link to comment
Share on other sites

You will then need a synchronization character--something that isn't any of your 16-bits, that says that the 16-bits will follow starting now.  You might also wish to send only "printable" characters as well.  If you choose printable characters only, the interaction will be much easier to debug.

Dan

Link to comment
Share on other sites

I mean this constructively but (and the only thing that matters is the part after the "but") I'm really wondering if you're at the point where it's meaningful to ask others for help.

At the end of the day, you'll have to do most of the work yourself, No one will take you by the hand and guide you from start to finish. Yes that's harsh but reality is.

My advice is,  get a course book and spend e.g. a working week with it (one working week means nothing when it comes to "real world" digital design competence even though it'll make a huge difference in a classroom setting). Forget any ideas about "being efficient", "focusing on the problem" etc and just learn the basics of what is required. And, if that is the case, don't expect other people to eagerly do your school homework - this can backfire badly in quite a few ways.

Link to comment
Share on other sites

6 minutes ago, xc6lx45 said:

I mean this constructively but (and the only thing that matters is the part after the "but") I'm really wondering if you're at the point where it's meaningful to ask others for help.

At the end of the day, you'll have to do most of the work yourself, No one will take you by the hand and guide you from start to finish. Yes that's harsh but reality is.

My advice is,  get a course book and spend e.g. a working week with it (one working week means nothing when it comes to "real world" digital design competence even though it'll make a huge difference in a classroom setting). Forget any ideas about "being efficient", "focusing on the problem" etc and just learn the basics of what is required. And, if that is the case, don't expect other people to eagerly do your school homework - this can backfire badly in quite a few ways.

 

I agree with you. I'm studying, but there are many doubts and this is part of learning. Thank you.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...