added Portuguese documentation; see #245

This commit is contained in:
hneemann 2019-02-16 09:58:09 +01:00
parent ae070dddaf
commit 8e1436e775
23 changed files with 1121 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,556 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<chapter name="Digital">
<subchapter name="Introduction">
<par>
Digital é um simulador simples usado para testar circuitos digitais. As portas lógicas são conectadas
umas às outras por fios e o comportamento de todo o circuito pode ser simulado.
O usuário pode interagir com a simulação ou pressionando botões, ou definindo
valores para as entradas do circuito.
</par>
<par>
Dessa forma, a maioria dos circuitos básicos usados em eletrônica digital pode ser construída e simulada.
Na pasta <e>examples</e>, os usuários encontrarão exemplos que incluem até um processador Harvard de 16-bits
de ciclo único completamente funcional.
</par>
<par>
O simulador tem dois modos de operação: Edição e Simulação.
No modo de edição, modificações no circuito poderão ser efetuadas. Os usuários poderão adicionar ou conectar componentes.
Nesse modo, a simulação estará desabilitada.
O modo de simulação será ativado ao se pressionar o botão <e>Iniciar</e> na barra de tarefas.
Ao iniciar-se a simulação, o circuito será testado em relação à sua consistência.
Se houver erros no circuito, uma mensagem apropriada será exibida e
os componentes ou fios afetados ficarão em destaque. Se não houver erro, a simulação estará habilitada a prosseguir.
Será possível, então, interagir com a simulação em curso.
No modo de simulação não será possível modificar o circuito. Para fazer isso, para voltar ao modo de edição
será necessário parar a simulação.
</par>
</subchapter>
<subchapter name="First Steps">
<par><image src="scr00.png"/></par>
<par>
Como um primeiro exemplo, sugere-se construir um circuito com uma porta OU_Exclusivo (XOR).
Na janela principal, o menu <e>Componentes</e> permitirá a seleção de vários tipos de componentes.
Eles serão posicionados na área de trabalho. Esse processo poderá ser cancelado pressionando-se a tecla ESC a qualquer momento.
Sugere-se iniciar pela seleção de um componente de entrada.
Mais tarde esse componente poderá ser controlado interativamente mediante uso do mouse.
<par><image src="scr01.png"/></par>
<par>
Após seleção, a primeira entrada poderá ser posicionada na área de trabalho.
O ponto vermelho no símbolo do componente de entrada será seu ponto de conexão com um fio,
ao qual se conectará mais tarde.
A cor vermelha indicará uma saída. Isso significa que a porta definirá um sinal cujo valor será transmitido ao fio.
</par>
<par><image src="scr02.png"/></par>
<par>
Da mesma forma, uma segunda entrada deverá ser adicionada. O melhor lugar para posicioná-la será diretamente abaixo da primeira.
</par><image src="scr03.png"/></par>
<par>
Após adicionar as entradas, a porta OU_Exclusivo (XOR) deverá ser selecionada. Essa porta representará o valor lógico da
função.
</par>
<par><image src="scr04.png"/></par>
<par>
Essa porta poderá então ser adicionada ao circuito. É melhor posicioná-la de maneira que estabelecer as conexões subsequentes
sejam tão simples de se fazer quanto o possível. Os pontos azuis indicarão os terminais de entrada da porta.
</par>
<par><image src="scr05.png"/></par>
<par>
Em seguida, selecionar uma saída que será usada para mostrar o estado do sinal, ou que mais tarde transmitirá
ao restante do circuito ao qual estiver incorporada.
</par>
<par><image src="scr06.png"/></par>
<par>
Ela também deverá ser posicionda de maneira que seja fácil executar conexões.
A saída terá um ponto azul, que indicará um terminal de entrada.
Por aí se poderá fornecer o valor que será exportado posteriormente.
</par>
<par><image src="scr07.png"/></par>
<par>
Depois que todos os componentes estiverem selecionados e devidamente posicionados,
usar o mouse para criar as conexões entre os pontos azuis e vermelhos.
Certificar-se que apenas um ponto vermelho esteja conectado a qualquer número de pontos azuis.
Somente o uso de saídas tri-state poderão escapar dessa regra e interconectar
outros pontos vermelhos.
Quando todos os fios estiverem ligados, o circuito estará completo.
</par>
<par><image src="scr08.png"/></par>
<par>
A interação com o circuito será possível quando a simulação for iniciada.
Isso poderá ser feito clicando no botão <e>Iniciar</e> localizado na barra de ferramentas.
Após a simulação iniciar-se, as cores dos fios irão se alterar e
as entradas e as saídas tomarão seus respectivos valores. A cor verde clara indicará o nível lógico '1',
e a verde escura, o nível lógico '0'.
Na figura acima, todos os fios terão o valor '0'.
</par>
<par><image src="scr09.png"/></par>
<par>
Por meio de clicks do mouse, as entradas poderão ser comutadas. Uma vez que a simulação estiver ativa,
as saídas serão alteradas de acordo com os estados das entradas atuais. O circuito se comportará conforme a
porta OU_Exclusivo esperada.
</par>
<par><image src="scr10.png"/></par>
<par>
Para outras manipulações do circuito, primeiro a simulação deverá ser interrompida. A maneira mais fácil de fazer isso é
por meio do botão <e>Parar</e> na barra de ferramentas. Ao clicar o botão direito sobre um componente, uma caixa de diálogo se abrirá
para exibir suas propriedades. O rótulo 'A' poderá ser definido para a primeira entrada
mediante esse atributo.
</par>
<par><image src="scr11.png"/></par>
<par>
Dessa forma, os rótulos das outras entradas e saídas remanescentes poderão ser configurados. No menu
<e>Análise</e> há um item correspondente. Essa função executará a análise do circuito atual.
Contudo, isso somente será possível se todas as entradas e saídas estiverem devidamente rotuladas.
</par>
<par><image src="scr12.png"/></par>
<par>
A tabela-verdade do circuito simulado será apresentada em uma nova janela. Abaixo da tabela poderá ser encontrada
a expressão algébrica associada ao circuito. Se houver várias expressões algébricas equivalentes,
uma janela em separado se abrirá, e mostrará todas as outras possíveis.
</par>
<par><image src="scr13.png"/></par>
<par>
A caixa de diálogo da tabela tem uma entrada <e>K-Map</e> no menu principal. Isso permitirá exibir a tabela-verdade
na forma de um K-Map.
</par>
<par><image src="scr14.png"/></par>
<par>
Na parte de cima da caixa de diálogo há uma lista do tipo drop-down que permitirá selecionar a expressão desejada
no K-Map. Dessa forma se poderá, por exemplo, ilustrar como várias expressóes algébricas equivalentes poderão
daí resultar. Entretanto, para esse exemplo, há apenas uma expressão mínima.
A tabela-verdade também poderá ser modificada por meio de clicks no K-Map.
</par>
</subchapter>
<subchapter name="Wires">
<par>
Todos os componentes deverão estar conectados por fios. Não será possível conectar dois componentes simplesmente
colocando-os diretamente justapostos.
</par>
<par>
Além disso, só haverá conexões entre o ponto final de um fio e um componente.
Se um pino de um componente for colocado no meio de um fio, nenhuma conexão se estabelecerá entre o componente
e o fio.
Portanto, um fio deverá realmente terminar em cada pino ao qual estiver conectado.
Mesmo se um componente do tipo túnel for utilizado, deverá haver um fio entre o pino e esse túnel.
</par>
<par>
É necessário que o componente seja selecionado mediante a ferramenta de seleção retangular para que possa ser movido,
incluindo os fios conectados. Para mover um componente sem os fios conectados,
selecioná-lo apenas pelo click do mouse.
</par>
<par>
Com CTRL-click se poderá selecionar um único fio e movê-lo ou apagá-lo.
Se a tecla 'D' for pressionada enquanto o fio for traçado, esse traçado poderá ser feito na diagonal.
A tecla 'S' permitirá dividir um segmento de linha em dois.
</par>
</subchapter>
<subchapter name="Hierarchical Design">
<par>
Ao se construir um circuito complexo, esse poderá se tornar rapidamente muito confuso. Para ajudar,
diferentes partes de um circuito poderão ser armazenadas em arquivos distintos. Esse mecanismo também poderá ser
usado em um subcircuito que, uma vez criado, venha ocorrer em vários outros circuitos.
Essa abordagem é vantajosa porque os arquivos poderão ser armazenados independentemente empregando-se
um sistema para o controle de versões, e as eventuais mudanças poderão ser melhor acompanhadas.
</par>
<par><image src="scr20.png"/></par>
<par>
Por exemplo, considerar um somador de 4-bits: primeiramente, se construirá um somador simples para 2-bits (meia-soma).
Esse será constituído por uma porta XOR e uma porta AND. A soma de dois bits 'A' e 'B' produzirá as saídas 'S' (soma) e 'C' (vai-um).
Esse circuito será armazenado no arquivo <e>halfAdder.dig</e>.
</par>
<par><image src="scr21.png"/></par>
<par>
A partir da combinação de dois circuitos de meia-soma, um somador completo (full adder) poderá ser construído. Para isso, basta criar um arquivo vazio e
salvá-lo como <e>fullAdder.dig</e> na mesma pasta onde estiver o <e>halfAdder.dig</e>. Em seguida,
o somador simples poderá ser adicionado ao novo circuito via menu <e>Componentes</e><arrow/><e>Personalizado</e>.
A ordem dos pinos no pacote do somador simples poderá ser rearranjada pelo
menu <e>Editar</e><arrow/><e>Ordenar entradas</e> ou <e>Editar</e><arrow/><e>Ordenar entradas</e>.
O somador completo operará os três bits 'A', 'B' e 'Ci' e produzirá as saídas 'S' (soma) e 'Co' (vai-um).
</par>
<par><image src="scr22.png"/></par>
<par>
Para se verificar a correção da função do somador completo, um caso de testes poderá ser acrescentado. No caso de testes,
a tabela-verdade será armazenada, a qual será submetida ao circuito. Dessa forma se poderá automaticamente
verificar seu comportamento.
</par>
<par><image src="scr23.png"/></par>
<par>
Os testes poderão ser executados via editor de caso de testes ou pelo botão de teste na barra de ferramentas.
As células da tabela receberão destaque na cor verde para indicar quando a saída do circuito for equivalente
à tabela-verdade nesse caso de testes.
</par>
<par><image src="scr24.png"/></par>
<par>
Assim, somadores completos poderão ser combinados para formar um somador em cascata (ripple-carry).
Nesse caso, o vai-um de uma adição serão repassado à próxima como entrada para operar
o bit de ordem mais alta, da mesma maneira como se faz manualmente com papel-e-lápis.
O somador de 4-bits deverá ser testado para confirmar sua função. Para isso, um caso de testes deverá ser acrescentado.
</par>
<par><image src="scr25.png"/></par>
<par>
Um caso de testes executará 100% dos testes, o que somente será possível para circuitos relativamente simples: todas as
possíveis combinações de 512 entradas serão aplicadas ao circuito, e se verificará se sua saída estará correta.
A primeira linha relacionará a lista de sinais de entradas e saídas. Abaixo dessa, os valores das entradas a serem aplicados e
os das saídas a serem verificadas na mesma linha, tal como em uma tabela-verdade.
Nesse exemplo, contudo, 512 linhas serão requeridas. Isso poderá ser uma tarefa tediosa e não isenta da possibilidade de erros.
Será mais fácil e mais confiável gerar automaticamente essas linhas necessárias.
Para isso, as variáveis <e>A</e> e <e>B</e> deverão, cada uma, variar
de 0 a 15. Os respectivos valores de <e>A</e> e <e>B</e> serão atribuídos às entradas 'A[n]' e 'B[n]'.
Isso será verificado com as saídas do circuito para os valores de <e>A+B</e>. Será verificado novamente para
os bits de vai-um definidos, para cada caso em que resultar em <e>A+B+1</e>.
Os detalhes da sintaxe de teste serão fornecidos pela caixa de diálogo de ajuda.
</par>
<par>
Se um circuito estiver incorporado a outro, somente o nome do subcircuito será armazenado nesse, e não o próprio subcircuito.
Os arquivos correspondentes aos subcircuitos incorporados deverão portanto serem encontrados na pasta de arquivos
do sistema durante a simulação.
De modo a prover suporte para os diversos métodos de trabalho dos usuários da melhor forma possível, e ainda evitar
uma administração complexa dos caminhos para a importação e similares, uma estratégia pouco usual para fazê-lo foi implementada.
</par>
<par>
Somente os nomes dos circuitos incorporados serão armazenados no arquivo do circuito, não seus caminhos completos.
Se um arquivo necessitar ser aberto, todas as subpastas serão vasculhadas para se encontrar o arquivo com nome correspondente.
Se um arquivo aceitável for encontrado, será importado. Esse processo dependerá apenas do nome do arquivo a ser lido,
e não do caminho até ele. De forma correspondente, uma mensagem de erro será gerada se houver diversos arquivos com nomes iguais
em subpastas diferentes, uma vez que haverá ambiguidades.
</par>
<par>
Uma estrutura de projeto adequada portanto será a seguinte: o circuito principal (raiz) ficará localizado em uma pasta separada.
Todos os circuitos importados deverão estar na mesma pasta ou em subpastas. Todos os circuitos deverão ter nomes diferentes,
dessa forma não deverá acontecer que ocorram circuitos com o mesmo nome em pastas diferentes.
</par>
</subchapter>
</chapter>
<chapter name="Simulation">
<subchapter name="Propagation Delay">
<par>
Durante a simulação, cada porta lógica terá um atraso de propagação. Cada componente encontrado na biblioteca
terá o mesmo atraso de propagação independente de sua complexidade.
Assim a porta AND terá o mesmo atraso de propagação de um multiplicador.
As únicas exceções serão os diodos, as chaves e os distribuidores que serão usados para os barramentos de dados.
Esses componentes não terão qualquer atraso.
</par>
<par>
Se for necessário simular uma porta, por exemplo, um multiplicador, com um atraso de propagação mais longo,
um componente próprio para atraso deverá ser inserido no circuito logo antes da saída do multiplicador.
</par>
<par>
Se um circuito estiver incluído em outro maior, esse incluirá também o seu comportamento ao longo do tempo.
Assim, se um circuito complexo for incluído e tiver um atraso de propagação bem grande, porque os sinais das entradas
terão que passar por três portas, até que cheguem à saída, esse comportamento será conservado quando for incluído
em outro circuito.
Não haverá atrasos adicionais pela inclusão em outro circuito. Se nem todas as saídas de um circuito tiverem
o mesmo atraso de propagação, isso também poderá ser o caso quando for incluído em um circuito maior.
Em geral, ao se incluir um circuito em outro, isso não modificará o comportamento ao longo do tempo de ambos.
Um circuito incorporado a outro se comportará exatamente da mesma forma como se todos os componentes também tivessem
sido inseridos nesse mesmo nível do circuito.
</par>
</subchapter>
</chapter>
<chapter name="Circuit Analysis and Synthesis">
<par>
Um circuito poderá ser analisado via menu<e>Análise</e>. A tabela-verdade será gerada apenas para
circuitos combinacionais. A tabela-verdade poderá ser editada se assim o desejar.
Um novo circuito será gerado a partir dessa tabela-verdade após sua edição.
</par>
<par>
Além de circuitos combinatórios, também será possível analisar ou gerar circuitos sequenciais.
Em lugar de uma simples tabela-verdade, se criará uma tabela de transições de estado.
Cada flip-flop ocorrerá tanto no lado das entradas e quanto no das saídas da tabela de transições de estado.
Nessa tabela, do lado direito, poderão ser encontrados os próximos estados, que tomarão lugar
após o próximo sinal do clock. O próximo estado dependerá do estado atual dos flip-flops encontrados
do lado esquerdo da tabela.
Para que a análise seja possível, todos os flip-flops deverão ter nomes.
</par>
<par>
A seguinte convenção se aplicará: os próximos estados de um bit do lado direito da tabela
serão indicados por letras minúsculas 'n+1'. O estado atual correspondente será indicado pelo sufixo 'n'.
Se houver uma variável de estado 'A', 'An' indicará o estado atual e 'An+1' indicará o próximo estado.
Se, na tabela-verdade dos lados esquerdo e direito, os sinais estiverem presentes, e corresponderem a esse padrão,
irá se supor uma transição de estados nessa tabela, e um circuito sequencial será gerado em lugar de um combinacional.
</par>
<par>
Deve-se notar que se um circuito ao ser analisado contiver elementos combinacionais,
além dos flip-flops D e JK nativos, como por exemplo, portas NOR,
isso não será reconhecido com um flip-flop e, portanto, não será possível analisar tal circuito.
</par>
</chapter>
<chapter name="Hardware">
<subchapter name="GAL16v8 and GAL22v10">
<par>
No menu de geração de circuito na tabela-verdade também há funções para se gerar arquivos
JEDEC. Esse formato especial de arquivo descreve o mapa de fusíveis de um PLD.
O arquivo JEDEC poderá ser gravado em um PLD correspondente por meio de um programador especial.
No momento, os circuitos do tipo <e>GAL16v8</e> e <e>GAL22v10</e> ou mapa de fusíveis para dispositivos compatíveis
têm suporte.
</par>
</subchapter>
<subchapter name="ATF150xAS">
<par>
Os chips na família
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/cpld-atf15xx-family">
<e>ATF150x</e>
</a>
são CPLDs comuns com até 128 macrocélulas. São disponíveis em um encapsulamento PLCC,
o que os torna convenientes para exercícios em laboratório: se um circuito integrado se queimar durante os exercícios,
esse poderá ser simplesmente substituído. Além disso, como o
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/hardware/atdh1150usb">
<e>ATDH1150USB</e>
</a>
é bem fácil de usar. Basta ter um programador de baixo custo disponível. Esse programador será capaz de lidar com os chips
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/cpld-atf15xx-family">
<e>ATF150x</e>
</a>
em um sistema que use a interface JTAG.
Uma placa acessível para avaliação
<a href="https://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATF15XX-DK3-U">
(<e>ATF15XX-DK3-U</e>)
</a>
também está disponível.
O software
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/atmisp">
<e>ATMISP</e>
</a>,
à disposição no site da ATMEL/Microchip, será necessário para programar esses chips.
</par>
<par>
Infelizmente, detalhes do mapa de fusíveis não estão publicamente à disposição, de modo que não há filtros adequados para isso
que possam ser incorporados à ferramenta, assim como foi possível para os chips <e>GAL16v8</e> e <e>GAL22v10</e>.
</par>
<par>
Portanto, os filtros <e>fit150[x].exe</e> fornecidos pela ATMEL deverão ser usados. Esses programas criarão um arquivo
<e>JEDEC</e> adequado a partir de um arquivo <e>TT2</e> que poderá então ser usado para programar o chip.
A ferramenta iniciará o filtro automaticamente cada vez que o arquivo <e>TT2</e> for criado. Para esse propósito, o caminho para
os filtros <e>fit150[n].exe</e> deverão estar especificados nas configurações.
O arquivo <e>JEDEC</e> criado poderá ser aberto e programado diretamente com
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/atmisp">
<e>ATMISP</e>
</a>.
</par>
<par>
Por razões legais o filtro <e>fit1502.exe</e> não pode ser distribuído em conjunto com a ferramenta. Contudo,
poderá ser encontrado na pasta <e>WinCupl\Fitters</e> após instalação do
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/wincupl">
<e>WinCupl</e>
</a>.
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/wincupl">
<e>WinCupl</e>
</a>
está à disposição no site da ATMEL/Microchip.
Em sistemas Linux, os filtros também poderão ser executados por essa ferramenta, se estiver instalado o <e>wine</e>.
</par>
</subchapter>
<subchapter name="Export to VHDL or Verilog">
<par>
Um circuito poderá ser exportado para VHDL ou Verilog. Um arquivo será gerado contendo a descrição
completa do circuito. Códigos VHDL gerados foram testados com o
<a href="https://www.xilinx.com/products/design-tools/vivado.html">Xilinx Vivado</a>
e o simulador de código aberto para VHDL - <a href="http://ghdl.free.fr/">ghdl</a>.
O código Verilog foi testado com o simulador <a href="http://iverilog.icarus.com/">Icarus Verilog</a>.
</par>
<par>
Se um circuito contiver casos de testes, seus dados serão usados para gerar o teste comportamental em HDL.
Isso poderá ser usado para verificar a correção da função do circuito em uma simulação em HDL.
</par>
<par>
Arquivos adicionais necessários para placas especiais poderão ser criados. No momento, somente as placas
<a href="https://reference.digilentinc.com/reference/programmable-logic/basys-3/start">BASYS3</a>,
<a href="https://numato.com/product/mimas-spartan-6-fpga-development-board">Mimas</a>
e <a href="https://numato.com/product/mimas-v2-spartan-6-fpga-development-board-with-ddr-sdram">Mimas V2</a>
têm suporte.
Um arquivo de restrições será criado contendo as atribuições aos pinos. As descrições dos pinos poderão ser encontradas
nos data sheet das placas, e deverão ser fornecidas, assim como o número do pino para suas entradas e saídas.
</par>
<par>
Na placa BASYS3, se a frequência de clock de um circuito for baixa, um divisor de frequências será incorporado ao código HDL
a fim de dividir o clock da placa para o valor conveniente.
Se a frequência de clock selecionada exceder 37kHz, a unidade MMCM do Artix-7 será usada para a geração de clock.
Isso garantirá que os recursos disponíveis na FPGA para distribuição do clock serão usados.
Isso permitirá que o exemplo de processador possa ser executado a 20MHz, e se quiser, sem o multiplicador,
30HMz também será possível.
</par>
<par>
Também para as placas Mimas, o Spartan 6 DCM será utilizado para a geração de clock.
</par>
<par>
Se um circuito for executado em uma placa BASYS3, um novo projeto poderá ser criado no Vivado.
O arquivo VHDL gerado e o arquivo de restrições deverão ser acrescentados ao projeto.
Uma vez criado o projeto, a sequência de bits (bitstream) poderá ser gerada e o Gerenciador de Hardware poderá ser usado
para programar a placa BASYS3.
</par>
<par>
Para criar o arquivo de restrições requerido, o circuito deverá conter um campo de texto correspondente a
"Board: BASYS3", "Board: MimasV1" ou "Board: MimasV2".
</par>
</subchapter>
</chapter>
<chapter name="Custom Shapes">
<par>
Embora a ferramenta tenha algumas opções para determinar a aparência de um circuito quando esse for incorporado a outro,
em alguns casos poderá ser mais útil indicá-lo por meio de uma formato bem especial para o subcircuito.
Uma demonstração disso poderá ser a forma de se representar uma ALU em um processador incluída em vários exemplos.
Esse capítulo explicará como definir um formato especial para um circuito.
</par>
<par>
A ferramenta não dispõe de um editor para criar um formato especial. Para isso, um pequeno procedimento será necessário
para dar outros formatos ao circuito: primeiro, o circuito será aberto, o que será representado por determinado formato.
Depois, um gabarito SVG será criado para esse circuito. Nesse gabarito, o circuito será representado por um simples
retângulo. Ele também conterá todos os pinos do circuito, representados em azul (entradas) e vermelho (saídas).
Para se verificar qual círculo correponderá a qual pino, conferir o ID do círculo nas propriedades do objeto.
Esse ID estará na forma <e>pino:[nome]</e> ou <e>pino+:[nome]</e>.
Na última forma variante, o pino terá um rótulo, caso tenha sido reimportado.
Se tal rótulo não for desejado, o sinal <e>+</e> poderá ser removido.
</par>
<par>
Esse arquivo SVG poderá então ser editado. O mais adequado a se fazer é abrir o programa fonte
<a href="https://inkscape.org/en/">Inkscape</a> disponível gratuitamente.
Os pinos poderão ser movidos livremente, mas aderidos ao ponto mais próximo na grade durante a reimportação.
</par>
<par>
Se arquivos SVG tiverem que ser usados, será mais fácil abrir e criar um gabarito e colar o gráfico existente
nesse via Copiar&amp;Colar.
</par>
<par>
Se o arquivo for salvo, ele poderá ser importado para a ferramenta. O arquivo será lido e todas as informações necessárias
serão extraídas e armazenadas no circuito. Para usos futuros do circuito, o arquivo SVG
não será mais necessário.
</par>
<par>
Uma observação final: SVG é um formato de arquivo muito útil e flexível.
Poderá ser usado para descrever gráficos extremamente complexos. A ferramenta poderá não estar apta para importar todos
os possíveis arquivos SVG sem erros. Se um arquivo não puder ser importado, ou não tiver o aspecto esperado,
alguns experimentos poderão ser necessários antes que o resultado desejado possa ser alcançado.
</par>
</chapter>
<chapter name="Frequently asked Questions">
<faq>
<question>Como mover um fio?</question>
<answer>Selecionar uma das extremidades com a seleção retangular. Assim se poderá mover o fio usando o mouse.
Também se poderá selecionar um fio usando CTRL + botão do mouse.
</answer>
</faq>
<faq>
<question>Como apagar um fio?</question>
<answer>Selecionar uma das extremidades e apertar a tecla <e>DEL</e> ou clicar na lixeira.
Também se poderá selecionar um fio usando CTRL + botão do mouse.
</answer>
</faq>
<faq>
<question>Como mover um componente incluido todos os fios conectados?</question>
<answer>Selecionar o componente com a seleção retangular. A seleção deverá incluir todo o componente.
Depois se poderá mover o componente incluindo seus fios usando o mouse.
</answer>
</faq>
<faq>
<question>Há um componente não conectado a um fio, mesmo havendo pinos sobre o fio.</question>
<answer>Um pino somente estará conectado a um fio se o fio tiver seu ponto final nesse pino.</answer>
</faq>
<faq>
<question>Se os nomes dos pinos em um circuito forem longos, esse não serão legíveis quando o circuito
for incorporado, o que se poderá fazer?</question>
<answer>A largura do bloco poderá ser aumentada usando o item de menu
<e>Editar<arrow/>Editar atribuitos de circuito</e>.</answer>
</faq>
<faq>
<question>Os pinos de um circuito incorporado não estão uma ordem adequada, isso pode ser modificado?</question>
<answer>A sequência poderá ser alterada usando-se a entrada de menu <e>Editar<arrow/>Ordenar entradas</e> ou
<e>Editar<arrow/>Ordenar saídas</e>.</answer>
</faq>
<faq>
<question>Quando a simulação se iniciar, e um fio ficar cinza, o que isso significa?</question>
<answer>As cores verde claro e verde esculo são usadas para representar os estados em nível alto e baixo.
A cor cinza significa que o fio está em estado de alta impedância (Z).
</answer>
</faq>
<faq>
<question>Fornecida a tabela-verdade, como calcular as equações booleanas minimizadas?</question>
<answer>No menu <e>Análise</e> selecionar o item <e>Sintetizar</e>. Depois, fornecer a tabela-verdade.
Na parte de baixo da janela se poderá encontrar a equação booleana correspondente. Se for indicada mais do que uma
variável dependente, uma nova janela se abrirá para apresentar todas as equações booleanas geradas.
</answer>
</faq>
<faq>
<question>Fornecida a tabela-verdade, mas se houver mais do que uma equação booleana apresentada,
qual delas é a correta?
</question>
<answer>A minimização de uma equação booleana poderá resultar em várias equivalentes que descreverão a mesma função.
Todas as mostradas criarão a mesma tabela-verdade.
Poderá haver diferenças dependentes de "don't cares" na tabela-verdade.
</answer>
</faq>
<faq>
<question>Se tiver a tabela-verdade, como criar um circuito que a represente?</question>
<answer>No menu <e>Análise</e> selecionar o item <e>Sintetizar</e>. Depois, fornecer a tabela-verdade.
A tabela poderá ser editada mediante uso dos menus <e>Nova</e> ou <e>Adicionar colunas</e>.
No menu <e>Criar</e> se poderá construir o circuito pelo uso do item <e>Circuito</e>.
</answer>
</faq>
<faq>
<question>Como editar o nome de um sinal na tabela-verdade?</question>
<answer>Clicar com o botão direito sobre o cabeçalho da tabela para editar o nome.</answer>
</faq>
<faq>
<question>Se tiver a equação booleana, como criar um circuito?</question>
<answer>No menu <e>Análise</e> selecionar o item <e>Expressão</e>. Depois, fornecer a expressão.
</answer>
</faq>
<faq>
<question>Como criar uma tabela-verdade para uma equação booleana?</question>
<answer>No menu <e>Análise</e> selecionar o item <e>Expressão</e>. Depois, fornecer a expressão.
Em seguida, criar um circuito e de novo no menu <e>Análise</e> no item <e>Análise</e> criar a tabela-verdade.
</answer>
</faq>
<faq>
<question>Como criar um arquivo JEDEC para um dado circuito?</question>
<answer>No menu <e>Análise</e> selecionar o item <e>Análise</e>. Depois, no menu <e>Criar</e> na
nova janela escolher o dispositivo correto no submenu <e>Dispositivo</e>.
</answer>
</faq>
<faq>
<question>Ao criar um arquivo JEDEC, como atribuir um número de pino a certo sinal?</question>
<answer>Para as entradas e saídas correspondentes se poderá atribuir um número de pino na caixa de diáologo de configuração do mesmo.
</answer>
</faq>
<faq>
<question>Tenho um arquivo JEDEC criado. Como programá-lo para um <e>GAL16v8</e> ou <e>GAL22v10</e>?
</question>
<answer>Para programar tal chip um hardware programador será necessário.</answer>
</faq>
</chapter>
<chapter name="Keyboard Shortcuts" newpage="true">
<shortcuts>
<shortcut key="Space">Iniciar ou parar a simulação.</shortcut>
<shortcut key="F6">Abrir a caixa de diálogo para a tabela de medidas.</shortcut>
<shortcut key="F7">Executar até haver interrupção</shortcut>
<shortcut key="F8">Executar cados de testes</shortcut>
<shortcut key="C">Uma mudança de clock (funcionará se, e somente se, houver um componente de clock simples).</shortcut>
<shortcut key="F9">Análise do circuito</shortcut>
<shortcut key="CTRL-A">Selecionar tudo.</shortcut>
<shortcut key="CTRL-X">Recortar os elementos selecionados para a área de transferência.</shortcut>
<shortcut key="CTRL-C">Copiar os elementos selecionados para a área de transferência.</shortcut>
<shortcut key="CTRL-V">Inserir componentes a partir da área de transferência.</shortcut>
<shortcut key="CTRL-D">Duplicar a seleção atual sem modificar a área de transferência.</shortcut>
<shortcut key="R">Quando inserir isso, rotacionar os componentes.</shortcut>
<shortcut key="L">Inserir o último componente de novo.</shortcut>
<shortcut key="CTRL-N">Novo circuito.</shortcut>
<shortcut key="CTRL-O">Abrir circuito.</shortcut>
<shortcut key="CTRL-S">Salvar circuito.</shortcut>
<shortcut key="CTRL-Z">Desfazer a última modificação.</shortcut>
<shortcut key="CTRL-Y">Reaplicar a última modificação desfeita.</shortcut>
<shortcut key="P">Programar um diodo ou um FG-FET.</shortcut>
<shortcut key="D">Quando traçar um fio alterar para o modo em diagonal.</shortcut>
<shortcut key="F">Quando traçar uma linha mudar a sua orientação.</shortcut>
<shortcut key="S">Dividir um fio em dois.</shortcut>
<shortcut key="ESC">Abortar a ação corrente.</shortcut>
<shortcut key="Del">Remover os componentes selecionados.</shortcut>
<shortcut key="Backspace">Remover os componentes selecionados.</shortcut>
<shortcut key="+">Aumentar o número de entradas no componente apontado pelo mouse.</shortcut>
<shortcut key="-">Diminuir o número de entradas no componente apontado pelo mouse.</shortcut>
<shortcut key="CTRL +">Zoom in</shortcut>
<shortcut key="CTRL -">Zoom out</shortcut>
<shortcut key="F1">Ajustar ao tamanho</shortcut>
<shortcut key="F5">Mostrar ou omitir a exibição hierárquica dos componentes</shortcut>
</shortcuts>
</chapter>
</root>

