forked from sinara-hw/assembly
157 lines
7.6 KiB
Markdown
157 lines
7.6 KiB
Markdown
# Sinara 4456 synthesizer Mirny / Sinara 4457 Almazny Mezzanine card
|
|
|
|
* [Wiki Mirny](https://github.com/sinara-hw/mirny/wiki)
|
|
* [Wiki Almazny](https://github.com/sinara-hw/Almazny/wiki)
|
|
|
|
## JSON
|
|
|
|
```json
|
|
{
|
|
"type": "mirny",
|
|
"almazny": true, // for mirny with almazny only
|
|
"ports": [<port num>],
|
|
"clk_sel": 2, // optional
|
|
"refclk": 125e6 // optional
|
|
}
|
|
```
|
|
|
|
## Getting the firmware
|
|
|
|
Here is [Mirny 0.3.1 firmware](../extra/mirny/mirny-0.3.1.zip). It contains a single ``.jed`` file that can be flashed following [flashing instructions](#flashing). This firmware supports Almazny v1.2+.
|
|
|
|
If you are using a legacy Almazny (v1.0-1.1), due to different signals routed, you need to flash the older [0.2.4 firmware with Almazny support](../extra/mirny/mirny_0.2.4_legacy_almazny.zip).
|
|
|
|
### Building firmware (optional)
|
|
|
|
However, if you need to make chances or build from source, follow these instructions.
|
|
|
|
Once you get your hands on the firmware source code, you will need to work around few shortcomings of Nix, mainly not being able to run dynamically linked executables.
|
|
|
|
You will need:
|
|
- Xilinx ISE 14.7 installed on your system (this guide is assuming ``/opt/Xilinx`` path),
|
|
- an environment with Migen.
|
|
|
|
One way to do it is to create an FHS environment, like ARTIQ does for Vivado, within ARTIQ's ``flake.nix`` (to leverage Migen already being there), by adding these lines:
|
|
|
|
```
|
|
iseEnv = pkgs.buildFHSEnv {
|
|
name = "ise-env";
|
|
targetPkgs = vivadoDeps;
|
|
};
|
|
|
|
ise = pkgs.buildFHSEnv {
|
|
name = "ise";
|
|
targetPkgs = vivadoDeps;
|
|
profile = "set -e; source /opt/Xilinx/14.7/ISE_DS/settings64.sh";
|
|
runScript = "ise";
|
|
};
|
|
```
|
|
|
|
Add them below ``vivadoEnv``. Then add ``iseEnv`` and ``ise`` to the dev shell's build inputs. Call ``nix develop`` on that.
|
|
|
|
Then you can build Mirny:
|
|
|
|
```shell
|
|
nix develop
|
|
ise-env
|
|
cd ../mirny # or wherever your source is at
|
|
source /opt/Xilinx/14.7/ISE_DS/settings64.sh
|
|
python mirny_impl.py
|
|
```
|
|
|
|
### Flashing
|
|
|
|
For flashing, you will need Xilinx ISE 14.7 installed on your system (here assuming ``/opt/Xilinx`` path), and ``xc3sprog`` with the appropriate HS2 JTAG adapter.
|
|
|
|
```shell
|
|
nix-shell -p xc3sprog
|
|
xc3sprog -c jtaghs2 -m /opt/Xilinx/14.7/ISE_DS/ISE/xbr/data -v build/mirny.jed
|
|
```
|
|
|
|
## Testing
|
|
|
|
### Without Almazny
|
|
|
|
```text
|
|
*** Testing Mirny PLLs.
|
|
Initializing CPLDs...
|
|
mirny0_cpld...
|
|
...done
|
|
All mirny channels active.
|
|
Frequencies:
|
|
mirny0_ch0 1000MHz
|
|
mirny0_ch0 info: {'f_outA': 1000000000.0, 'f_outB': 8000000000, 'output_divider': 4, 'f_vco': 4000000000, 'pll_n': 40, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny0_ch1 1100MHz
|
|
mirny0_ch1 info: {'f_outA': 1100000000.0, 'f_outB': 8800000000, 'output_divider': 4, 'f_vco': 4400000000, 'pll_n': 44, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny0_ch2 1200MHz
|
|
mirny0_ch2 info: {'f_outA': 1200000000.0, 'f_outB': 9600000000, 'output_divider': 4, 'f_vco': 4800000000, 'pll_n': 48, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny0_ch3 1300MHz
|
|
mirny0_ch3 info: {'f_outA': 1300000000.0, 'f_outB': 10400000000, 'output_divider': 4, 'f_vco': 5200000000, 'pll_n': 52, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
```
|
|
|
|
After running `artiq_sinara_test`:
|
|
|
|
1. Install gqrx `nix-shell -p gqrx`
|
|
2. Connect HackRF One via USB cable only
|
|
3. Run gqrx and choose `HackRF HackRF One...`
|
|
4. Default settings
|
|
5. When gqrx loaded, start DSP processing with frequency at mirnyN_chM freq
|
|
6. Connect the probe through attenuator to the Mirny's port
|
|
7. You should see significant signal emission on choosen freq compared to nearby freqs (see image below)
|
|
8. Repeat 5-7 for every channel
|
|
|
|
![](../img/mirny_gqrx.png)
|
|
|
|
### With Almazny (ARTIQ 7)
|
|
|
|
At first, `artiq_sinara_test` will prompt you for testing Mirnies as the would be without Almazny.
|
|
After that, it will prompt you with testing the Almazny:
|
|
|
|
```text
|
|
*** Testing Almaznys.
|
|
mirny1_almazny...
|
|
Initializing Mirny CPLDs...
|
|
mirny0_cpld...
|
|
mirny1_cpld...
|
|
...done
|
|
Testing attenuators. Frequencies:
|
|
mirny0_ch0 4000MHz
|
|
mirny0_ch0 info: {'f_outA': 2000000000.0, 'f_outB': 8000000000, 'output_divider': 2, 'f_vco': 4000000000, 'pll_n': 40, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny0_ch1 4100MHz
|
|
mirny0_ch1 info: {'f_outA': 2050000000.0, 'f_outB': 8200000000, 'output_divider': 2, 'f_vco': 4100000000, 'pll_n': 41, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny0_ch2 4200MHz
|
|
mirny0_ch2 info: {'f_outA': 2100000000.0, 'f_outB': 8400000000, 'output_divider': 2, 'f_vco': 4200000000, 'pll_n': 42, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny0_ch3 4300MHz
|
|
mirny0_ch3 info: {'f_outA': 2150000000.0, 'f_outB': 8600000000, 'output_divider': 2, 'f_vco': 4300000000, 'pll_n': 43, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny1_ch0 4500MHz
|
|
mirny1_ch0 info: {'f_outA': 2250000000.0, 'f_outB': 9000000000, 'output_divider': 2, 'f_vco': 4500000000, 'pll_n': 45, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny1_ch1 4600MHz
|
|
mirny1_ch1 info: {'f_outA': 2300000000.0, 'f_outB': 9200000000, 'output_divider': 2, 'f_vco': 4600000000, 'pll_n': 46, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny1_ch2 4700MHz
|
|
mirny1_ch2 info: {'f_outA': 2350000000.0, 'f_outB': 9400000000, 'output_divider': 2, 'f_vco': 4700000000, 'pll_n': 47, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
mirny1_ch3 4800MHz
|
|
mirny1_ch3 info: {'f_outA': 2400000000.0, 'f_outB': 9600000000, 'output_divider': 2, 'f_vco': 4800000000, 'pll_n': 48, 'pll_frac1': 0, 'pll_frac2': 0, 'pll_mod2': 1, 'prescaler': '4/5', 'sysclk': 100000000.0, 'ref_doubler': False, 'ref_divider': False, 'ref_counter': 1, 'f_pfd': 100000000}
|
|
RF ON, all attenuators ON. Press ENTER when done.
|
|
|
|
RF ON, half power attenuators ON. Press ENTER when done.
|
|
|
|
RF ON, all attenuators OFF. Press ENTER when done.
|
|
|
|
SR outputs are OFF. Press ENTER when done.
|
|
|
|
RF ON, all attenuators are ON. Press ENTER when done.
|
|
|
|
RF OFF. Press ENTER when done.
|
|
```
|
|
|
|
Similar to _Without Almazny_, check mirnies' channels emissions on defined frequencies.
|
|
You should also see differences in various modes, but that may require disabling the gain.
|
|
|
|
|
|
### Tips
|
|
|
|
~~Mirnies often fail `ValueError: MUXOUT not high`, in that case restart the tests or reboot the board(s).~~ - fixed in [9569cfb](https://github.com/m-labs/artiq/commit/9569cfb26329c0acdc1705d3256d2506b7bccce5)
|
|
|
|
For Almazny v1.0 and 1.1 support, CPLD firmware 0.2.4 (linked above) must be flashed onto Mirny.
|
|
|
|
For Almazny v1.2+ support, CPLD firmware 0.3.1+ (with fixes) must be flashed onto Mirny. |