StanfordVLSI / dragonphy2

Open Source PHY v2
Apache License 2.0
21 stars 3 forks source link

Automatically generate jtag/jtag.sv #40

Open sgherbst opened 4 years ago

sgherbst commented 4 years ago

With the automation provided by JusTAG, we're very close to being able to do push-button updates to the register map (i.e., edit markdown files and regenerate the JTAG implementation.) However, there is still one manual step, which wiring between interfaces in jtag/jtag.sv. I think this could be automated because we know the destination interface for each register by the name of the markdown file it came from. Adding this automation would eliminate a potential source of error while making it easier to add/change debug features of the chip.

I noticed that there is a least one bit of combo logic in jtag.sv, which is the reset gating of the analog core reset signal: https://github.com/StanfordVLSI/dragonphy/blob/59089d659f54544086bb62c012f9d1c128826431/vlog/old_chip_src/jtag/jtag.sv#L15 Maybe we could handle this with an optional column in the Markdown file that specifies whether reset gating should be applied?

(I'm not sure if this automation belongs in JusTAG or DragonPHY, but thought I would add it as a task here to start.)

ai-6g-etc commented 3 weeks ago

anybody got this issue ? it seems that Justag cannot work properly on my machine , I installed the latest JustTag v0.0.4.5 verison

cd dragonphy2 --> python make.py --view asic

---> (myenv) master@icpc:~/work/mixed-signal/dragonphy2$ python make.py --view asic ######################################################

WARNING: The msdsl.circuit module is experimental!

######################################################

Failed to import libraries for results parsing. Capabilities may be limited. BUILD STATE DETECTED BUILDING: jtag_config BUILDING: jtag b' M md/acore_intf.md\n M mflowgen.sh\n M setup.py\n M vlog/chip_src/jtag/jtag.sv\n?? 1.sh\n?? =1.0\n?? =1.0.0\n?? Genesis2/\n?? acore_intf.md\n?? install_pyvenv.sh\n?? make.py001back\n?? make.pybakc\n?? mflowgen/\n?? myenv/\n?? p37env/\n?? vlog/chip_src/jtag/raw_jtag_ifc_unq1.sv\n' JTAG ID Code: 0x996cc141 ['2574041409', '4', '/home/master/work/mixed-signal/dragonphy2/md/acore_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/cdr_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/dcore_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/error_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/hist_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/mdll_r1_top_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/prbs_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/sm_ffe_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/sram_multi_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/tx_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/txdata_intf.md', '/home/master/work/mixed-signal/dragonphy2/md/wme_intf.md', PosixPath('/home/master/work/mixed-signal/dragonphy2/vlog/pack/const_pack.sv')] Traceback (most recent call last): File "/home/master/work/mixed-signal/dragonphy2/myenv/bin/justag", line 8, in sys.exit(main()) File "/home/master/work/mixed-signal/dragonphy2/myenv/lib/python3.8/site-packages/justag/JusTAG.py", line 93, in main io_info = pandas.read_html(intf_html)[0] File "/home/master/work/mixed-signal/dragonphy2/myenv/lib/python3.8/site-packages/pandas/io/html.py", line 1212, in read_html return _parse( File "/home/master/work/mixed-signal/dragonphy2/myenv/lib/python3.8/site-packages/pandas/io/html.py", line 1001, in _parse raise retained File "/home/master/work/mixed-signal/dragonphy2/myenv/lib/python3.8/site-packages/pandas/io/html.py", line 981, in _parse tables = p.parse_tables() File "/home/master/work/mixed-signal/dragonphy2/myenv/lib/python3.8/site-packages/pandas/io/html.py", line 257, in parse_tables tables = self._parse_tables(self._build_doc(), self.match, self.attrs) File "/home/master/work/mixed-signal/dragonphy2/myenv/lib/python3.8/site-packages/pandas/io/html.py", line 613, in _parse_tables raise ValueError("No tables found") ValueError: No tables found Traceback (most recent call last): File "make.py", line 158, in main() File "make.py", line 154, in main graph.build() File "/home/master/work/mixed-signal/dragonphy2/dragonphy/graph/graph.py", line 399, in build new_outputs[node_name] = (node.build(src_nodes, node.view), node.view) File "/home/master/work/mixed-signal/dragonphy2/dragonphy/graph/graph.py", line 333, in build return vlog_gen(*config, filename=self.snk_path).generated_files File "/home/master/work/mixed-signal/dragonphy2/dragonphy/jtag.py", line 27, in init self.justag(justag_inputs, cwd=build_dir) File "/home/master/work/mixed-signal/dragonphy2/dragonphy/jtag.py", line 89, in justag assert retcode==0, 'Error when calling justag.' AssertionError: Error when calling justag.

and

================================================================================= cd dragonphy2/build/mflowgen_dragonphy_top ---> make ....... cd 5-info && if [[ -e mflowgen-check-postconditions.py ]]; then ./mflowgen-check-postconditions.py || exit 1; fi && cd .. touch 5-info/.postconditions.stamp mkdir -p 8-rtl/outputs && set -o pipefail && /home/master/work/mixed-signal/dragonphy2/mflowgen/mflowgen/scripts/mflowgen-letters -c -t rtl && chmod +x .mflowgen/8-rtl/mflowgen-run && cp -f .mflowgen/8-rtl/mflowgen-run 8-rtl && if [[ -e .mflowgen/8-rtl/mflowgen-debug ]]; then chmod +x .mflowgen/8-rtl/mflowgen-debug && cp -f .mflowgen/8-rtl/mflowgen-debug 8-rtl; fi && if [[ -e .mflowgen/8-rtl/mflowgen-check-preconditions.py ]]; then chmod +x .mflowgen/8-rtl/mflowgen-check-preconditions.py && cp -f .mflowgen/8-rtl/mflowgen-check-preconditions.py 8-rtl; fi && if [[ -e .mflowgen/8-rtl/mflowgen-check-postconditions.py ]]; then chmod +x .mflowgen/8-rtl/mflowgen-check-postconditions.py && cp -f .mflowgen/8-rtl/mflowgen-check-postconditions.py 8-rtl; fi && cd 8-rtl && if [[ -e mflowgen-check-preconditions.py ]]; then ./mflowgen-check-preconditions.py || exit 1; fi && ./mflowgen-run 2>&1 | tee mflowgen-run.log || exit 1 && cd .. && touch -c 8-rtl/outputs/*

    _     _  

_ _ | | | | | '| | | | | | | | | | | || _| ||

######################################################

WARNING: The msdsl.circuit module is experimental!

######################################################

Failed to import libraries for results parsing. Capabilities may be limited. Visiting cell_name=dragonphy_top Found the following dependencies: ['const_pack', 'acore_debug_intf', 'tx_debug_intf', 'mdll_r1_debug_intf', 'input_buffer', 'analog_core', 'tx_top', 'digital_core', 'mdll_r1_top', 'mdll_inv'] Visiting cell_name=const_pack Found the following dependencies: [] Visiting cell_name=acore_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=tx_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=mdll_r1_debug_intf Found the following dependencies: ['mdll_pkg'] Visiting cell_name=mdll_pkg Found the following dependencies: [] Visiting cell_name=tx_top Found the following dependencies: ['const_pack', 'phase_interpolator', 'input_divider', 'hr_16t4_mux_top', 'qr_4t1_mux_top', 'div_b2', 'inv', 'output_buf_tx'] Visiting cell_name=hr_16t4_mux_top Found the following dependencies: ['hr_4t1_mux_top'] Visiting cell_name=hr_4t1_mux_top Found the following dependencies: ['hr_2t1_mux_top'] Visiting cell_name=hr_2t1_mux_top Found the following dependencies: ['ff_c', 'mux'] Visiting cell_name=ff_c Found the following dependencies: [] Visiting cell_name=mux Found the following dependencies: [] Visiting cell_name=qr_4t1_mux_top Found the following dependencies: ['ff_c', 'qr_mux_fixed', 'tx_inv'] Visiting cell_name=qr_mux_fixed Found the following dependencies: [] Visiting cell_name=tx_inv Found the following dependencies: ['INV_X4'] Visiting cell_name=div_b2 Found the following dependencies: ['ff_c_rn'] Visiting cell_name=ff_c_rn Found the following dependencies: [] Visiting cell_name=inv Found the following dependencies: [] Visiting cell_name=output_buf_tx Found the following dependencies: ['tx_tri_buf', 'termination'] Visiting cell_name=tx_tri_buf Found the following dependencies: ['TBUF_X4'] Visiting cell_name=digital_core Found the following dependencies: ['const_pack', 'cdr_debug_intf', 'sram_debug_intf', 'dcore_debug_intf', 'dsp_debug_intf', 'prbs_debug_intf', 'wme_debug_intf', 'hist_debug_intf', 'error_tracker_debug_intf', 'tx_data_intf', 'channel_gpack', 'error_gpack', 'ffe_gpack', 'constant_gpack', 'ti_adc_reorder', 'avg_pulse_gen', 'adc_unfolding', 'mm_cdr', 'weight_manager', 'datapath_core', 'oneshot_multimemory', 'comb_comp', 'prbs_generator_syn', 'prbs_checker', 'error_tracker', 'histogram_data_gen', 'histogram_mux', 'histogram', 'output_buffer', 'jtag', 'tx_data_gen'] Visiting cell_name=cdr_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=sram_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=dcore_debug_intf Found the following dependencies: ['const_pack', 'ffe_gpack', 'constant_gpack', 'cmp_gpack', 'channel_gpack'] Visiting cell_name=ffe_gpack Found the following dependencies: [] Visiting cell_name=constant_gpack Found the following dependencies: [] Visiting cell_name=cmp_gpack Found the following dependencies: [] Visiting cell_name=channel_gpack Found the following dependencies: [] Visiting cell_name=dsp_debug_intf Found the following dependencies: ['const_pack', 'ffe_gpack', 'constant_gpack', 'cmp_gpack', 'channel_gpack'] Visiting cell_name=prbs_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=wme_debug_intf Found the following dependencies: ['const_pack', 'ffe_gpack', 'channel_gpack'] Visiting cell_name=hist_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=error_tracker_debug_intf Found the following dependencies: ['const_pack'] Visiting cell_name=tx_data_intf Found the following dependencies: ['const_pack'] Visiting cell_name=error_gpack Found the following dependencies: [] Visiting cell_name=ti_adc_reorder Found the following dependencies: ['const_pack'] Visiting cell_name=avg_pulse_gen Found the following dependencies: [] Visiting cell_name=adc_unfolding Found the following dependencies: ['calib_sample_avg', 'calib_hist_measure'] Visiting cell_name=calib_sample_avg Found the following dependencies: [] Visiting cell_name=calib_hist_measure Found the following dependencies: [] Visiting cell_name=mm_cdr Found the following dependencies: ['const_pack', 'mm_pd'] Visiting cell_name=mm_pd Found the following dependencies: ['const_pack'] Visiting cell_name=weight_manager Found the following dependencies: [] Visiting cell_name=datapath_core Found the following dependencies: ['constant_gpack', 'ffe_gpack', 'error_gpack', 'cmp_gpack', 'channel_gpack', 'signed_buffer', 'buffer', 'signed_flatten_buffer_slice', 'comb_ffe', 'comb_comp', 'flatten_buffer', 'bit_aligner', 'flatten_buffer_slice', 'channel_filter', 'sliding_detector', 'detector_gpack'] Visiting cell_name=signed_buffer Found the following dependencies: [] Visiting cell_name=buffer Found the following dependencies: [] Visiting cell_name=signed_flatten_buffer_slice Found the following dependencies: ['signed_flatten_buffer'] Visiting cell_name=signed_flatten_buffer Found the following dependencies: [] Visiting cell_name=comb_ffe Found the following dependencies: [] Visiting cell_name=comb_comp Found the following dependencies: [] Visiting cell_name=flatten_buffer Found the following dependencies: [] Visiting cell_name=bit_aligner Found the following dependencies: [] Visiting cell_name=flatten_buffer_slice Found the following dependencies: ['flatten_buffer'] Visiting cell_name=channel_filter Found the following dependencies: [] Visiting cell_name=sliding_detector Found the following dependencies: [] Visiting cell_name=detector_gpack Found the following dependencies: [] Visiting cell_name=oneshot_multimemory Found the following dependencies: ['const_pack', 'sram'] Visiting cell_name=sram Found the following dependencies: ['sram_144_1024_freepdk45'] Visiting cell_name=prbs_generator_syn Found the following dependencies: [] Visiting cell_name=prbs_checker Found the following dependencies: ['prbs_checker_core'] Visiting cell_name=prbs_checker_core Found the following dependencies: [] Visiting cell_name=error_tracker Found the following dependencies: ['buffer', 'signed_buffer', 'flatten_buffer_slice', 'signed_flatten_buffer_slice', 'error_tracker_core'] Visiting cell_name=error_tracker_core Found the following dependencies: ['sram'] Visiting cell_name=histogram_data_gen Found the following dependencies: [] Visiting cell_name=histogram_mux Found the following dependencies: [] Visiting cell_name=histogram Found the following dependencies: ['histogram_core'] Visiting cell_name=histogram_core Found the following dependencies: ['sram_small'] Visiting cell_name=sram_small Found the following dependencies: ['sram_64_256_freepdk45'] Visiting cell_name=jtag Found the following dependencies: ['raw_jtag_ifc_unq1', 'ffe_gpack', 'raw_jtag'] Visiting cell_name=raw_jtag_ifc_unq1 Found the following dependencies: [] Visiting cell_name=raw_jtag Found no matches for cell_name=raw_jtag: using view_order=['pack', 'chip_src'] using override={'sram': 'chip_src_freepdk45', 'sram_small': 'chip_src_freepdk45', 'tx_tri_buf': 'chip_src_freepdk45', 'qr_mux_fixed': 'chip_src_freepdk45', 'mdll_inv': 'chip_src_freepdk45', 'tx_inv': 'chip_src_freepdk45'} Traceback (most recent call last): File "gen_tcl.py", line 19, in file_list += get_deps_asic(e['design_name'], process=e['adk_name']) File "/home/master/work/mixed-signal/dragonphy2/dragonphy/views.py", line 211, in get_deps_asic deps += get_deps( File "/home/master/work/mixed-signal/dragonphy2/dragonphy/views.py", line 129, in get_deps deps += get_deps(cell_name=submod, view_order=view_order, override=override, File "/home/master/work/mixed-signal/dragonphy2/dragonphy/views.py", line 129, in get_deps deps += get_deps(cell_name=submod, view_order=view_order, override=override, File "/home/master/work/mixed-signal/dragonphy2/dragonphy/views.py", line 129, in get_deps deps += get_deps(cell_name=submod, view_order=view_order, override=override, File "/home/master/work/mixed-signal/dragonphy2/dragonphy/views.py", line 102, in get_deps impl_file = find_preferred_impl( File "/home/master/work/mixed-signal/dragonphy2/dragonphy/views.py", line 51, in find_preferred_impl raise Exception('Build failed due to a missing cell definition.') Exception: Build failed due to a missing cell definition. make: *** [Makefile:604: 8-rtl/.execstamp] Error 1