View File

@ -0,0 +1,565 @@
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<chapter name="Digital">
<subchapter name="Introduction">
<par>
Digital is a simple simulator used to simulate digital circuits. The logic gates are connected
to each other by wires and the behavior of the overall circuit can be simulated.
The user can interact with the simulation by either pressing buttons or setting
values to the inputs of the circuit.
</par>
<par>
In this way, most of the basic circuits used in digital electronics can be built and simulated.
In the folder <e>examples</e>, users can browse for examples that includes a functional
16-bit single-cycle Harvard processor.
</par>
<par>
The simulator has two modes of operation: Editing and Simulation mode.
In the editing mode, modifications to the circuit can be performed. Users can add or connect components.
In this mode, simulation is disabled.
The simulation mode is activated by pressing the <e>Start</e> button in the tool bar.
While starting the simulation the circuit is checked for consistency.
If there are errors in the circuit an appropriate message is shown and
the affected components or wires are highlighted. If the circuit is error free, the simulation is
enabled. Now you can interact with the running simulation.
In the simulation mode it is not possible to modify the circuit. To do so you have to activate the
editing mode again by stopping the simulation.
</par>
</subchapter>
<subchapter name="First Steps">
<par><image src="scr00.png"/></par>
<par>
As a first example, a circuit is to be constructed with an Exclusive-Or gate.
From the main window, the <e>Components</e> menu allows you to select the various components.
Then they are placed on the drawing panel. This process can be canceled by pressing the ESC key at any
time. Start by selecting an input component.
This can later be controlled interactively by using the mouse.
<par><image src="scr01.png"/></par>
<par>
After selection, the first input can be placed on the drawing panel.
The red dot on the input component symbol is a connection point between the component and a wire, which will be
connected later on.
The red color indicates an output. This means that the port defines a signal value or can drive a wire.
</par>
<par><image src="scr02.png"/></par>
<par>
In the same way, a second input is added. It is best to place it directly below the first input.
</par><image src="scr03.png"/></par>
<par>
After adding the inputs, the Exclusive-Or gate is selected. This gate represents the actual logical
function.
</par>
<par><image src="scr04.png"/></par>
<par>
This gate can now also be added to the circuit. It is best to place it in a way that the subsequent
wiring is made as simple as possible. The blue dots indicate the input terminals of the gate.
</par>
<par><image src="scr05.png"/></par>
<par>
Now, select an output which could be used to display a signal state or to later pass signals to
an embedding circuit.
</par>
<par><image src="scr06.png"/></par>
<par>
This is placed in a way that it can be wired easily.
The output has a blue dot, which indicates an input terminal.
Here you can feed in the value which is then exported.
</par>
<par><image src="scr07.png"/></par>
<par>
After all components are selected and in place, use the mouse to wire a connection between the blue and
red dots. Make sure that exactly one red dot is connected to any number of blue dots.
Only the usage of three-state outputs makes it possible to deviate from this rule and to interconnect
several red dots.
If all wires have been drawn, the circuit is complete.
</par>
<par><image src="scr08.png"/></par>
<par>
Interaction with the circuit is possible when simulation is started.
This is done by clicking on the play button located in the toolbar.
After starting the simulation, the color of the wires changes and the
inputs and outputs are now filled. Bright green indicates a logical '1' and dark green a logical '0'.
In the figure above, all wires have a '0' value.
</par>
<par><image src="scr09.png"/></par>
<par>
By clicking with the mouse, the inputs can be switched. Since the simulation is now active, the
output changes according to the current input states. The circuit behaves like an
Exclusive-Or gate as expected .
</par>
<par><image src="scr10.png"/></par>
<par>
To further process the circuit, the simulation must first be stopped. The easiest way to do this is
with the Stop button in the tool bar. Clicking on a component with the right mouse button opens a
dialog which displays the component's properties. The label 'A' can be defined for the first
input via this dialog.
</par>
<par><image src="scr11.png"/></par>
<par>
In this way, the labels for the remaining inputs and outputs can be configured. The menu item
<e>Analysis</e> also contains a menu item <e>Analysis</e>. This function performs an analysis of
the current circuit. However, this is only possible if all inputs and outputs are labeled properly.
</par>
<par><image src="scr12.png"/></par>
<par>
The truth table of the simulated circuit appears in a new window. Below the table you can find the
algebraic expression associated with the circuit. If there are several possible algebraic
expressions, a separate window will open, showing all possible expressions.
</par>
<par><image src="scr13.png"/></par>
<par>
The table dialog has the menu entry <e>K-Map</e> in its main menu. This allows to display the truth
table in the form of a K-map.
</par>
<par><image src="scr14.png"/></par>
<par>
At the top of this dialog there is a drop-down list which allows the selection of the desired
expression in the K-map. In this way you can, for example, illustrate how several equivalent
algebraic expressions can result. However, in this example, there is only one minimal expression.
The truth table can also be modified by clicking the K-map.
</par>
</subchapter>
<subchapter name="Wires">
<par>
All components must be connected via wires. It is not possible to connect two components
by placing them directly next to each other.
</par>
<par>
In addition, there are only connections between an endpoint of a wire and a component.
If a pin of a component is placed in the middle of a wire, no connection is made between the component
and the wire.
Therefore, a wire must actually terminate at each pin which is to be connected.
Even if the tunnel component is used, there must be a wire between the pin and the tunnel element.
</par>
<par>
The component needs to be selected using the rectangular selection tool in order to be moved,
including the connected wires. For moving a component without the connected wires,
select the component using a mouse click.
</par>
<par>
With CTRL-Click a single wire section can be selected to move or delete it.
If the D key is pressed while drawing a wire, a diagonal wire can be drawn.
The key S allows the splitting of a line segment into two segments.
</par>
</subchapter>
<subchapter name="Hierarchical Design">
<par>
If a complex circuit is built up, this can quickly become very confusing. To keep track here,
the different parts of a circuit can be stored in different files. This mechanism also makes it
possible to use a subcircuit, which has been created once, several times in a further circuit.
This approach also offers the advantage that the files can be stored independently of each other in a
version control system and changes can be tracked.
</par>
<par><image src="scr20.png"/></par>
<par>
As an example, consider a 4-bit adder: First, we built a simple half-adder. This consists of an
XOR gate and an AND gate. The sum of the two bits 'A' and 'B' is given to the outputs 'S' and 'C'.
This circuit is stored in the file <e>halfAdder.dig</e>.
</par>
<par><image src="scr21.png"/></par>
<par>
From two half adders a full adder can now be built. To do this, create a new empty file and save the
empty file as <e>fullAdder.dig</e> in the same folder as the half adder. Then the
half adder can be added to the new circuit via the <e>Components</e><arrow/><e>Custom</e> menu.
The order of the pins at the package of the half-adder can be rearranged in the half adder in the
menu <e>Edit</e><arrow/><e>Order inputs</e> or <e>Edit</e><arrow/><e>Order outputs</e>.
The full adder adds the three bits 'A', 'B' and 'Ci' and gives the sum to the outputs 'S' and 'Co'.
</par>
<par><image src="scr22.png"/></par>
<par>
In order to check the correct function of the full adder, a test case should be added. In the test case,
the truth table is stored, which should fulfill the circuit. In this way it can be automatically
checked whether this is the case.
</par>
<par><image src="scr23.png"/></par>
<par>
The tests can be executed via the test case editor or the test button in the toolbar.
The table cells highlighted in green indicate that the output of the circuit matches
the truth table given in the test case.
</par>
<par><image src="scr24.png"/></par>
<par>
Now the full adders can be put together to form a so-called ripple-carry adder.
In this case, the carry output of an addition is forwarded as a carry input to the addition of the
next higher-order bit, just as is usual in pencil-and-paper addition.
This 4-bit adder should be tested for correct function. For this purpose a test case was inserted.
</par>
<par><image src="scr25.png"/></par>
<par>
This test case performs a 100% test, which is possible only with relatively simple circuits: all
possible 512 input combinations are applied to the circuit, and it is checked whether the output
of the circuit is correct.
The first line lists the input and output signals. Below this, the input values to be applied and
the output values to be checked are specified in a row, as in a truth table.
In this example, however, 512 lines are required. Entering this would be a tedious and error-prone task.
It is easier and more reliable to automatically generate the required lines.
For this purpose, the variables <e>A</e> and <e>B</e> are each traversed
from 0 to 15. The respective values of <e>A</e> and <e>B </e> are then assigned to inputs 'A[n]' and 'B[n]'.
Then it is checked whether the circuit outputs the value <e>A+B</e>. Then it is checked again with
the carry bit set, in which case <e>A+B+1</e> must result.
The details of the test syntax are provided by the help dialog.
</par>
<par>
If a circuit is embedded in an other circuit, only the file name of the subcircuit is stored in a
circuit, not the embedded circuit itself.
The corresponding files of
the embedded subcircuits must therefore be found in the file system at runtime of the simulation.
In order to support the various work methods of the users as best as possible and still to avoid a
complex administration of import paths, etc., a somewhat unusual import strategy is implemented.
</par>
<par>
Only the file names of the embedded circuits are stored in a circuits file, not the full path.
If a file needs to be opened, all subfolders are searched for a file of the corresponding name.
If a suitable file is found, it is imported. This process only depends on the file name of the file to
be read, not on its path. Correspondingly, an error message is generated if there are several files of
the same name in different subfolders, since ambiguities then arise.
</par>
<par>
A suitable project structure therefore looks as follows: The root circuit is located in a separate
folder.
All imported circuits must be in the same folder or subfolders. All circuits must have different names,
so it must not happen that there are circuits of the same name in different folders.
</par>
</subchapter>
</chapter>
<chapter name="Simulation">
<subchapter name="Propagation Delay">
<par>
During the simulation every logic gate has a propagation delay. Every component found in the library
has the same propagation delay regardless of its complexity.
The AND gate thus has the same propagation delay as the multiplier.
The only exceptions are diodes, switches and splitters which are used to create data buses.
These components have no propagation delay at all.
</par>
<par>
If it's necessary to simulate a gate - e.g. the multiplier - with a longer propagation delay, a delay
gate must be inserted in the circuit right behind the output of the multiplier.
</par>
<par>
If a circuit is included in another parent circuit, the included circuit keeps its timing behaviour.
So if you include a complex circuit which has a large propagation delay because the input signals
has to pass three gates until it reaches the output, this behaviour is conserved while including this
circuit.
There are no additional delays introduced as a result of including a circuit. If not all outputs of a circuit have
the same propagation delay, then this is also the case if it is included in a parent circuit.
In general, including a circuit into an other circuit does not modify its timing behaviour at all. An
included circuit behaves exactly the same way as if all components had been inserted at the same circuit
level.
</par>
</subchapter>
</chapter>
<chapter name="Circuit Analysis and Synthesis">
<par>
A circuit can be analyzed via the menu entry <e>Analysis</e>. A truth table is generated for purely
combinatorial circuits. This truth table can be edited as desired.
A new circuit can be generated from this truth table after editing.
</par>
<par>
In addition to purely combinatorial circuits, it is also possible to analyze or generate sequential
circuits.
Instead of a simple truth table a so-called state transition table is created.
Each flip-flop thereby appears on the input side and the output side of the state transition table.
In this table, on the right-hand side, you can find the next state, which will
occur after the next clock signal. This next state depends on the current state of the flip-flops as found
at the left-hand side of the table.
For an analysis to be possible, the flip-flops must be named.
</par>
<par>
The following naming convention applies: The following next state of a bit on the right side of the table
is indicated by a lowercase 'n+1'. The corresponding current state is indicated by an appended 'n'.
If there is a state variable 'A', 'An' indicates the current state and 'An+1' indicates the next state.
If, in the truth table on the left and right side, signals are present, which correspond to this pattern
it is assumed that the table is a state transition table, and a sequential circuit is generated instead of
a combinatorial circuit.
</par>
<par>
It should be noted that the circuit to be analyzed may contain only purely combinatorial elements in
addition to the built-in D and JK flip-flops. If a flip-flop is e.g. made from Nor gates, this
circuit is not recognized as a flip-flop and therefore it is not possible to analyse such a circuit.
</par>
</chapter>
<chapter name="Hardware">
<subchapter name="GAL16v8 and GAL22v10">
<par>
In the circuit generation menu in the truth table there are also functions to generate so-called
JEDEC files. This is a special file format that describes the fuse map of a PLD.
This JEDEC file can be written into a corresponding PLD using a special programmer.
At the moment, circuits of the type <e>GAL16v8</e> and <e>GAL22v10</e> or fuse map compatible
devices are supported.
</par>
</subchapter>
<subchapter name="ATF150xAS">
<par>
The chips in the
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/cpld-atf15xx-family">
<e>ATF150x</e>
</a>
family are simple CPLDs with up to 128 macrocells. They are available in a
PLCC package, which makes them suitable for laboratory exercises: If an IC is destroyed during exercises,
it can simply be replaced. In addition, with the
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/hardware/atdh1150usb">
<e>ATDH1150USB</e>
</a>
an easy to use, low-cost programmer is available. This programmer is able to program the
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/cpld-atf15xx-family">
<e>ATF150x</e>
</a>
chips in system using a JTAG interface.
A suitable evaluation board
<a href="https://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATF15XX-DK3-U">
(<e>ATF15XX-DK3-U</e>)
</a>
is also available.
The software
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/atmisp">
<e>ATMISP</e>
</a>,
which is available on the ATMEL/Microchip website, is required for programming the chips.
</par>
<par>
Unfortunately, the fuse map details are not publicly available so that no suitable fitter for this chip
can be integrated in Digital, as is possible with the <e>GAL16v8</e> and <e>GAL22v10</e> chips.
</par>
<par>
Therefore, the fitters <e>fit150[x].exe</e> provided by ATMEL must be used. These programs create a
<e>JEDEC</e> file from a suitable <e>TT2</e> file which can then be programmed on the chip. Digital
starts the fitter automatically every time a <e>TT2</e> file is created. For this purpose, the path to the
<e>fit150[n].exe</e> fitters must be specified in the settings.
The created <e>JEDEC</e> file can then be opened and programmed directly with
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/atmisp">
<e>ATMISP</e>
</a>.
</par>
<par>
For legal reasons the fitter <e>fit1502.exe</e> can not be distributed with Digital. However, it can be
found in the folder <e>WinCupl\Fitters</e> after installing
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/wincupl">
<e>WinCupl</e>
</a>.
<a href="https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/wincupl">
<e>WinCupl</e>
</a>
is available on the ATMEL/Microchip website.
On Linux systems, the fitters can also be executed by Digital if <e>wine</e> is installed.
</par>
</subchapter>
<subchapter name="Export to VHDL or Verilog">
<par>
A circuit can be exported to VHDL or Verilog. A file is generated which contains the complete description
of the circuit. The generated VHDL code was tested with
<a href="https://www.xilinx.com/products/design-tools/vivado.html">Xilinx Vivado</a>
and the open source VHDL simulator <a href="http://ghdl.free.fr/">ghdl</a>.
The Verilog code is tested with the Verilog simulator <a href="http://iverilog.icarus.com/">Icarus Verilog</a>.
</par>
<par>
If a circuit contains test cases, the test data is used to generate a HDL test bench. This can be used
to check the correct function of the circuit in a HDL simulation.
</par>
<par>
Additional files which are needed by special boards can be created. At present only the
<a href="https://reference.digilentinc.com/reference/programmable-logic/basys-3/start">BASYS3</a>
board and the Mimas boards <a href="https://numato.com/product/mimas-spartan-6-fpga-development-board">Mimas</a>
and <a href="https://numato.com/product/mimas-v2-spartan-6-fpga-development-board-with-ddr-sdram">Mimas V2</a>
are supported.
A constraints file is created, which contains the assignment of the pins. The description of the pins can
be found in the boards data sheet, and must be entered as a pin number for the inputs and outputs.
</par>
<par>
At a BASYS3 board, if the circuit clock frequency is low, a frequency divider is integrated into the HDL
code to divide the board clock accordingly.
If the clock frequency selected in the circuit exceeds 37kHz, the MMCM unit of the
Artix-7 is used for clock generation.
This ensures that the FPGA resources provided for the clock distribution are used.
This allows the included example processor to run at 20MHz, and if you can do without the
multiplier, 30HMz is also possible.
</par>
<par>
Also at the Mimas-Boards the Spartan 6 DCM is utilized for the clock generation.
</par>
<par>
If a circuit is to run on a BASYS3 board, a new project can be created in Vivado.
The generated VHDL file and the constraints file must be added to the project.
Once the project has been created, the bitstream can be generated and the Hardware-Manager can be used
to program a BASYS3 board.
</par>
<par>
To create the required constraints file, the circuit must contain a text field with the text
"Board: BASYS3", "Board: MimasV1" or "Board: MimasV2".
</par>
</subchapter>
</chapter>
<chapter name="Custom Shapes">
<par>
Although Digital has some options that determine the appearance of a circuit when it is embedded in
another, in some cases it may be useful to use a very special shape for a subcircuit. An example is
the representation of the ALU in the processor included in the examples. This chapter explains how to
define such a special shape for a circuit.
</par>
<par>
Digital does not provide an editor for creating a special shape. Instead, a small detour is required
for creating circuit shapes: First, the circuit is opened, which is to be represented by a special shape.
Then an SVG template is created for this circuit. In this template, the circuit is represented by a
simple rectangle. It also contains all the pins of the circuit, represented by blue (inputs) and
red (outputs) circuits. To see which circle belongs to which pin, you can look at the ID of the
circle in the object properties. This ID has the form <e>pin:[name]</e> or <e>pin+:[name]</e>.
In the latter variant, the pin is provided with a label if reimported to digital.
If you do not want such a label, the <e>+</e> can be removed.
</par>
<par>
This SVG file can now be edited. The most suitable is the open source program
<a href="https://inkscape.org/en/">Inkscape</a> which is available for free.
The pins can be moved freely, but are moved to the next grid point during the reimport.
</par>
<par>
If existing SVG files are to be used, it is easiest to open the created template and paste the
existing graphic into the template via Copy&amp;Paste.
</par>
<par>
If the file was saved, it can be imported with Digital. The file is read in and all necessary
information is extracted and stored in the circuit. For further use of the circuit, the SVG
file is no longer required.
</par>
<par>
A final remark: SVG is a very powerful and flexible file format.
It can be used to describe extremely complex graphics. The Digital importer is not able to import all
possible SVG files without errors. If a file can not be imported, or does not appear as expected,
some experimentation may be required before the desired result is achieved.
</par>
</chapter>
<chapter name="Frequently asked Questions">
<faq>
<question>How to move a wire?</question>
<answer>Select one of the end points with the rectangular selection. Then move this point using the mouse.
You can also select a wire with CTRL + mouse button.
</answer>
</faq>
<faq>
<question>How to delete a wire?</question>
<answer>Select one of the end points and press <e>DEL</e> or click on the trashcan.
You can also select a wire with CTRL + mouse button.
</answer>
</faq>
<faq>
<question>How to move a component including all the connected wires?</question>
<answer>Select the component with the rectangular selection. The selection must include the entire
component.
Then move the component including the wires using the mouse.
</answer>
</faq>
<faq>
<question>There is a component not connected to a wire, even though the pins are on the wire.</question>
<answer>A pin is only connected to a wire if the wire has an endpoint at the pin.</answer>
</faq>
<faq>
<question>If the names of the pins in a circuit are long, the names are no longer readable when
the circuit is embedded. What can I do?</question>
<answer>The width of the block can be increased using the menu item
<e>Edit<arrow/>Edit circuit attributes</e>.</answer>
</faq>
<faq>
<question>The pins in an embedded circuit have an non-optimal order. How can this be changed?</question>
<answer>The sequence can be changed using the menu entry <e>Edit<arrow/>Order inputs</e> or
<e>Edit<arrow/>Order outputs</e>.</answer>
</faq>
<faq>
<question>When the simulation is started, a wire becomes gray. What does that mean?</question>
<answer>The colors light green and dark green are used to represent high and low state.
Gray means the wire is in high Z state.
</answer>
</faq>
<faq>
<question>I have a truth table. How to calculate the minimized boolean equations?</question>
<answer>In the menu <e>Analysis</e> select the entry <e>Synthesise</e>. Then enter the truth table.
At the bottom of the window you can find the matching boolean equation. If you enter more than one
dependent variable, a new window opens in which all boolean equations are shown.
</answer>
</faq>
<faq>
<question>I have entered a truth table, but there is more then one boolean equation shown.
Which of them is the correct one?
</question>
<answer>Minimizing a boolean equation can result in many equations, describing the same function.
Digital shows all of them and they all create the same truth table.
There may be differences depending on the "don't cares" in the truth table.
</answer>
</faq>
<faq>
<question>I have a truth table. How to create a circuit representing the truth table?</question>
<answer>In the menu <e>Analysis</e> select the entry <e>Synthesise</e>. Then enter the truth table.
You can edit the table using the <e>New</e> or <e>Add Columns</e> menus.
In the menu <e>Create</e> you can create a circuit using the <e>Circuit</e> item.
</answer>
</faq>
<faq>
<question>How to edit a signal's name in the truth table?</question>
<answer>Right click on the name in the table header to edit the name.</answer>
</faq>
<faq>
<question>I have a boolean equation. How to create a circuit?</question>
<answer>In the menu <e>Analysis</e> select the entry <e>Expression</e>. Then enter the expression.
</answer>
</faq>
<faq>
<question>How to create a truth table from a boolean equation?</question>
<answer>In the menu <e>Analysis</e> select the entry <e>Expression</e>. Then enter the expression.
Then create a circuit and in the menu <e>Analysis</e> use the entry <e>Analysis</e> to create the truth
table.
</answer>
</faq>
<faq>
<question>How to create a JEDEC file from a given circuit?</question>
<answer>In the menu <e>Analysis</e> select the entry <e>Analysis</e>. Then in the menu <e>Create</e> in the
new
window choose the correct device in the sub menu <e>Device</e>.
</answer>
</faq>
<faq>
<question>When creating a JEDEC file: How to assign a pin number to a certain signal?</question>
<answer>At the corresponding inputs and outputs you can enter a pin number in the settings dialog of the pin.
</answer>
</faq>
<faq>
<question>I have created a JEDEC file. How to program it to a <e>GAL16v8</e> or <e>GAL22v10</e>?
</question>
<answer>To program such a chip a special programmer hardware is necessary.</answer>
</faq>
</chapter>
<chapter name="Keyboard Shortcuts" newpage="true">
<shortcuts>
<shortcut key="Space">Starts or stops the simulation.</shortcut>
<shortcut key="F6">Opens the measurement table dialog.</shortcut>
<shortcut key="F7">Run to Break</shortcut>
<shortcut key="F8">Execute test cases</shortcut>
<shortcut key="C">A single clock step (Works only in a running simulation and only if there is a single
clock component).
</shortcut>
<shortcut key="F9">Analysis of the circuit</shortcut>
<shortcut key="CTRL-A">Select all.</shortcut>
<shortcut key="CTRL-X">Cuts the selected components to the clipboard.</shortcut>
<shortcut key="CTRL-C">Copys the selected components to the clipboard.</shortcut>
<shortcut key="CTRL-V">Inserts the components from the clipboard.</shortcut>
<shortcut key="CTRL-D">Duplicate the current selection without modifying the clipboard.</shortcut>
<shortcut key="R">While inserting this rotates the components.</shortcut>
<shortcut key="L">Inserts the last inserted component again.</shortcut>
<shortcut key="CTRL-N">New circuit.</shortcut>
<shortcut key="CTRL-O">Open circuit.</shortcut>
<shortcut key="CTRL-S">Save the circuit.</shortcut>
<shortcut key="CTRL-Z">Undo last modification.</shortcut>
<shortcut key="CTRL-Y">Redo the last undone modification.</shortcut>
<shortcut key="P">Programs a diode or a FG-FET.</shortcut>
<shortcut key="D">While drawing a wire switches to the diagonal mode.</shortcut>
<shortcut key="F">While drawing a line flips the orientation.</shortcut>
<shortcut key="S">Splits a single wire into two wires.</shortcut>
<shortcut key="ESC">Abort the current action.</shortcut>
<shortcut key="Del">Removes the selected components.</shortcut>
<shortcut key="Backspace">Removes the selected components.</shortcut>
<shortcut key="+">Increases the number of inputs at the component the mouse points to.</shortcut>
<shortcut key="-">Decreases the number of inputs at the component the mouse points to.</shortcut>
<shortcut key="CTRL +">Zoom In</shortcut>
<shortcut key="CTRL -">Zoom Out</shortcut>
<shortcut key="F1">Fit to size</shortcut>
<shortcut key="F5">Show or hide the components tree view</shortcut>
</shortcuts>
</chapter>
</root>